/* =========================================================
   CART — Loja da Barba
   Cards no mobile, sem scroll horizontal, sem modelo/vale.
   Para reverter: remova cart-enhanced.css/js do header.twig
   ========================================================= */

#checkout-cart.ldb-cart {
    overflow: visible;
    background: #F7F6F3 !important;
    padding: 8px 0 36px;
    font-family: "Lexend", sans-serif;
}

#checkout-cart.ldb-cart .container {
    overflow: visible;
    max-width: 100%;
}

#checkout-cart.ldb-cart #content {
    background: transparent !important;
    min-height: 0;
}

.ldb-cart__hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 8px !important;
    padding: 16px 20px 14px !important;
    border: 1px solid #ebe6dc;
    border-top: 3px solid var(--ldb-gold);
    border-radius: 16px !important;
    background: #fff;
    box-shadow: 0 8px 22px rgba(30, 57, 42, 0.05);
    overflow: hidden;
}

.ldb-cart__gap {
    height: 8px;
    width: 100%;
    flex-shrink: 0;
    pointer-events: none;
}

.ldb-cart__hero-copy {
    min-width: 0;
}

.ldb-cart__title {
    margin: 0;
    font-size: clamp(22px, 4.4vw, 28px);
    font-weight: 600;
    color: var(--ldb-ink);
}

.ldb-cart__count {
    margin: 6px 0 0;
    font-size: 13px;
    font-weight: 500;
    color: #5C6670;
}

.ldb-cart__layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 0;
}

.ldb-cart__items {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.ldb-cart__item {
    display: flex;
    gap: 12px;
    min-width: 0;
    padding: 12px;
    border: 1px solid #ebe6dc;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(30, 57, 42, 0.04);
}

.ldb-cart__thumb {
    flex: 0 0 88px;
    width: 88px;
    height: 88px;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #f0ebe3;
}

.ldb-cart__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: auto;
}

.ldb-cart__body {
    flex: 1 1 auto;
    min-width: 0;
}

.ldb-cart__top {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.ldb-cart__name {
    flex: 1 1 auto;
    min-width: 0;
    color: #5C6670;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    text-decoration: none;
}

.ldb-cart__name:hover,
.ldb-cart__name:focus {
    color: var(--ldb-ink);
    text-decoration: none;
}

.ldb-cart__remove {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #9CA3A0;
}

.ldb-cart__remove:hover,
.ldb-cart__remove:focus {
    color: var(--ldb-gold-hover);
    background: #FFFBF2;
}

.ldb-cart__stock,
.ldb-cart__recurring {
    margin: 4px 0 0;
    font-size: 12px;
    color: #c0392b;
}

.ldb-cart__options {
    margin: 6px 0 0;
    padding: 0;
    list-style: none;
    font-size: 12px;
    color: #9CA3A0;
}

.ldb-cart__meta {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
}

.ldb-cart__qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--ldb-border);
    border-radius: 999px;
    overflow: hidden;
    background: #F7F6F3;
}

.ldb-cart__qty-btn {
    width: 34px;
    height: 34px;
    border: 0;
    background: transparent;
    color: var(--ldb-ink);
    font-size: 16px;
    line-height: 1;
}

.ldb-cart__qty-input {
    width: 36px;
    height: 34px;
    border: 0;
    padding: 0;
    text-align: center;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: var(--ldb-ink);
    -moz-appearance: textfield;
}

.ldb-cart__qty-input::-webkit-outer-spin-button,
.ldb-cart__qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.ldb-cart__prices {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 0;
    text-align: right;
}

.ldb-cart__price-old {
    font-size: 12px;
    color: #9CA3A0;
    text-decoration: line-through;
}

.ldb-cart__price-now {
    font-size: 13px;
    font-weight: 600;
    color: var(--ldb-gold-hover);
}

.ldb-cart__line-total {
    font-size: 15px;
    font-weight: 700;
    color: var(--ldb-ink);
}

.ldb-cart__aside {
    min-width: 0;
}

.ldb-cart__summary,
.ldb-cart__extras {
    padding: 16px;
    border: 1px solid #ebe6dc;
    border-radius: 14px;
    background: #fff;
}

.ldb-cart__summary {
    border-top: 3px solid var(--ldb-gold);
    margin-bottom: 12px;
}

.ldb-cart__summary-title,
.ldb-cart__extras-title {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ldb-ink);
}

.ldb-cart__totals {
    margin: 0 0 16px;
}

.ldb-cart__total {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 8px;
    font-size: 14px;
    color: #5C6670;
}

