/* ===== CHECKOUT PAGE STYLES ===== */

/* Variables */
:root {
    --primary-color: #00C896;
    --primary-dark: #00A67D;
    --secondary-color: #f8f9fa;
    --accent-color: #ff6b35;
    --text-dark: #2c3e50;
    --text-light: #6c757d;
    --white: #ffffff;
    --gray-light: #f5f5f5;
    --gray-medium: #e9ecef;
    --shadow: 0 2px 15px rgba(0,0,0,0.1);
    --shadow-hover: 0 5px 25px rgba(0,0,0,0.15);
    --border-radius: 10px;
    --transition: all 0.3s ease;
}

/* Layout principal */
.checkout-page {
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
    min-height: 100vh;
    padding: 120px 0 60px;
}

.checkout-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.checkout-header {
    text-align: center;
    margin-bottom: 60px;
}

.checkout-title {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 20px;
    line-height: 1.2;
}

.highlight-text {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
}

.highlight-text::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 2px;
}

.checkout-subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Contenido principal */
.checkout-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

/* Sección de productos */
.products-section {
    background: var(--white);
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 200, 150, 0.1);
    position: relative;
    overflow: hidden;
}

.products-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), #4dc5be);
}

.section-title {
    font-size: 1.8rem;
    color: var(--text-dark);
    margin-bottom: 30px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Mensaje de carrito vacío */
.empty-cart-message {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-cart-message i {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 20px;
}

.empty-cart-message h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.back-to-shop {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    padding: 12px 24px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    margin-top: 20px;
    transition: var(--transition);
}

.back-to-shop:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 200, 150, 0.3);
}

/* ===== DISEÑO SIN TABLA - CARDS RESPONSIVE ===== */

.products-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.product-card {
    background: var(--white);
    border: 2px solid #f0f4f8;
    border-radius: 20px;
    padding: 25px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), #4dc5be);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.product-card:hover::before {
    transform: scaleX(1);
}

.product-card:hover {
    border-color: rgba(0, 200, 150, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 200, 150, 0.15);
}

.product-card.removing {
    opacity: 0;
    transform: scale(0.9) translateX(-20px);
    transition: all 0.4s ease;
}

/* Layout del producto - Desktop */
.product-layout {
    display: grid;
    grid-template-columns: auto 1fr auto auto auto;
    gap: 25px;
    align-items: center;
}

.product-image-container {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    border: 3px solid var(--white);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.product-card:hover .product-image-container {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(0, 200, 150, 0.2);
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 13px;
}

.product-emoji {
    font-size: 2.5rem;
}

.product-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.product-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.product-card:hover .product-name {
    color: var(--primary-color);
}

.product-meta {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
    margin: 0;
}

.product-price {
    font-size: 1rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 5px 0 0 0;
}

/* Controles de cantidad - Desktop */
.quantity-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.quantity-label {
    font-size: 0.8rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8fbff;
    padding: 8px 12px;
    border-radius: 12px;
    border: 2px solid #e3f2fd;
}

.quantity-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    font-weight: bold;
    box-shadow: 0 3px 10px rgba(0, 200, 150, 0.3);
}

.quantity-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 200, 150, 0.4);
}

.quantity-btn:active {
    transform: translateY(0);
}

.quantity-display {
    min-width: 40px;
    text-align: center;
    font-weight: 700;
    color: var(--text-dark);
    font-size: 1.1rem;
    padding: 8px 12px;
    background: var(--white);
    border-radius: 8px;
    border: 2px solid #e8f4f8;
}

/* Total - Desktop */
.total-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.total-label {
    font-size: 0.8rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.item-total {
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    padding: 8px 15px;
    background-color: #f0fff4;
    border-radius: 10px;
    border: 2px solid rgba(0, 200, 150, 0.2);
}

/* Botón eliminar - Desktop */
.remove-section {
    display: flex;
    align-items: center;
}

.remove-btn {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #fff5f5, #ffe6e6);
    border: 2px solid #fecaca;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.1rem;
    color: #dc2626;
    position: relative;
    overflow: hidden;
}

.remove-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.remove-btn:hover::before {
    opacity: 1;
}

.remove-btn:hover {
    color: var(--white);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.3);
}

