/* Estilos generales */
:root {
    --bg-color: #F5F5F7;
    --text-color: #1D1D1F;
    --border-color: #0276DF;
    --menu-text: #FFFFFF;
    --card-bg: #FFFFFF;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: saturate(180%) blur(20px);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 60px;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--menu-text);
    text-decoration: none;
}

.logo span {
    color: var(--border-color);
}

.nav-menu {
    display: flex;
    list-style: none;
}

.nav-item {
    margin-left: 30px;
}

.nav-link {
    color: var(--menu-text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 400;
    padding: 5px 0;
    position: relative;
    transition: color 0.3s;
}

.nav-link:hover, .nav-link.active {
    color: #ccc;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--border-color);
}

.hamburger {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: var(--menu-text);
    transition: all 0.3s ease;
}

/* Hero Section */
.hero {
    padding: 80px 0;
    text-align: center;
    background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 100%);
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: -0.5px;
}

.hero p {
    font-size: 1.5rem;
    font-weight: 400;
    color: #86868b;
    max-width: 600px;
    margin: 0 auto;
}

/* Categories */
.categories {
    padding: 80px 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 50px;
    letter-spacing: -0.5px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.category-card {
    background-color: var(--card-bg);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.category-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.category-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.category-image {
    height: 250px;
    overflow: hidden;
    background-color: #f5f5f7;
    position: relative;
}

.category-image .demo-image {
    width: 100%;
    height: 100%;
}

.category-info {
    padding: 25px;
}

.category-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-transform: capitalize;
}

.category-info p {
    color: #86868b;
    margin-bottom: 20px;
    font-size: 1rem;
}

.category-cta {
    color: var(--border-color);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
}

.category-cta i {
    margin-left: 5px;
    font-size: 0.8rem;
    transition: transform 0.3s;
}

.category-card:hover .category-cta i {
    transform: translateX(5px);
}

/* Product List Styles */
.product-section {
    padding: 60px 0;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
}

.product-card {
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 25px;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-color);
}

.product-price {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--border-color);
    margin-bottom: 15px;
}

.product-details {
    margin-bottom: 15px;
}

.product-colors {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.color-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-block;
    border: 1px solid #ddd;
}

.battery-info {
    display: flex;
    align-items: center;
    margin-top: 10px;
    font-size: 0.9rem;
}

.battery-icon {
    margin-right: 8px;
    color: #34c759;
    font-size: 2.1rem;
}

.back-button {
    display: inline-block;
    margin-top: 30px;
    padding: 12px 25px;
    background-color: var(--border-color);
    color: var(--menu-text);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: background-color 0.3s;
}

.back-button:hover {
    background-color: #0268c7;
}