.ldb-cart__total dt,
.ldb-cart__total dd {
    margin: 0;
}

.ldb-cart__total.is-grand {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f0ebe3;
    color: var(--ldb-ink);
    font-size: 16px;
    font-weight: 700;
}

.ldb-cart__total.is-grand dd {
    color: var(--ldb-gold-hover);
}

.ldb-cart__checkout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    border: 0;
    border-radius: 10px;
    background: var(--ldb-cta);
    color: #fff !important;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    text-decoration: none !important;
}

.ldb-cart__checkout:hover,
.ldb-cart__checkout:focus {
    background: var(--ldb-cta-hover);
    color: #fff !important;
}

.ldb-cart__keep {
    display: block;
    margin-top: 10px;
    text-align: center;
    color: var(--ldb-gold-hover);
    font-size: 13px;
    font-weight: 600;
}

.ldb-cart__keep:hover,
.ldb-cart__keep:focus {
    color: var(--ldb-ink);
}

.ldb-cart__empty {
    padding: 40px 16px;
    text-align: center;
    color: #5C6670;
    background: #fff;
    border: 1px solid #ebe6dc;
    border-radius: 14px;
}

.ldb-cart__empty .ldb-cart__checkout {
    max-width: 280px;
    margin: 16px auto 0;
}

.ldb-cart__sticky {
    display: none;
}

#checkout-cart .panel-group .panel {
    margin-bottom: 8px;
    border: 1px solid #ebe6dc;
    border-radius: 12px;
    box-shadow: none;
    overflow: hidden;
}

#checkout-cart .panel-default > .panel-heading {
    background: #FFFBF2;
    border: 0;
    padding: 0;
}

#checkout-cart .panel-title {
    margin: 0;
    padding: 12px 14px;
    color: var(--ldb-ink);
    font-size: 14px;
    font-weight: 600;
}

#checkout-cart .panel-title a {
    display: block;
    padding: 0;
    color: var(--ldb-ink);
    font-size: 14px;
    font-weight: 600;
}

#checkout-cart .panel-title a:hover,
#checkout-cart .panel-title a:focus {
    color: var(--ldb-gold-hover);
    text-decoration: none;
}

#checkout-cart .panel-body {
    background: #fff;
}

#checkout-cart .ldb-cart-shipping .panel-body {
    padding: 0 14px 14px;
}

#checkout-cart .ldb-cart-shipping .panel-heading {
    background: transparent;
    border-bottom: 1px solid #ece4d4;
}

#checkout-cart .ldb-cart-shipping .panel-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--ldb-ink);
}

.ldb-cart-cep__hint {
    margin: 0 0 10px;
    font-size: 13px;
    color: #5C6670;
}

.ldb-cart-cep {
    margin-top: 0;
}

.ldb-cart-cep__label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--ldb-ink);
    margin-bottom: 8px;
}

.ldb-cart-cep__row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.ldb-cart-cep__row .form-control {
    flex: 1;
    min-width: 0;
    height: 44px;
    border-radius: 10px;
    border: 1px solid #e6decc;
}

.ldb-cart-cep__row #button-quote {
    flex-shrink: 0;
    height: 44px;
    padding: 0 18px;
}

.ldb-cart-cep__btn-icon {
    display: none;
    font-size: 14px;
    line-height: 1;
}

.ldb-cart-cep__help {
    margin: 8px 0 0;
    font-size: 12px;
    line-height: 1.35;
}

.ldb-cart-cep__help a {
    color: var(--ldb-gold, #c4a058);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.ldb-cart-cep__help a:hover,
.ldb-cart-cep__help a:focus-visible {
    color: #a88640;
}

.ldb-cart-shipping-results {
    margin-top: 12px;
}

.ldb-cart-shipping-results[hidden] {
    display: none !important;
}

.ldb-cart-shipping-results__loading,
.ldb-cart-shipping-results__error {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
}

.ldb-cart-shipping-results__loading {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f3f8f5;
    color: #3f5649;
}

.ldb-cart-shipping-results__loading-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ldb-gold, #c4a058);
    flex-shrink: 0;
    animation: ldb-cart-shipping-pulse 1s ease-in-out infinite;
}

@keyframes ldb-cart-shipping-pulse {
    0%, 100% { opacity: 0.35; transform: scale(0.92); }
    50% { opacity: 1; transform: scale(1); }
}

.ldb-cart-shipping-results__error,
.ldb-cart-shipping-results.is-error .ldb-cart-shipping-results__error {
    color: #9b2c2c;
}

.ldb-cart-shipping-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.ldb-cart-shipping-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 11px 14px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #e3ebe6;
    box-shadow: 0 1px 2px rgba(30, 57, 42, 0.04);
    cursor: pointer;
    text-align: left;
    font: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ldb-cart-shipping-option:hover,
.ldb-cart-shipping-option:focus-visible {
    border-color: #c4a058;
    box-shadow: 0 0 0 1px rgba(196, 160, 88, 0.25);
    outline: none;
}

.ldb-cart-shipping-option.is-selected {
    border-color: #c4a058;
    box-shadow: 0 0 0 1px rgba(196, 160, 88, 0.35);
    background: #fffdf8;
}

.ldb-cart-shipping-option__main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    flex: 1 1 auto;
    min-width: 0;
}

