/**
 * ============================================
 * 🛒 PÁGINA DE CARRINHO COMPLETO
 * Mantém o mesmo padrão visual do mini-cart
 * ============================================
 */

/* 📦 Container Principal */
.artistaria-cart-page {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

/* 🚚 BARRA DE FRETE GRÁTIS (igual ao mini-cart) */
.cart-free-shipping-bar {
    background: linear-gradient(135deg, #fff8f0 0%, #fff 100%);
    border: 2px solid #ffe4cc;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 24px;
    animation: slideInDown 0.4s ease-out;
}

.cart-free-shipping-bar.level-achieved {
    background: linear-gradient(135deg, #f0fff4 0%, #fff 100%);
    border-color: #86efac;
}

.cart-free-shipping-bar.level-high {
    background: linear-gradient(135deg, #fff7ed 0%, #fff 100%);
    border-color: #fed7aa;
}

.cart-free-shipping-bar.level-medium {
    background: linear-gradient(135deg, #fef3c7 0%, #fff 100%);
    border-color: #fde68a;
}

.free-shipping-message {
    font-size: 15px;
    line-height: 1.4;
    color: #333;
    margin-bottom: 12px;
    text-align: center;
}

.free-shipping-message strong {
    color: #ff9800;
    font-weight: 600;
}

/* Barra de Progresso */
.free-shipping-progress-bar {
    background: #f0f0f0;
    height: 8px;
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 8px;
}

.free-shipping-progress-fill {
    background: linear-gradient(90deg, #ff9800 0%, #ffa726 100%);
    height: 100%;
    border-radius: 100px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.cart-free-shipping-bar.level-achieved .free-shipping-progress-fill {
    background: linear-gradient(90deg, #22c55e 0%, #4ade80 100%);
}

/* Stats (valores) */
.free-shipping-stats {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

/* 📦 LAYOUT 2 COLUNAS */
.cart-layout-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
    align-items: start;
}

/* 🛍️ COLUNA ESQUERDA: Produtos */
.cart-products-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.cart-products-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #2b2b2b;
    margin: 0;
}

.cart-items-count {
    font-size: 14px;
    color: #666;
    background: #f5f5f5;
    padding: 4px 12px;
    border-radius: 100px;
}

/* 🎨 CARD DO PRODUTO (design moderno) */
.cart-product-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 20px;
    display: grid;
    grid-template-columns: 100px 1fr auto;
    gap: 20px;
    align-items: start;
    transition: all 0.2s ease;
}

.cart-product-card:hover {
    border-color: #ff9800;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.1);
}

/* Imagem */
.cart-product-image {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
}

.cart-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-product-image a {
    display: block;
    width: 100%;
    height: 100%;
}

/* Detalhes */
.cart-product-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0; /* Para permitir text-overflow */
}

.cart-product-name {
    font-size: 16px;
    font-weight: 600;
    color: #2b2b2b;
    line-height: 1.4;
}

.cart-product-name a {
    color: #2b2b2b;
    text-decoration: none;
    transition: color 0.2s ease;
}

.cart-product-name a:hover {
    color: #ff9800;
}

/* 📊 LINHA LARANJA (igual ao mini-cart) */
.cart-product-quick-info {
    font-size: 13px;
    color: #ff9800;
    font-weight: 500;
    line-height: 1.4;
}

/* Variações (cor, fonte, etc) */
.cart-product-details .wc-item-meta {
    font-size: 13px;
    color: #666;
    margin: 0;
    padding: 0;
}

.cart-product-details .wc-item-meta p {
    margin: 4px 0;
    font-size: 13px;
    color: #666;
}

.cart-product-details .wc-item-meta strong {
    font-weight: 500;
    color: #333;
}

/* Controles (quantidade + preço + remover) */
.cart-product-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

/* Quantidade */
.cart-product-quantity {
    display: flex;
    align-items: center;
}

.cart-product-quantity .quantity {
    display: flex;
    align-items: center;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
}

.cart-product-quantity input[type="number"] {
    width: 60px;
    height: 36px;
    border: none;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #2b2b2b;
    -moz-appearance: textfield;
}

.cart-product-quantity input[type="number"]::-webkit-outer-spin-button,
.cart-product-quantity input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.cart-product-quantity input[type="number"]:focus {
    outline: none;
    background: #fff8f0;
}

/* Preço */
.cart-product-price {
    font-size: 18px;
    font-weight: 700;
    color: #2b2b2b;
}

.cart-product-price .amount {
    color: #2b2b2b;
}

/* Botão Remover */
.remove-product-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #e5e5e5;
    color: #999;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
}

.remove-product-btn:hover {
    background: #fff1f0;
    border-color: #ff4d4f;
    color: #ff4d4f;
    transform: scale(1.05);
}

.remove-product-btn svg {
    width: 18px;
    height: 18px;
}

/* 💰 COLUNA DIREITA: Resumo (sticky) */
.cart-summary-column {
    position: sticky;
    top: 100px; /* Distância do topo ao rolar */
}

.cart-summary-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.cart-summary-title {
    font-size: 18px;
    font-weight: 600;
    color: #2b2b2b;
    margin: 0 0 20px 0;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

/* 🎟️ Cupom de Desconto */
.cart-coupon-section {
    margin-bottom: 20px;
}

.cart-coupon-toggle {
    cursor: pointer;
}

.cart-coupon-toggle summary {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #ff9800;
    padding: 12px;
    background: #fff8f0;
    border-radius: 8px;
    transition: all 0.2s ease;
    list-style: none;
}

.cart-coupon-toggle summary::-webkit-details-marker {
    display: none;
}

.cart-coupon-toggle summary:hover {
    background: #ffe4cc;
}

.cart-coupon-toggle summary svg {
    flex-shrink: 0;
}

.cart-coupon-toggle[open] summary {
    border-radius: 8px 8px 0 0;
}

.coupon {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: #fafafa;
    border-radius: 0 0 8px 8px;
}

.coupon input[type="text"] {
    flex: 1;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.coupon input[type="text"]:focus {
    outline: none;
    border-color: #ff9800;
    box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.1);
}

.coupon button {
    height: 40px;
    padding: 0 20px;
    background: #ff9800;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.coupon button:hover {
    background: #f57c00;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

/* Totais */
.cart-summary-totals {
    margin-bottom: 20px;
}

.cart-summary-totals .cart_totals {
    width: 100%;
}

.cart-summary-totals table {
    width: 100%;
    border-collapse: collapse;
}

.cart-summary-totals th,
.cart-summary-totals td {
    padding: 12px 0;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.cart-summary-totals th {
    font-size: 14px;
    font-weight: 500;
    color: #666;
}

.cart-summary-totals td {
    font-size: 14px;
    font-weight: 600;
    color: #2b2b2b;
    text-align: right;
}

.cart-summary-totals .order-total th {
    font-size: 16px;
    font-weight: 600;
    color: #2b2b2b;
}

.cart-summary-totals .order-total td {
    font-size: 20px;
    font-weight: 700;
    color: #ff9800;
}

/* Botão Finalizar Compra */
.cart-summary-totals .wc-proceed-to-checkout {
    margin-top: 16px;
}

.cart-summary-totals .checkout-button {
    display: block;
    width: 100%; /* ✅ VOLTA para 100% */
    padding: 16px 24px;
    background: #ff9800;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.25);
    text-align: center;
    text-decoration: none;
    box-sizing: border-box; /* 🔥 IMPORTANTE: respeita padding */
}

.cart-summary-totals .checkout-button:hover {
    background: #f57c00;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 152, 0, 0.4);
}

.cart-summary-totals .checkout-button:active {
    transform: translateY(0);
}

/* 🎨 Ícone do cadeado dentro do botão */
.cart-summary-totals .checkout-button svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-right: 8px;
    vertical-align: middle;
}

/* 🔒 Badges de Segurança */
.cart-trust-badges {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #666;
}

.trust-badge svg {
    color: #22c55e;
    flex-shrink: 0;
}

/* 📱 RESPONSIVO */
@media (max-width: 768px) {
    .cart-layout-grid {
        grid-template-columns: 1fr;
    }
    
    .cart-summary-column {
        position: static;
        order: 2;
    }
    
    .cart-product-card {
        grid-template-columns: 80px 1fr;
        gap: 16px;
    }
    
    .cart-product-controls {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid #f0f0f0;
    }
    
    .cart-product-image {
        width: 80px;
        height: 80px;
    }
}

/* ✨ ANIMAÇÕES */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 🧹 LIMPAR ESTILOS PADRÃO DO WOOCOMMERCE */
.woocommerce-cart .woocommerce-cart-form__contents {
    display: none; /* Esconder tabela padrão */
}

.woocommerce-cart .cart-collaterals h2 {
    display: none; /* Esconder título padrão */
}

/* 🔥 ESCONDER TÍTULO "Carrinho" da página */
.woocommerce-cart .page-title,
.woocommerce-cart .entry-title,
.woocommerce-cart h1.page-title,
.woocommerce-cart h1.entry-title {
    display: none !important;
}

/* Ajuste para remover espaçamento extra */
.woocommerce-cart .cart-collaterals .cart_totals {
    width: 100%;
    float: none;
}