.remove-btn i {
    position: relative;
    z-index: 2;
}

/* Sidebar */
.checkout-sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.order-summary {
    background: var(--white);
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 200, 150, 0.1);
    position: relative;
    overflow: hidden;
    position: sticky;
    top: 140px;
}

.order-summary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), #4dc5be);
}

.summary-title {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 30px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #f0f4f8;
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-row.total-row {
    border-top: 2px solid #e2e8f0;
    margin-top: 15px;
    padding-top: 20px;
    font-size: 1.2rem;
}

.summary-label {
    color: var(--text-light);
    font-weight: 500;
}

.summary-value {
    font-weight: 600;
    color: var(--text-dark);
}

.summary-value.shipping-free {
    color: var(--primary-color);
    font-weight: 700;
}

.summary-value.total-value {
    color: var(--primary-color);
    font-size: 1.3rem;
    font-weight: 800;
}

.shipping-info {
    background: #f8fbff;
    padding: 20px;
    border-radius: 15px;
    margin: 25px 0;
    border: 2px solid #e3f2fd;
}

.shipping-info h4 {
    margin: 0 0 10px 0;
    color: var(--text-dark);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.shipping-info p {
    margin: 0;
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Botones de acción */
.checkout-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.checkout-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border: none;
    padding: 18px 30px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 8px 20px rgba(0, 200, 150, 0.2);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.checkout-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.checkout-btn:hover::before {
    left: 100%;
}

.checkout-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0, 200, 150, 0.3);
}

.continue-shopping-btn {
    background: transparent;
    color: var(--text-light);
    border: 2px solid #e2e8f0;
    padding: 15px 30px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.continue-shopping-btn:hover {
    background: #f8f9fa;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Botones móviles */
.mobile-actions {
    display: none;
    flex-direction: column;
    gap: 15px;
    margin-top: 40px;
    padding: 30px;
    background: var(--white);
    border-radius: 20px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 200, 150, 0.1);
}

.mobile-actions .checkout-btn,
.mobile-actions .continue-shopping-btn {
    width: 100%;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablet */
@media (max-width: 1024px) {
    .checkout-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .order-summary {
        position: static;
    }
    
    .checkout-title {
        font-size: 2.5rem;
    }
    
    .products-section {
        padding: 30px 25px;
    }
    
    /* Layout cambia en tablet */
    .product-layout {
        grid-template-columns: auto 1fr;
        gap: 20px;
    }
    
    .quantity-section,
    .total-section,
    .remove-section {
        display: none;
    }
    
    /* Mostrar controles móviles */
    .mobile-controls {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
        margin-top: 15px;
    }
    
    .mobile-control-group {
        background: #f8fbff;
        padding: 15px;
        border-radius: 12px;
        border: 2px solid #e3f2fd;
        text-align: center;
    }
    
    .mobile-control-label {
        font-size: 0.8rem;
        color: var(--text-light);
        text-transform: uppercase;
        letter-spacing: 0.5px;
        font-weight: 600;
        margin-bottom: 8px;
        display: block;
    }
    
    .mobile-quantity-controls {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
    }
    
    .mobile-quantity-btn {
        width: 32px;
        height: 32px;
        border: none;
        background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
        color: var(--white);
        border-radius: 8px;
        cursor: pointer;
        transition: var(--transition);
        font-size: 0.8rem;
        box-shadow: 0 2px 8px rgba(0, 200, 150, 0.3);
    }
    
    .mobile-quantity-btn:hover {
        transform: scale(1.1);
    }
    
    .mobile-quantity-display {
        min-width: 35px;
        text-align: center;
        font-weight: 700;
        color: var(--text-dark);
        font-size: 1rem;
        padding: 5px 10px;
        background: var(--white);
        border-radius: 6px;
        border: 2px solid #e8f4f8;
    }
    
    .mobile-total-value {
        font-size: 1.2rem;
        font-weight: 800;
        background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
        background-clip: text;
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }
    
    /* Botón eliminar móvil */
    .mobile-remove-btn {
        position: absolute;
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        background: linear-gradient(135deg, #ff6b6b, #ee5a52);
        border: none;
        border-radius: 10px;
        color: var(--white);
        cursor: pointer;
        font-size: 1rem;
        box-shadow: 0 3px 10px rgba(255, 107, 107, 0.3);
        transition: var(--transition);
    }
    
    .mobile-remove-btn:hover {
        transform: scale(1.1);
    }
}

/* Móvil */
@media (max-width: 768px) {
    .checkout-page {
        padding: 100px 0 40px;
    }
    
    .checkout-container {
        padding: 0 15px;
    }
    
    .checkout-title {
        font-size: 2rem;
    }
    
    .checkout-subtitle {
        font-size: 1rem;
        padding: 0 15px;
    }
    
    .checkout-header {
        margin-bottom: 40px;
    }
    
    .products-section {
        padding: 25px 20px;
        border-radius: 15px;
    }
    
    /* Ocultar sidebar desktop */
    .checkout-sidebar {
        display: none;
    }
    
    /* Mostrar botones móviles */
    .mobile-actions {
        display: flex;
    }
    
    /* Layout móvil */
    .product-layout {
        display: block;
        position: relative;
        padding-right: 50px;
    }
    
    .product-header {
        display: flex;
        align-items: center;
        gap: 15px;
        margin-bottom: 15px;
    }
    
    .product-image-container {
        width: 70px;
        height: 70px;
    }
    
    .product-emoji {
        font-size: 2rem;
    }
    
    .product-name {
        font-size: 1.1rem;
    }
    
    .product-meta,
    .product-price {
        font-size: 0.85rem;
    }
    
    .mobile-controls {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .mobile-control-group {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 15px;
    }
    
    .mobile-control-label {
        margin-bottom: 0;
        font-size: 0.85rem;
    }
}

/* Móvil pequeño */
@media (max-width: 480px) {
    .checkout-title {
        font-size: 1.8rem;
    }
    
    .section-title {
        font-size: 1.4rem;
    }
    
    .products-section,
    .mobile-actions {
        padding: 20px 15px;
        border-radius: 12px;
    }
    
    .product-card {
        padding: 20px 15px;
        border-radius: 15px;
    }
    
    .product-image-container {
        width: 60px;
        height: 60px;
    }
    
    .product-emoji {
        font-size: 1.8rem;
    }
    
    .product-name {
        font-size: 1rem;
    }
    
    .product-meta,
    .product-price {
        font-size: 0.8rem;
    }
    
    .mobile-quantity-btn {
        width: 28px;
        height: 28px;
        font-size: 0.7rem;
    }
    
    .mobile-quantity-display {
        font-size: 0.9rem;
        padding: 4px 8px;
    }
    
    .mobile-total-value {
        font-size: 1.1rem;
    }
    
    .mobile-remove-btn {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
        top: 12px;
        right: 12px;
    }
    
    .checkout-btn,
    .continue-shopping-btn {
        padding: 15px 20px;
        font-size: 1rem;
    }
}

/* ===== ELEMENTOS OCULTOS EN RESPONSIVE ===== */

/* Desktop: mostrar layout normal */
@media (min-width: 1025px) {
    .mobile-controls,
    .mobile-remove-btn,
    .product-header {
        display: none !important;
    }
}

/* Tablet y móvil: ocultar controles desktop */
@media (max-width: 1024px) {
    .quantity-section,
    .total-section,
    .remove-section {
        display: none !important;
    }
    
    .mobile-controls {
        display: grid !important;
    }
    
    .mobile-remove-btn {
        display: block !important;
    }
}

/* Móvil: reorganizar layout */
@media (max-width: 768px) {
    .product-header {
        display: flex !important;
    }
}

/* ===== ANIMACIONES ===== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card,
.order-summary,
.mobile-actions {
    animation: fadeInUp 0.6s ease forwards;
}

.product-card {
    animation-delay: 0.1s;
}

.order-summary {
    animation-delay: 0.3s;
}

.mobile-actions {
    animation-delay: 0.5s;
}

/* Estados de actualización */
.updating {
    opacity: 0.7;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.value-updating {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1s infinite;
    color: transparent !important;
    -webkit-text-fill-color: transparent !important;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Efectos de hover adicionales */
.product-card:hover .product-image-container {
    transform: scale(1.05) rotate(2deg);
}

.quantity-btn:active {
    transform: scale(0.9);
}

.mobile-quantity-btn:active {
    transform: scale(0.9);
}