.ldb-cart-shipping-option__title {
    min-width: 0;
    color: #5f7168;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
}

.ldb-cart-shipping-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    line-height: 1.3;
}

.ldb-cart-shipping-badge--free {
    background: rgba(45, 122, 79, 0.12);
    color: #2d7a4f;
}

.ldb-cart-shipping-badge--lowest {
    background: rgba(196, 160, 88, 0.16);
    color: #8a6b2a;
}

.ldb-cart-shipping-option__price {
    flex: 0 0 auto;
    color: var(--ldb-gold, #c4a058);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.ldb-cart-shipping-option__price.is-free {
    color: #2d7a4f;
}

@media (max-width: 767px) {
    .ldb-cart-cep__btn-label {
        display: none;
    }

    .ldb-cart-cep__btn-icon {
        display: inline-block;
    }

    .ldb-cart-cep__row #button-quote,
    .ldb-cart-cep__row .ldb-cart-cep__btn {
        min-width: 40px;
        padding: 0 12px;
    }
}

#checkout-cart .panel-body .form-group {
    margin-left: 0;
    margin-right: 0;
}

#checkout-cart .panel-body .col-sm-2,
#checkout-cart .panel-body .col-sm-10 {
    width: 100%;
    padding: 0;
    float: none;
}

#checkout-cart #button-coupon,
#checkout-cart #button-quote,
#checkout-cart #button-shipping {
    background: var(--ldb-gold);
    border: 0;
    border-radius: 10px;
    color: var(--ldb-ink);
    font-weight: 700;
}

#checkout-cart #button-coupon:hover,
#checkout-cart #button-coupon:focus,
#checkout-cart #button-quote:hover,
#checkout-cart #button-quote:focus {
    color: #fff !important;
}

#checkout-cart #collapse-coupon .input-group {
    display: flex;
    gap: 8px;
    align-items: stretch;
    width: 100%;
}

#checkout-cart #collapse-coupon .input-group .form-control {
    flex: 1;
    min-width: 0;
    height: 44px;
    border-radius: 10px !important;
    border: 1px solid #e6decc;
}

#checkout-cart #collapse-coupon .input-group-btn {
    width: auto;
    display: block;
}

#checkout-cart #collapse-coupon .input-group-btn > .btn,
#checkout-cart #collapse-coupon .input-group-btn > input.btn {
    height: 44px;
    padding: 0 18px;
    border-radius: 10px !important;
}

#collapse-voucher,
a[href="#collapse-voucher"] {
    display: none !important;
}

body.modal-open .modal-backdrop {
    z-index: 1000100;
    background: var(--ldb-ink);
}

/* Termos (agree): fica atrás do backdrop sem z-index próprio — página “congelada” */
#modal-agree {
    z-index: 1000105 !important;
}

#modal-agree .modal-dialog {
    margin: 24px auto;
    max-width: 920px;
    width: calc(100% - 24px);
}

#modal-agree .modal-content {
    border: 1px solid #ebe6dc;
    border-top: 3px solid var(--ldb-gold);
    border-radius: 16px;
    box-shadow: 0 18px 48px rgba(30, 57, 42, 0.18);
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#modal-agree .modal-header {
    flex: 0 0 auto;
    border-bottom: 1px solid #F0EBE3;
    padding: 16px 20px;
}

#modal-agree .modal-header .close {
    opacity: 1;
    font-size: 28px;
    font-weight: 400;
    line-height: 1;
    color: var(--ldb-ink);
}

#modal-agree .modal-title {
    font-family: "Lexend", sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--ldb-ink);
}

#modal-agree .modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-height: none;
    padding: 16px 20px 24px;
}

.ldb-shipping-modal {
    z-index: 1000101;
    padding: 24px 12px !important;
}

