/* =========================================================
   NOVO CHECKOUT ADD-ON: MINI CART / DRAWER LATERAL STYLES
   ========================================================= */

/* Backdrop escuro com efeito de desfoque */
.nca-minicart-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
}

.nca-minicart-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* Painel da Gaveta Lateral (Slide-over da Direita) */
.nca-minicart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 420px;
    height: 100vh;
    background: #ffffff;
    z-index: 99999;
    box-shadow: -8px 0 35px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: #1e293b;
    box-sizing: border-box;
}

.nca-minicart-drawer * {
    box-sizing: border-box;
}

.nca-minicart-drawer.active {
    transform: translateX(0);
}

/* Puxador decorativo para mobile (oculto no desktop) */
.nca-drawer-drag-handle {
    display: none;
}

/* Header do Drawer */
.nca-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid #f1f5f9;
    background: #ffffff;
}

.nca-drawer-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nca-drawer-icon {
    font-size: 18px;
}

.nca-drawer-title {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.nca-drawer-badge {
    background: #e2e8f0;
    color: #334155;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 9999px;
    margin-left: 2px;
}

.nca-drawer-close {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: all 0.2s ease;
    padding: 0;
}

.nca-drawer-close:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
    transform: rotate(90deg);
}

/* Barra de Progresso de Frete Grátis */
.nca-free-shipping-bar {
    background: #f8fafc;
    padding: 12px 22px;
    border-bottom: 1px solid #f1f5f9;
}

.nca-shipping-text {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
    text-align: center;
}

.nca-shipping-text strong {
    color: #059669;
}

.nca-shipping-track {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 9999px;
    overflow: hidden;
}

.nca-shipping-fill {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.4s ease;
}

/* Corpo / Lista de Itens */
.nca-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 22px;
    overscroll-behavior: contain;
}

.nca-cart-item {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid #f1f5f9;
}

.nca-cart-item:last-child {
    border-bottom: none;
}

.nca-item-thumb {
    width: 68px;
    height: 68px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    overflow: hidden;
    flex-shrink: 0;
}

.nca-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.nca-item-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.nca-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 6px;
}

.nca-item-title {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.nca-item-remove {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    transition: color 0.15s;
}

.nca-item-remove:hover {
    color: #ef4444;
}

.nca-item-variant {
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
    display: block;
}

.nca-item-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
}

/* Seletor de Quantidade */
.nca-qty-selector {
    display: inline-flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 2px;
}

.nca-qty-btn {
    background: none;
    border: none;
    width: 24px;
    height: 24px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    border-radius: 6px;
}

.nca-qty-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.nca-qty-val {
    min-width: 22px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: #0f172a;
}

.nca-item-price {
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
}

/* Estado de Carrinho Vazio */
.nca-empty-cart-wrap {
    text-align: center;
    padding: 40px 10px;
}

.nca-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.8;
}

.nca-empty-cart-wrap h4 {
    margin: 0 0 6px 0;
    font-size: 16px;
    font-weight: 800;
    color: #1e293b;
}

.nca-empty-cart-wrap p {
    margin: 0 0 20px 0;
    font-size: 13px;
    color: #64748b;
}

