/**
 * APPLE-SAAS DESIGN SYSTEM
 * Estilos globales para tienda.php y catálogo de productos
 * Versión: 1.0 - Abril 2026
 */

/* ===============================================
   VARIABLES GLOBALES
   =============================================== */
:root {
    /* Colores principales */
    --color-background: #F5F5F7;
    --color-surface: #FFFFFF;
    --color-primary: #007AFF;
    --color-text-primary: #1A1A1A;
    --color-text-secondary: #666666;
    --color-border: #E5E5E5;
    
    /* Sombras */
    --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.04);
    --shadow-medium: 0 12px 32px rgba(0, 0, 0, 0.08);
    --shadow-strong: 0 16px 48px rgba(0, 0, 0, 0.12);
    
    /* Bordes redondeados */
    --radius-card: 22px;
    --radius-button: 16px;
    --radius-input: 12px;
    --radius-badge: 8px;
    
    /* Espaciado */
    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-xxl: 48px;
    
    /* Tipografía */
    --font-family: -apple-system, BlinkMacSystemFont, "Inter", "SF Pro Display", "Segoe UI", sans-serif;
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
}

/* ===============================================
   RESET Y BASE
   =============================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--color-background);
    color: var(--color-text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===============================================
   NAVBAR STICKY CON BLUR
   =============================================== */
.navbar-tienda {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
    padding: var(--spacing-md) 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
}

/* ===============================================
   CARDS DE PRODUCTO
   =============================================== */
.product-card {
    background: var(--color-surface);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-medium);
}

.product-card-image {
    position: relative;
    width: 100%;
    padding: var(--spacing-sm); /* Padding interno para marco */
    background: #FAFAFA;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Contener imagen sin recortar */
}

.product-card-body {
    padding: var(--spacing-md);
}

.product-card-title {
    font-size: 16px;
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-xs);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-category {
    font-size: 12px;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--spacing-xs);
}

.product-card-price {
    font-size: 20px;
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
    margin-bottom: var(--spacing-sm);
}

.product-card-price-old {
    font-size: 14px;
    color: var(--color-text-secondary);
    text-decoration: line-through;
    margin-left: var(--spacing-xs);
}

/* ===============================================
   GRILLA DE PRODUCTOS - RESPONSIVE
   =============================================== */
.products-grid {
    display: grid;
    gap: var(--spacing-lg);
    padding: var(--spacing-lg);
}

/* Mobile: 2 columnas compactas */
@media (max-width: 767px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
        padding: var(--spacing-sm);
    }
    
    .product-card-title {
        font-size: 14px;
    }
    
    .product-card-price {
        font-size: 16px;
    }
}

/* Tablet: 3 columnas */
@media (min-width: 768px) and (max-width: 1023px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Desktop: 4 columnas */
@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ===============================================
   SECCIÓN TRENDING NOW
   =============================================== */
.trending-section {
    padding: var(--spacing-xl) var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.trending-title {
    font-size: 28px;
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--spacing-lg);
    color: var(--color-text-primary);
}

.trending-grid {
    display: grid;
    gap: var(--spacing-lg);
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

@media (max-width: 767px) {
    .trending-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: var(--spacing-md);
        padding-bottom: var(--spacing-md);
    }
    
    .trending-grid .product-card {
        min-width: 220px;
        scroll-snap-align: start;
    }
}

.trending-badge {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    background: linear-gradient(135deg, #FF6B6B, #FF8E53);
    color: white;
    padding: 4px 12px;
    border-radius: var(--radius-badge);
    font-size: 11px;
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
}

/* ===============================================
   BOTONES
   =============================================== */
.btn-apple {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: var(--radius-button);
    font-size: 15px;
    font-weight: var(--font-weight-semibold);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background: #0051D5;
    transform: scale(1.02);
}

.btn-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-circle:hover {
    transform: scale(1.1);
}

/* ===============================================
   FOOTER INSTITUCIONAL
   =============================================== */
.footer-tienda {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: var(--spacing-xxl) var(--spacing-lg);
    margin-top: var(--spacing-xxl);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-xl);
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 767px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
}

.footer-column h5 {
    font-size: 14px;
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-md);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-column ul {
    list-style: none;
}

.footer-column ul li {
    margin-bottom: var(--spacing-xs);
}

.footer-column a {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

.footer-column a:hover {
    color: var(--color-primary);
}

.footer-social {
    display: flex;
    gap: var(--spacing-sm);
}

.footer-social a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-background);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.footer-social a:hover {
    background: var(--color-primary);
    color: white;
}

/* ===============================================
   CARRITO FLOTANTE (MOBILE)
   =============================================== */
.cart-floating {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-surface);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.08);
    padding: var(--spacing-md);
    padding-bottom: calc(var(--spacing-md) + env(safe-area-inset-bottom));
    z-index: 999;
    border-top-left-radius: var(--radius-card);
    border-top-right-radius: var(--radius-card);
}

/* ===============================================
   UTILIDADES
   =============================================== */
.container-fluid-apple {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.text-center {
    text-align: center;
}

.mb-lg {
    margin-bottom: var(--spacing-lg);
}

.mt-xl {
    margin-top: var(--spacing-xl);
}