.ldb-shipping-modal .modal-dialog {
    margin: 24px auto;
    max-width: 460px;
    width: calc(100% - 24px);
}

.ldb-shipping-modal .modal-content {
    border: 1px solid #ebe6dc;
    border-top: 3px solid var(--ldb-gold);
    border-radius: 16px;
    box-shadow: 0 18px 48px rgba(30, 57, 42, 0.18);
    overflow: hidden;
}

.ldb-shipping-modal .modal-header {
    border: 0;
    padding: 18px 20px 8px;
    background: #fff;
}

.ldb-shipping-modal .modal-title {
    margin: 0;
    color: var(--ldb-ink);
    font-family: "Lexend", sans-serif;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.35;
}

.ldb-shipping-modal .close {
    margin-top: -4px;
    color: var(--ldb-ink);
    opacity: 0.55;
    font-weight: 400;
}

.ldb-shipping-modal .close:hover {
    opacity: 1;
}

.ldb-shipping-modal .modal-body {
    padding: 8px 20px 8px;
}

.ldb-shipping-group {
    margin-bottom: 12px;
}

.ldb-shipping-group__title {
    margin: 0 0 8px;
    color: #5C6670;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.ldb-shipping-option {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 8px;
    padding: 12px 14px;
    border: 1px solid #ebe6dc;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    font-weight: 500;
}

.ldb-shipping-option:hover {
    border-color: var(--ldb-gold);
}

.ldb-shipping-option:has(input:checked) {
    border-color: var(--ldb-gold);
    background: #FFFBF2;
    box-shadow: inset 0 0 0 1px var(--ldb-gold);
}

.ldb-shipping-option input {
    margin: 0;
    flex: 0 0 auto;
}

.ldb-shipping-option__copy {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-width: 0;
}

.ldb-shipping-option__name {
    color: var(--ldb-ink);
    font-size: 14px;
}

.ldb-shipping-option__price {
    flex-shrink: 0;
    color: var(--ldb-gold-hover);
    font-size: 14px;
    font-weight: 700;
}

.ldb-shipping-modal .modal-footer {
    border-top: 1px solid #f0ebe3;
    padding: 14px 20px 18px;
    background: #fff;
}

.ldb-shipping-modal .modal-footer .btn-default {
    border: 1px solid #ebe6dc;
    border-radius: 10px;
    background: #fff;
    color: #5C6670;
    font-weight: 600;
}

.ldb-shipping-modal #button-shipping {
    background: var(--ldb-cta);
    border: 0;
    border-radius: 10px;
    color: #fff;
    font-weight: 700;
}

.ldb-shipping-modal #button-shipping[disabled] {
    opacity: 0.45;
}

@media (max-width: 767px) {
    body.ldb-cart-sticky-active #mobileBottomBar {
        transform: translateY(110%);
        opacity: 0;
        pointer-events: none;
    }

    #checkout-cart.ldb-cart {
        padding-bottom: 28px;
    }

    body.ldb-cart-sticky-active #checkout-cart.ldb-cart {
        padding-bottom: 96px;
    }

    .ldb-cart__sticky {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1000025;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
        background: rgba(255, 255, 255, 0.96);
        border-top: 1px solid #ebe6dc;
        box-shadow: 0 -8px 24px rgba(30, 57, 42, 0.08);
        transform: translateY(110%);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: transform 0.24s ease, opacity 0.24s ease, visibility 0.24s ease;
    }

    .ldb-cart__sticky.is-visible {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .ldb-cart__sticky-total {
        flex: 1 1 auto;
        min-width: 0;
        color: #5C6670;
        font-size: 12px;
    }

    .ldb-cart__sticky-total strong {
        display: block;
        color: var(--ldb-gold-hover);
        font-size: 16px;
    }

    .ldb-cart__checkout--sticky {
        flex: 0 0 auto;
        width: auto;
        min-width: 148px;
        padding: 12px 14px;
        font-size: 12px;
    }

    body.ldb-pdp-sticky-active .ldb-cart__sticky,
    #mobileBottomBar ~ * .ldb-cart__sticky {
        bottom: 0;
    }
}

@media (min-width: 992px) {
    .ldb-cart__layout {
        flex-direction: row;
        align-items: flex-start;
        gap: 24px;
    }

    .ldb-cart__items {
        flex: 1 1 62%;
    }

    .ldb-cart__aside {
        flex: 0 0 34%;
        position: sticky;
        top: 96px;
    }

    .ldb-cart__thumb {
        flex-basis: 104px;
        width: 104px;
        height: 104px;
    }
}
