/**
 * WhatsApp Cart Page Styles
 */

/* Container Principal */
.wc-whatsapp-cart-page {
    padding: 40px 20px;
    background: #f5f5f5;
    min-height: 100vh;
}

.wc-whatsapp-cart-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header do Carrinho */
.wc-whatsapp-cart-header {
    text-align: center;
    margin-bottom: 30px;
}

.cart-title {
    font-size: 36px;
    font-weight: 700;
    color: #000;
    margin: 0;
}

.cart-icon {
    font-size: 36px;
}

.cart-subtitle {
    color: #666;
    font-size: 16px;
    margin: 0;
}

/* Carrinho Vazio */
.wc-whatsapp-empty-cart {
    background: white;
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.empty-cart-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.wc-whatsapp-empty-cart h2 {
    font-size: 24px;
    color: #333;
    margin: 0 0 10px 0;
}

.wc-whatsapp-empty-cart p {
    color: #666;
    font-size: 16px;
    margin: 0 0 30px 0;
}

/* Layout do Conteúdo */
.wc-whatsapp-cart-content {
    display: grid !important;
    grid-template-columns: 1fr 400px !important;
    gap: 30px !important;
}

/* Seção de Itens */
.cart-items-section {
    background: transparent;
}

/* Cabeçalho da Tabela */
.cart-table-header {
    display: grid !important;
    grid-template-columns: 80px 1fr 120px 150px 120px 40px !important;
    gap: 20px !important;
    padding: 15px 20px;
    background: white;
    border-radius: 8px 8px 0 0;
    margin-bottom: 2px;
}

.cart-table-header .header-col {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #333 !important;
    text-align: left !important;
}

.cart-table-header .header-col:nth-child(3),
.cart-table-header .header-col:nth-child(4),
.cart-table-header .header-col:nth-child(5) {
    text-align: center !important;
}

.cart-items-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Item do Carrinho */
.cart-item {
    background: white;
    border-radius: 8px;
    padding: 20px;
    display: grid !important;
    grid-template-columns: 80px 1fr 120px 150px 120px 40px !important;
    gap: 20px !important;
    align-items: center !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s;
    margin-bottom: 10px;
}

.cart-item:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Imagem do Produto */
.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
    background: #f8f8f8;
}

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

/* Detalhes do Produto */
.cart-item-details {
    flex: 1;
}

.cart-item-name {
    font-size: 16px;
    font-weight: 400;
    color: #0073aa;
    margin: 0;
    line-height: 1.4;
}

.cart-item-name a {
    color: #0073aa;
    text-decoration: none;
    transition: color 0.2s;
}

.cart-item-name a:hover {
    color: #005177;
}

.cart-item-variation {
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
}

.cart-item-price {
    text-align: center;
}

.price-label {
    display: none;
}

.price-value {
    font-size: 15px;
    font-weight: 400;
    color: #333;
}

/* Controles de Quantidade */
.cart-item-quantity {
    text-align: center !important;
}

.cart-item-quantity label {
    display: none !important;
}

.quantity-controls {
    display: inline-flex !important;
    align-items: center !important;
    border: 1px solid #ddd !important;
    border-radius: 3px !important;
    overflow: hidden !important;
}

.qty-btn {
    width: 35px;
    height: 35px;
    border: none;
    background: #f8f8f8;
    color: #333;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.qty-btn:hover {
    background: #25D366;
    color: white;
}

.qty-btn:active {
    transform: scale(0.95);
}