/* Color mapping for iPhone colors */
.color-black { background-color: #000000; }
.color-natural { background-color: #F5F5F7; border: 2px solid #ddd; }
.color-dorado { background-color: #FFD700; }
.color-desert { background-color: #EDC9AF; }
.color-azul { background-color: #007AFF; }
.color-morado { background-color: #800080; }
.color-blanco { background-color: #FFFFFF; border: 2px solid #ddd; }
.color-verde { background-color: #00FF00; }
.color-rojo { background-color: #FF0000; }
.color-negro { background-color: #1D1D1F; }
.color-naranja { background-color: #FF9500; }
.color-ambar { background-color: #FFCC00; }

/* Footer */
.footer {
    background-color: #1D1D1F;
    color: #F5F5F7;
    padding: 50px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h3, .footer-section h4 {
    margin-bottom: 20px;
    color: #FFFFFF;
}

.footer-section h3 {
    font-size: 1.8rem;
}

.footer-section h4 {
    font-size: 1.2rem;
}

.footer-section p {
    color: #86868b;
    margin-bottom: 15px;
}

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

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: #86868b;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section ul li a:hover {
    color: #FFFFFF;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #333;
    color: #86868b;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 60px;
        flex-direction: column;
        background-color: rgba(0, 0, 0, 0.95);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        padding: 20px 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-item {
        margin: 15px 0;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1.2rem;
    }

    .section-title {
        font-size: 2rem;
    }
}
/* ======================
   RESPONSIVIDAD DE IMÁGENES
   ====================== */

/* Estilos base para imágenes responsivas */
.responsive-img {
    width: 600px;
    height: 400px;
    object-fit: cover;
    display: block;
    border-radius: 8px 8px 0 0;
}

/* Contenedor de imagen mantiene proporción */
.category-image {
    width: 100%;
    height: auto;
    aspect-ratio: 3/2; /* Relación 600:400 = 3:2 */
    overflow: hidden;
    background-color: #f5f5f7;
}

/* Ajusta la imagen al contenedor */
.category-image .responsive-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

/* Efecto hover en imágenes */
.category-card:hover .category-image .responsive-img {
    transform: scale(1.05);
}

/* ======================
   AJUSTES RESPONSIVOS PARA EL GRID
   ====================== */

/* Pantallas grandes (1200px+) - 3 columnas */
@media (min-width: 1200px) {
    .category-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .category-image {
        aspect-ratio: 3/2;
    }
}

/* Tablets (768px - 1199px) - 2 columnas */
@media (min-width: 768px) and (max-width: 1199px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .category-image {
        aspect-ratio: 3/2;
    }
}

/* Móviles (hasta 767px) - 1 columna */
@media (max-width: 767px) {
    .category-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .category-image {
        aspect-ratio: 3/2; /* Mantiene proporción en móviles */
    }
    
    /* Ajustes adicionales para móviles pequeños */
    @media (max-width: 480px) {
        .category-image {
            aspect-ratio: 4/3; /* Ligeramente más cuadrada en móviles muy pequeños */
        }
    }
}

/* Asegurar que las tarjetas mantengan consistencia */
.category-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.category-image {
    flex-shrink: 0;
}

.category-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* ======================
   AJUSTES PARA PANTALLAS MUY ANCHAS
   ====================== */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    .category-image {
        aspect-ratio: 3/2;
    }
}

/* ======================
   CORRECCIÓN PARA FIREFOX (soporte aspect-ratio)
   ====================== */
@supports not (aspect-ratio: 3/2) {
    .category-image {
        height: 400px;
        position: relative;
    }
    
    .category-image .responsive-img {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }
    
    @media (max-width: 1199px) {
        .category-image {
            height: 350px;
        }
    }
    
    @media (max-width: 767px) {
        .category-image {
            height: 300px;
        }
    }
    
    @media (max-width: 480px) {
        .category-image {
            height: 250px;
        }
    }
}
/* Estilos para enlaces de contacto */
.whatsapp-link, .email-link {
    color: #86868b;
    text-decoration: none;
    transition: color 0.3s;
}

.whatsapp-link:hover, .email-link:hover {
    color: #FFFFFF;
}

.whatsapp-link:hover {
    color: #25D366; /* Color verde de WhatsApp */
}

.email-link:hover {
    color: #FFFFFF; /* Color azul de tu paleta */
}

/* Estilos para la versión con iconos */
.contact-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.contact-icon {
    color: #86868b;
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
}

.contact-item .fa-whatsapp {
    color: #25D366; /* Color verde de WhatsApp */
}

.contact-item .fa-envelope {
    color: #FFFFFF; /* Color azul de tu paleta */
}
/* Botón flotante de WhatsApp */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #25D366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    text-decoration: none;
    transition: all 0.3s;
}

.whatsapp-float:hover {
    background-color: #128C7E;
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}
/* Agrega esto en el estilo CSS que ya tienes */
.product-card[data-disponible="false"] {
    display: none;
}
/* Etiqueta de vendido diagonal */
.sold-label {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 10;
    pointer-events: none;
}

.sold-label::before {
    content: 'AGOTADO *';
    position: absolute;
    bottom: 0;
    left: 0;
    transform: translate(-25%, 25%) rotate(-45deg);
    transform-origin: left;
    
    background: linear-gradient(45deg, #ff0000, #cc0000);
    color: white;
    font-weight: bold;
    font-size: 24px;
    padding: 10px 60px;
    text-align: center;
    letter-spacing: 2px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    z-index: 11;
    border: 2px solid white;
    
    /* Efecto de texto con sombra para mejor legibilidad */
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    
    /* Asegurar que cubra bien la diagonal */
    width: 250%;
}

/* Opcional: Oscurecer ligeramente la tarjeta cuando está vendida */
.product-card[data-disponible="false"] .product-carousel img {
    filter: brightness(0.9);
}

.product-card[data-disponible="false"] .product-info {
    position: relative;
}

/* Asegurar que la etiqueta esté por encima del contenido */
.product-card {
    position: relative;
    overflow: hidden;
}
