/* ==========================================================================
   CAMIGLOBO - CSS CORE (Versión Unificada y Limpia)
   ========================================================================== */

:root {
    /* Colores Oficiales Camiglobo */
    --primary-color: #2c3e50;    /* Azul Marino Oscuro */
    --secondary-color: #1a252f;  /* Navy más oscuro para hovers */
    --accent-color: #ff6b6b;     /* Rojo Camiglobo */
    --dark-color: #333;
    --light-color: #f8f9fa;
    --gray-color: #6c757d;
    --border-color: #e0e0e0;
    --shadow: 0 4px 6px rgba(0,0,0,.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,.15);
    --transition: all .3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #f2f2f2; /* Gris sutil de fondo para resaltar tarjetas */
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- SECCIÓN HERO (Ajustada para no chocar con header.php) --- */
.hero {
    background: linear-gradient(135deg, var(--primary-color), #34495e);
    color: #fff;
    padding: 100px 0;
    text-align: center;
    position: relative;
}

.hero-content h1 { font-size: 3rem; margin-bottom: 20px; }
.hero-content p { font-size: 1.5rem; margin-bottom: 10px; }

/* --- COMPONENTES COMUNES (Botones) --- */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary { background-color: var(--accent-color); color: #fff; }
.btn-primary:hover { background-color: #ff5252; transform: translateY(-2px); }

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

/* --- GRILLA DE PRODUCTOS Y CATEGORÍAS --- */
.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 40px;
}

.category-card {
    text-decoration: none;
    color: inherit;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    background: #fff;
}

.category-card:hover { transform: translateY(-10px); box-shadow: var(--shadow-lg); }

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 40px;
}

.product-card {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    background-color: #fff;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,.15); }

/* --- MODAL DE PRODUCTO Y ZOOM (Crítico para que funcione) --- */
.product-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,.9);
    z-index: 1003;
    overflow-y: auto;
}

.product-modal-content {
    background-color: #fff;
    margin: 20px auto;
    width: 95%;
    max-width: 1200px;
    border-radius: 15px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.main-image {
    height: 500px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-in;
}

/* --- ESTUDIO DE DISEÑO / PERSONALIZADOR --- */
.customization-tab {
    padding: 12px 24px;
    background: var(--light-color);
    border: 2px solid var(--border-color);
    border-radius: 25px;
    cursor: pointer;
    transition: var(--transition);
}

.customization-tab.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.upload-area {
    border: 3px dashed var(--border-color);
    border-radius: 15px;
    padding: 40px 20px;
    text-align: center;
    background: var(--light-color);
}

.upload-area:hover { border-color: var(--accent-color); }

/* --- CARRITO --- */
.cart-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    margin-top: 40px;
}

.cart-item-price { font-weight: 600; color: var(--accent-color); }

/* --- CHAT WIDGET --- */
.chat-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,.2);
    z-index: 1000;
}

/* --- RESPONSIVE LOGIC --- */
@media(max-width:768px) {
    .category-grid { grid-template-columns: repeat(2, 1fr); }
    .products-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
    .product-details-container { grid-template-columns: 1fr; }
    .cart-container { grid-template-columns: 1fr; }
    .customization-container { grid-template-columns: 1fr; }
}

@media(max-width:480px) {
    .category-grid { grid-template-columns: 1fr; }
    .products-grid { grid-template-columns: 1fr; }
    .hero-content h1 { font-size: 2rem; }
    .cart-item { grid-template-columns: 80px 1fr; }
}

/* --- FALLBACKS DE ICONOS (No borrar) --- */
.no-fontawesome i { display: none; }
.no-fontawesome .icon-fallback { display: block; }
.product-features li::before { content: '✓'; color: var(--accent-color); font-weight: 700; margin-right: 10px; }