.nca-btn-continue {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nca-btn-continue:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* Footer do Drawer */
.nca-drawer-footer {
    padding: 16px 20px 20px 20px;
    border-top: 1px solid #f1f5f9;
    background: #ffffff;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.03);
}

/* Seção de Cupom de Desconto */
.nca-drawer-coupon-section {
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px dashed #e2e8f0;
}

.nca-coupon-toggle-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.nca-coupon-title-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nca-coupon-tag-icon {
    width: 14px;
    height: 14px;
    color: #64748b;
}

.nca-coupon-label {
    font-size: 12.5px;
    font-weight: 700;
    color: #334155;
}

/* Botão Power Coupons "DISPONÍVEIS" */
.nca-btn-available-coupons {
    background: #fef08a;
    border: 1px solid #fde047;
    color: #854d0e;
    font-size: 10.5px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    line-height: 1;
}

.nca-btn-available-coupons:hover {
    background: #fde047;
    transform: translateY(-1px);
}

.nca-avail-count {
    background: #854d0e;
    color: #fef9c3;
    font-size: 9.5px;
    font-weight: 900;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Formulário de Inserção de Cupom */
.nca-coupon-input-group {
    display: flex;
    gap: 6px;
}

.nca-coupon-input-group input {
    flex: 1;
    height: 36px;
    padding: 0 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 700;
    text-transform: uppercase;
    color: #0f172a;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #f8fafc;
}

.nca-coupon-input-group input:focus {
    background: #ffffff;
    border-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.15);
}

.nca-btn-apply-coupon {
    height: 36px;
    padding: 0 14px;
    background: #0f172a;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.nca-btn-apply-coupon:hover {
    background: #1e293b;
}

.nca-btn-apply-coupon:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.nca-spinner-sm {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: ncaSpin 0.6s linear infinite;
    display: inline-block;
}

/* Feedback do Cupom */
.nca-coupon-feedback {
    margin-top: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.35;
}

.nca-coupon-feedback.nca-feedback-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.nca-coupon-feedback.nca-feedback-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

/* Chips de Cupons Aplicados */
.nca-applied-coupons-container {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.nca-applied-coupon-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    transition: opacity 0.2s;
}

.nca-chip-tag {
    font-size: 10px;
}

.nca-chip-code {
    letter-spacing: 0.03em;
}

.nca-chip-amount {
    color: #059669;
    font-weight: 800;
}

.nca-chip-remove {
    background: none;
    border: none;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    color: #166534;
    padding: 0 0 0 2px;
    opacity: 0.65;
    transition: all 0.15s ease;
}

.nca-chip-remove:hover {
    opacity: 1;
    color: #dc2626;
    transform: scale(1.15);
}

/* Resumo Financeiro */
.nca-drawer-totals-box {
    margin-bottom: 6px;
}

.nca-drawer-subtotal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.nca-subtotal-label {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
}

.nca-subtotal-value {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
}

.nca-drawer-discount-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
    color: #059669;
}

.nca-discount-label {
    font-size: 13px;
    font-weight: 600;
}

.nca-discount-value {
    font-size: 15px;
    font-weight: 800;
}

.nca-drawer-total-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 6px;
    border-top: 1px dashed #e2e8f0;
    margin-top: 4px;
    margin-bottom: 4px;
}

.nca-total-label {
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
}

.nca-total-value {
    font-size: 19px;
    font-weight: 900;
    color: #0f172a;
}

.nca-drawer-shipping-note {
    margin: 0 0 14px 0;
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.4;
}

.nca-drawer-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nca-btn-checkout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    color: #ffffff !important;
    text-decoration: none !important;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 800;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
    transition: all 0.2s ease;
    cursor: pointer;
}

.nca-btn-checkout:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.nca-arrow-icon {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.nca-btn-checkout:hover .nca-arrow-icon {
    transform: translateX(3px);
}

.nca-btn-keep-buying {
    background: none;
    border: none;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px;
    transition: color 0.15s;
    text-align: center;
}

.nca-btn-keep-buying:hover {
    color: #0f172a;
    text-decoration: underline;
}

/* Spinner de Carregamento */
.nca-drawer-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
    color: #64748b;
    gap: 10px;
    font-size: 12px;
}

.nca-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #e2e8f0;
    border-top-color: #10b981;
    border-radius: 50%;
    animation: ncaSpin 0.7s linear infinite;
}

@keyframes ncaSpin {
    to { transform: rotate(360deg); }
}

/* Botão Flutuante do Carrinho */
.nca-floating-cart-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    z-index: 99990;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.nca-floating-cart-btn:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.nca-floating-cart-btn svg {
    width: 22px;
    height: 22px;
}

.nca-floating-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid #ffffff;
}

