/* ==========================================================================
   MhSys Storefront - High-Converting Cart & CRO Stylesheet (ecommerce_cart.css)
   Padrão de Design System: Clean Luxury / Sportswear / Apparel E-commerce
   ========================================================================== */

/* Layout & Containers */
.cart-page-wrapper {
    min-height: 70vh;
    font-family: var(--store-font, 'Plus Jakarta Sans', 'Inter', -apple-system, sans-serif);
}

.cart-main-card {
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: all 0.3s ease;
}

.dark-theme .cart-main-card {
    background: #111827;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.4);
}

/* 1. Barra de Frete Grátis Gamificada (Free Shipping Meter) */
.free-shipping-meter-card {
    background: linear-gradient(135deg, rgba(var(--primary-rgb, 139, 92, 246), 0.06) 0%, rgba(var(--primary-rgb, 139, 92, 246), 0.02) 100%);
    border: 1px solid rgba(var(--primary-rgb, 139, 92, 246), 0.2);
    border-radius: 16px;
    padding: 16px 20px;
    position: relative;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.free-shipping-meter-card.achieved {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.03) 100%);
    border-color: rgba(16, 185, 129, 0.35);
}

.shipping-meter-progress-track {
    height: 8px;
    background: rgba(0, 0, 0, 0.07);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.dark-theme .shipping-meter-progress-track {
    background: rgba(255, 255, 255, 0.12);
}

.shipping-meter-progress-bar {
    height: 100%;
    width: 0%;
    border-radius: 10px;
    background: linear-gradient(90deg, var(--primary-color, #8b5cf6) 0%, #3b82f6 100%);
    transition: width 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.free-shipping-meter-card.achieved .shipping-meter-progress-bar {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.shipping-meter-icon {
    font-size: 1.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    animation: bounceTruck 2s infinite ease-in-out;
}

@keyframes bounceTruck {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* 2. Lista de Itens do Carrinho */
.cart-items-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.cart-item-row {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: background-color 0.2s ease;
}

.dark-theme .cart-item-row {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

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

.cart-item-row:hover {
    background-color: rgba(0, 0, 0, 0.015);
}

.dark-theme .cart-item-row:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.cart-item-image-wrapper {
    width: 88px;
    height: 100px;
    border-radius: 12px;
    overflow: hidden;
    background: #f8fafc;
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.dark-theme .cart-item-image-wrapper {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.08);
}

.cart-item-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.cart-item-image-wrapper:hover img {
    transform: scale(1.06);
}

.cart-item-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.35;
    margin-bottom: 4px;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dark-theme .cart-item-title {
    color: #f1f5f9;
}

.cart-var-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: #f1f5f9;
    color: #475569;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.dark-theme .cart-var-badge {
    background: #1e293b;
    color: #cbd5e1;
    border-color: rgba(255, 255, 255, 0.08);
}

/* Stepper de Quantidade */
.cart-qty-stepper {
    display: inline-flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    padding: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.dark-theme .cart-qty-stepper {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.1);
}

.cart-qty-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #475569;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.dark-theme .cart-qty-btn {
    color: #cbd5e1;
}

.cart-qty-btn:hover:not(:disabled) {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.dark-theme .cart-qty-btn:hover:not(:disabled) {
    background: #334155;
    color: #ffffff;
}

.cart-qty-btn:active:not(:disabled) {
    transform: scale(0.92);
}

.cart-qty-input {
    width: 36px;
    text-align: center;
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    background: transparent;
    color: #1e293b;
    padding: 0;
}

.dark-theme .cart-qty-input {
    color: #f1f5f9;
}

.cart-item-remove-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cart-item-remove-btn:hover {
    background: #fee2e2;
    color: #ef4444;
}

.dark-theme .cart-item-remove-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* 3. Card de Embalagem para Presente & Observações */
.gift-wrap-card {
    background: #fdfdfd;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    padding: 16px;
    transition: all 0.2s ease;
}

.dark-theme .gift-wrap-card {
    background: rgba(255, 255, 255, 0.02);
    border-color: #334155;
}

.gift-wrap-card:hover {
    border-color: var(--primary-color, #8b5cf6);
}

/* 4. Resumo do Pedido & Calculadora de CEP (Coluna Direita) */
.order-summary-card {
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
    padding: 24px;
    position: sticky;
    top: 90px;
}

.dark-theme .order-summary-card {
    background: #111827;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.4);
}

.order-summary-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #0f172a;
    font-family: 'Outfit', sans-serif;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dark-theme .order-summary-title {
    color: #f8fafc;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 0.92rem;
    color: #64748b;
}

.dark-theme .summary-row {
    color: #94a3b8;
}

.summary-row.total-row {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 2px dashed rgba(0, 0, 0, 0.08);
    font-size: 1.15rem;
    color: #0f172a;
    font-weight: 700;
}

.dark-theme .summary-row.total-row {
    border-top-color: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
}

.summary-total-price {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--primary-color, #8b5cf6);
    letter-spacing: -0.5px;
}

/* Destaque PIX & Parcelas */
.pix-highlight-box {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.04) 100%);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 12px;
    padding: 12px 14px;
    margin-top: 16px;
    margin-bottom: 20px;
    text-align: center;
}

.pix-highlight-price {
    font-size: 1.15rem;
    font-weight: 800;
    color: #059669;
}

.dark-theme .pix-highlight-price {
    color: #10b981;
}

.installments-badge {
    font-size: 0.82rem;
    color: #64748b;
    margin-top: 4px;
}

.dark-theme .installments-badge {
    color: #94a3b8;
}

/* Caixa de Cupom de Desconto */
.coupon-input-wrapper {
    display: flex;
    gap: 8px;
    position: relative;
    margin-bottom: 16px;
}

.coupon-input {
    flex: 1;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    padding: 10px 14px;
    font-size: 0.88rem;
    text-transform: uppercase;
    font-weight: 600;
    background: #f8fafc;
    transition: all 0.2s ease;
}

.dark-theme .coupon-input {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

.coupon-input:focus {
    outline: none;
    border-color: var(--primary-color, #8b5cf6);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb, 139, 92, 246), 0.15);
}

.coupon-applied-badge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 14px;
}

.dark-theme .coupon-applied-badge {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    color: #34d399;
}

/* Simulador de Frete */
.shipping-calc-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 20px;
}

.dark-theme .shipping-calc-card {
    background: rgba(255, 255, 255, 0.02);
    border-color: #334155;
}

.shipping-option-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    margin-top: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dark-theme .shipping-option-item {
    background: #1e293b;
    border-color: #334155;
}

.shipping-option-item.selected {
    border-color: var(--primary-color, #8b5cf6);
    background: rgba(var(--primary-rgb, 139, 92, 246), 0.05);
    box-shadow: 0 0 0 1px var(--primary-color, #8b5cf6);
}

/* Botões de Ação de Checkout */
.btn-checkout-primary {
    background: var(--primary-gradient, linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%));
    color: #ffffff !important;
    font-weight: 700;
    font-size: 1.05rem;
    padding: 16px 24px;
    border-radius: 14px;
    border: none;
    box-shadow: 0 8px 20px -4px rgba(var(--primary-rgb, 139, 92, 246), 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    letter-spacing: -0.2px;
}

.btn-checkout-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -4px rgba(var(--primary-rgb, 139, 92, 246), 0.55);
}

.btn-checkout-primary:active {
    transform: translateY(0);
}

.btn-checkout-whatsapp {
    background: #25d366;
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    color: #ffffff !important;
    font-weight: 600;
    font-size: 0.92rem;
    padding: 13px 20px;
    border-radius: 12px;
    border: none;
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 10px;
    transition: all 0.2s ease;
    text-decoration: none;
    cursor: pointer;
}

.btn-checkout-whatsapp:hover {
    background: linear-gradient(135deg, #22c35e 0%, #0e7065 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(37, 211, 102, 0.4);
}

/* Trust Badges */
.trust-badges-box {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    justify-content: space-around;
    text-align: center;
}

.dark-theme .trust-badges-box {
    border-top-color: rgba(255, 255, 255, 0.08);
}

.trust-badge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
}

.trust-badge-item i {
    font-size: 1.25rem;
    color: #10b981;
}

/* 5. Seção de Cross-Sell ("Aproveite e Leve Junto") */
.cross-sell-section {
    margin-top: 36px;
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
    padding: 24px;
}

.dark-theme .cross-sell-section {
    background: #111827;
    border-color: rgba(255, 255, 255, 0.08);
}

.cross-sell-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
    font-family: 'Outfit', sans-serif;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dark-theme .cross-sell-title {
    color: #f8fafc;
}

.cross-sell-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.cross-sell-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.dark-theme .cross-sell-card {
    background: #1e293b;
    border-color: #334155;
}

.cross-sell-card:hover {
    border-color: var(--primary-color, #8b5cf6);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
}

.cross-sell-img-wrap {
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 10px;
    overflow: hidden;
    background: #ffffff;
    margin-bottom: 10px;
}

.cross-sell-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cross-sell-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.3;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dark-theme .cross-sell-name {
    color: #f1f5f9;
}

.cross-sell-price {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-color, #8b5cf6);
    margin-bottom: 10px;
}

.btn-add-cross-sell {
    width: 100%;
    background: #ffffff;
    border: 1px solid var(--primary-color, #8b5cf6);
    color: var(--primary-color, #8b5cf6);
    font-size: 0.82rem;
    font-weight: 700;
    padding: 7px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.dark-theme .btn-add-cross-sell {
    background: #0f172a;
}

.btn-add-cross-sell:hover {
    background: var(--primary-color, #8b5cf6);
    color: #ffffff;
}

/* 6. Toast Flutuante de Desfazer Exclusão (Undo 5s) */
.cart-undo-toast {
    position: fixed;
    bottom: 30px;
    left: 30px;
    background: #0f172a;
    color: #ffffff;
    padding: 14px 20px;
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 10500;
    animation: slideUpToast 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpToast {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.cart-undo-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #38bdf8;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cart-undo-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

/* 7. Sticky Bottom Bar Mobile */
.sticky-cart-mobile-bar {
    display: none;
}

@media (max-width: 991.98px) {
    .order-summary-card {
        position: static;
    }

    .sticky-cart-mobile-bar {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #ffffff;
        border-top: 1px solid rgba(0, 0, 0, 0.08);
        box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.1);
        padding: 12px 16px;
        z-index: 9999;
        backdrop-filter: blur(12px);
    }

    .dark-theme .sticky-cart-mobile-bar {
        background: rgba(17, 24, 39, 0.95);
        border-top-color: rgba(255, 255, 255, 0.1);
    }

    body {
        padding-bottom: 80px;
    }
}