.qty-input {
    width: 50px;
    height: 35px;
    border: none;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Subtotal */
.cart-item-subtotal {
    text-align: center;
    min-width: 120px;
}

.subtotal-label {
    display: none;
}

.subtotal-value {
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

/* Botão Remover */
.cart-item-remove {
    text-align: center;
}

.remove-item {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.2s;
    color: #999;
}

.remove-item:hover {
    color: #ff4444;
    transform: scale(1.2);
}

/* Ações do Carrinho */
.cart-actions-bottom {
    margin-top: 20px;
}

/* Resumo do Pedido */
.cart-summary-section {
    position: sticky;
    top: 20px;
    height: fit-content;
}

.cart-summary {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.summary-title {
    font-size: 22px;
    font-weight: 700;
    color: #333;
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.summary-items {
    margin-bottom: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
}

.summary-label {
    font-size: 15px;
    color: #666;
}

.summary-value {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.summary-row.discount .summary-value {
    color: #ff4444;
}

.summary-row.total {
    border-bottom: none;
    border-top: 2px solid #f0f0f0;
    padding-top: 15px;
    margin-top: 10px;
}

.summary-row.total .summary-label {
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.summary-row.total .summary-value {
    font-size: 24px;
    font-weight: 700;
    color: #25D366;
}

/* Cupom */
.coupon-section {
    margin: 20px 0;
}

.coupon-toggle {
    cursor: pointer;
}

.coupon-toggle summary {
    font-size: 14px;
    color: #25D366;
    font-weight: 600;
    padding: 10px;
    background: #f0fdf4;
    border-radius: 8px;
    list-style: none;
    user-select: none;
    transition: background 0.2s;
}

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

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

.coupon-form {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.coupon-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.coupon-input:focus {
    outline: none;
    border-color: #25D366;
}

/* Botões */
.button {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.button-primary {
    background: #25D366;
    color: white;
}

.button-primary:hover {
    background: #1fba57;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.button-secondary {
    background: #f5f5f5;
    color: #333;
    border: 2px solid #e0e0e0;
}

.button-secondary:hover {
    background: #e0e0e0;
}

.button-coupon {
    background: #25D366;
    color: white;
    padding: 12px 24px;
    white-space: nowrap;
}

.button-coupon:hover {
    background: #1fba57;
}

/* Botão WhatsApp */
.whatsapp-checkout-section {
    margin: 20px 0;
}

.button-whatsapp {
    width: 100% !important;
    background: #25D366 !important;
    color: white !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    padding: 14px 20px !important;
    border-radius: 4px !important;
    box-shadow: none !important;
    border: none !important;
    cursor: pointer !important;
    transition: background 0.2s !important;
}

.button-whatsapp:hover {
    background: #20ba5a !important;
}

.whatsapp-icon {
    display: flex;
    align-items: center;
}

/* Shipping Notice */
.shipping-notice {
    font-size: 13px;
    color: #666;
    margin: 0 0 5px 0;
}

.shipping-calc-link {
    color: #00a0d2;
    text-decoration: none;
    font-size: 13px;
}

.shipping-calc-link:hover {
    text-decoration: underline;
}

/* Formas de Pagamento */
.payment-methods {
    margin: 25px 0;
    padding: 20px;
    background: #f8f8f8;
    border-radius: 8px;
    text-align: center;
}

.payment-title {
    font-size: 13px;
    color: #666;
    margin: 0 0 12px 0;
}

.payment-icons {
    display: flex;
    justify-content: center;
    gap: 15px;
    font-size: 28px;
}

/* Badges de Segurança */
.security-badges {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.badge {
    font-size: 12px;
    color: #666;
    background: #f0f0f0;
    padding: 8px 15px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Loading State */
.cart-item.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Mensagens de Feedback */
.wc-whatsapp-message {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.wc-whatsapp-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.wc-whatsapp-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.wc-whatsapp-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .wc-whatsapp-cart-content {
        grid-template-columns: 1fr;
    }

    .cart-summary-section {
        position: static;
    }
}

@media (max-width: 768px) {
    .wc-whatsapp-cart-page {
        padding: 20px 10px;
    }

    .cart-title {
        font-size: 24px;
    }

    .cart-item {
        grid-template-columns: 80px 1fr;
        gap: 15px;
        padding: 15px;
    }

    .cart-item-image {
        width: 80px;
        height: 80px;
    }

    .cart-item-quantity,
    .cart-item-subtotal {
        grid-column: 1 / -1;
        text-align: left;
    }

    .cart-item-remove {
        position: absolute;
        top: 15px;
        right: 15px;
    }

    .quantity-controls {
        justify-content: flex-start;
    }

    .cart-summary {
        padding: 20px;
    }

    .summary-title {
        font-size: 20px;
    }

    .button-whatsapp {
        font-size: 16px;
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .cart-title {
        font-size: 20px;
        flex-direction: column;
        gap: 5px;
    }

    .cart-item-name {
        font-size: 16px;
    }

    .price-value {
        font-size: 14px;
    }

    .subtotal-value {
        font-size: 18px;
    }

    .summary-row.total .summary-value {
        font-size: 20px;
    }

    .coupon-form {
        flex-direction: column;
    }

    .button-coupon {
        width: 100%;
    }

    .security-badges {
        flex-direction: column;
        gap: 8px;
    }
}

/* Animações */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cart-item {
    animation: slideIn 0.3s ease-out;
}

.cart-item:nth-child(1) { animation-delay: 0s; }
.cart-item:nth-child(2) { animation-delay: 0.1s; }
.cart-item:nth-child(3) { animation-delay: 0.2s; }
.cart-item:nth-child(4) { animation-delay: 0.3s; }
.cart-item:nth-child(5) { animation-delay: 0.4s; }

/* Validation Styles */
.field-error {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1) !important;
    animation: shake 0.5s;
}

.field-error:focus {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.2) !important;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* WhatsApp Button Disabled State */
.button-whatsapp.button-disabled {
    background: #cccccc !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
}

.button-whatsapp.button-disabled:hover {
    background: #cccccc !important;
    transform: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}