/* Responsividade Mobile: Gaveta Bottom Sheet que sobe de baixo para cima com bordas superiores arredondadas */
@media (max-width: 640px) {
    .nca-minicart-drawer {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        height: auto;
        max-height: 88vh;
        border-top-left-radius: 28px;
        border-top-right-radius: 28px;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        box-shadow: 0 -12px 45px rgba(0, 0, 0, 0.28);
        transform: translateY(100%);
        transition: transform 0.38s cubic-bezier(0.2, 0.9, 0.3, 1);
        padding-bottom: max(16px, env(safe-area-inset-bottom, 16px));
        overflow: hidden;
    }

    .nca-minicart-drawer.active {
        transform: translateY(0);
    }

    .nca-drawer-drag-handle {
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 12px 0 6px 0;
        background: #ffffff;
        border-top-left-radius: 28px;
        border-top-right-radius: 28px;
        touch-action: pan-y;
        cursor: pointer;
    }

    .nca-drag-bar {
        width: 44px;
        height: 5px;
        background: #cbd5e1;
        border-radius: 9999px;
        transition: background-color 0.2s ease;
    }

    .nca-drawer-drag-handle:active .nca-drag-bar {
        background: #94a3b8;
    }

    .nca-drawer-header {
        padding: 8px 20px 14px 20px;
    }

    .nca-drawer-body {
        max-height: calc(88vh - 240px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nca-floating-cart-btn {
        bottom: 16px;
        right: 16px;
        width: 48px;
        height: 48px;
    }
}

/* Modal / Drawer Interno de Cupons Disponíveis */
.nca-cart-coupons-modal {
    position: absolute;
    inset: 0;
    z-index: 100005;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.nca-cart-coupons-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    cursor: pointer;
}

.nca-cart-coupons-modal-content {
    position: relative;
    z-index: 2;
    background: #ffffff;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    max-height: 82vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -10px 35px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: ncaSlideUpModal 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes ncaSlideUpModal {
    from {
        transform: translateY(40px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.nca-cart-coupons-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #f1f5f9;
    background: #ffffff;
}

.nca-coupons-header-title {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nca-coupons-icon {
    font-size: 16px;
}

.nca-coupons-header-title h4 {
    margin: 0;
    font-size: 14.5px;
    font-weight: 800;
    color: #0f172a;
}

.nca-coupons-modal-close {
    background: #f1f5f9;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
    padding: 0;
}

.nca-coupons-modal-close:hover {
    background: #fee2e2;
    color: #dc2626;
    transform: rotate(90deg);
}

.nca-cart-coupons-modal-body {
    padding: 14px 18px 24px 18px;
    overflow-y: auto;
    max-height: calc(82vh - 60px);
    overscroll-behavior: contain;
}

/* Tickets Amarelos do Power Coupons */
.nca-ticket-item {
    position: relative;
    background: #fef9c3;
    border: 1.5px dashed #facc15;
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.nca-ticket-item.is-applied {
    background: #f0fdf4;
    border-color: #86efac;
}

.nca-ticket-notch {
    position: absolute;
    width: 14px;
    height: 14px;
    background: #ffffff;
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
}

.nca-notch-left {
    left: -7px;
}

.nca-notch-right {
    right: -7px;
}

.nca-ticket-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.nca-ticket-badge {
    font-size: 15px;
    font-weight: 900;
    color: #854d0e;
    letter-spacing: -0.01em;
}

.is-applied .nca-ticket-badge {
    color: #15803d;
}

.nca-ticket-code {
    background: #ffffff;
    border: 1px dashed #ca8a04;
    color: #854d0e;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 6px;
    letter-spacing: 0.05em;
}

.is-applied .nca-ticket-code {
    border-color: #16a34a;
    color: #15803d;
}

.nca-ticket-desc {
    margin: 0 0 6px 0;
    font-size: 11.5px;
    color: #713f12;
    line-height: 1.4;
}

.is-applied .nca-ticket-desc {
    color: #166534;
}

.nca-ticket-rules {
    display: block;
    font-size: 10px;
    color: #a16207;
    font-weight: 600;
    margin-bottom: 10px;
}

.is-applied .nca-ticket-rules {
    color: #15803d;
}

.nca-ticket-action {
    display: flex;
    justify-content: flex-end;
}

.nca-btn-apply-ticket {
    background: #0f172a;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    border: none;
    border-radius: 8px;
    padding: 7px 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.nca-btn-apply-ticket:hover {
    background: #1e293b;
    transform: scale(1.02);
}

.nca-ticket-applied-badge {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
    font-size: 10.5px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.nca-no-coupons {
    text-align: center;
    padding: 30px 10px;
    color: #64748b;
    font-size: 13px;
}

