/* =========================================================
   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);
}

/* 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: 20px 22px;
    border-top: 1px solid #f1f5f9;
    background: #ffffff;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.03);
}

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

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

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

.nca-drawer-shipping-note {
    margin: 0 0 16px 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 */
@media (max-width: 480px) {
    .nca-minicart-drawer {
        max-width: 100%;
    }
    .nca-floating-cart-btn {
        bottom: 16px;
        right: 16px;
        width: 48px;
        height: 48px;
    }
}
