:root {
    --bg-color: #FAF8F5;
    --text-color: #2F4858;
    --accent-color: #E6D5C3;
    --white: #FFFFFF;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Lato', sans-serif;
}

h1, h2, h3, .logo { font-family: 'Playfair Display', serif; }

/* =========================================
   HEADER (BUSCADOR Y FILTROS)
   ========================================= */
header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 5%; background-color: var(--bg-color);
    border-bottom: 1px solid rgba(0,0,0,0.05); flex-wrap: wrap; gap: 15px;
}
.logo { font-size: 28px; font-weight: 600; text-align: center; }
.header-controls { display: flex; align-items: center; gap: 15px; flex-grow: 1; justify-content: center; }
.search-bar {
    display: flex; align-items: center; background: var(--white);
    border: 1px solid #ddd; border-radius: 20px; padding: 6px 15px;
    width: 100%; max-width: 300px; transition: border-color 0.3s;
}
.search-bar:focus-within { border-color: #b59b84; }
.search-bar input { border: none; outline: none; width: 100%; font-family: 'Lato', sans-serif; font-size: 13px; background: transparent; color: var(--text-color); }
.search-bar button { background: none; border: none; cursor: pointer; color: #999; font-size: 14px; }
.filter-menu select {
    padding: 8px 15px; border-radius: 20px; border: 1px solid #ddd;
    font-family: 'Lato', sans-serif; font-size: 13px; background-color: var(--white);
    color: var(--text-color); outline: none; cursor: pointer;
}
.icons { display: flex; align-items: center; }
.icons i { margin-left: 15px; cursor: pointer; font-size: 18px; }

/* =========================================
   SLIDER AUTODESLIZABLE
   ========================================= */
.hero-slider { position: relative; width: 100%; height: 450px; overflow: hidden; }
.slider-wrapper { position: relative; width: 100%; height: 100%; }
.slide {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0; transition: opacity 0.8s ease-in-out;
    display: flex; align-items: center; justify-content: center; text-align: center; z-index: 0;
}
.slide.active { opacity: 1; z-index: 1; }
.slide-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; opacity: 0.6; }
.hero-content { position: relative; z-index: 2; padding: 0 20px; }
.hero-content h1 { font-size: 42px; font-style: italic; margin-bottom: 10px; color: #4A6B7C; }
.hero-content p { font-size: 18px; margin-bottom: 25px; color: #4A6B7C; font-weight: 600; }
.btn-primary { background-color: var(--accent-color); border: none; padding: 12px 24px; font-size: 12px; cursor: pointer; text-transform: uppercase; letter-spacing: 1px; transition: background 0.3s; }
.btn-primary:hover { background-color: #d8c2ab; }

.slider-dots { position: absolute; bottom: 25px; left: 50%; transform: translateX(-50%); display: flex; gap: 12px; z-index: 3; }
.dot { width: 12px; height: 12px; background-color: transparent; border: 1px solid #4A6B7C; border-radius: 50%; cursor: pointer; transition: all 0.3s ease; }
.dot.active { background-color: #4A6B7C; }

/* =========================================
   GRID CATÁLOGO PEQUEÑO
   ========================================= */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); 
    gap: 15px; padding: 40px 5%; max-width: 1200px; margin: 0 auto;
}
.product-card {
    background: var(--white); padding: 10px; border-radius: 8px; text-align: center;
    cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; border: 1px solid #f0f0f0;
}
.product-card:hover { transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0,0,0,0.08); }
.product-image-container { width: 100%; height: 180px; overflow: hidden; margin-bottom: 10px; border-radius: 4px; background: #f9f9f9; }
.product-image-container img { width: 100%; height: 100%; object-fit: cover; }
.product-title { font-size: 14px; margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-price { font-size: 14px; font-weight: 600; }

/* =========================================
   MODAL (VENTANA DE DETALLES)
   ========================================= */
.modal {
    display: none; position: fixed; z-index: 1000; left: 0; top: 0;
    width: 100%; height: 100%; background-color: rgba(0,0,0,0.6); backdrop-filter: blur(3px);
}
.modal-content {
    background-color: #fff; margin: 5% auto; padding: 30px; width: 90%; max-width: 800px;
    border-radius: 12px; display: flex; gap: 30px; position: relative; box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.close-modal { position: absolute; right: 20px; top: 15px; font-size: 30px; color: #999; cursor: pointer; line-height: 1; }
.close-modal:hover { color: #333; }
.modal-gallery { flex: 1; }
#modal-main-img { width: 100%; height: 350px; object-fit: cover; border-radius: 8px; margin-bottom: 10px; background: #f4f4f4; }
.thumbnails { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 5px; }
.thumbnails img { width: 70px; height: 70px; object-fit: cover; border-radius: 4px; cursor: pointer; border: 2px solid transparent; opacity: 0.6; }
.thumbnails img:hover, .thumbnails img.active { opacity: 1; border-color: var(--accent-color); }
.modal-info { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.modal-info h2 { font-size: 28px; margin-bottom: 10px; color: var(--text-color); }
.modal-price { font-size: 22px; font-weight: 600; color: #666; margin-bottom: 20px; }
.color-selection { margin-bottom: 30px; }
.colors-container { display: flex; gap: 10px; margin-top: 10px; }
.color-swatch { width: 30px; height: 30px; border-radius: 50%; border: 1px solid #ccc; cursor: pointer; transition: transform 0.2s; }
.color-swatch:hover { border: 2px solid #333; transform: scale(1.1); }
.add-to-cart-btn { padding: 15px; font-size: 14px; width: 100%; }

/* FOOTER */
footer { text-align: center; padding: 40px 20px; font-size: 12px; background-color: #EAE3DA; }
.footer-links a { text-decoration: none; color: var(--text-color); margin: 0 10px; }
.footer-social i { margin: 15px 10px 0; font-size: 18px; cursor: pointer; }

/* =========================================
   MEDIA QUERIES (MÓVILES)
   ========================================= */
@media (max-width: 768px) {
    header { flex-direction: column; padding: 15px 20px; }
    .logo { order: 1; margin-bottom: 10px; }
    .icons { position: absolute; top: 20px; right: 20px; }
    .header-controls { order: 3; width: 100%; flex-direction: column; gap: 10px; margin-top: 10px; }
    .search-bar, .filter-menu, .filter-menu select { width: 100%; max-width: 100%; }
    
    .hero-slider { height: 350px; }
    .hero-content h1 { font-size: 32px; }
    .hero-content p { font-size: 16px; }
    
    .product-grid { grid-template-columns: repeat(2, 1fr); padding: 20px 5%; gap: 10px; }
    .product-image-container { height: 140px; }
    
    .modal-content { flex-direction: column; margin: 10% auto; height: 85vh; overflow-y: auto; padding: 20px; }
    #modal-main-img { height: 250px; }
}
/* Etiqueta de Categoría sobre la imagen */
.product-image-container { position: relative; }
.badge-categoria {
    position: absolute; top: 8px; left: 8px; background: rgba(255,255,255,0.9);
    color: #2F4858; padding: 4px 8px; font-size: 10px; font-weight: bold;
    border-radius: 4px; z-index: 1; text-transform: uppercase;
}
.product-colors-text { font-size: 11px; color: #888; margin-bottom: 5px; }

/* Etiquetas de color en el Modal */
.color-tag {
    background: #f0f0f0; border: 1px solid #ddd; padding: 6px 12px;
    border-radius: 15px; font-size: 12px; color: #333; cursor: pointer; transition: 0.2s;
}
.color-tag:hover { background: #E6D5C3; border-color: #c9b49f; }
/* =========================================
   CARRITO LATERAL (SIDEBAR)
   ========================================= */
.cart-sidebar {
    position: fixed; top: 0; right: -400px; width: 100%; max-width: 350px;
    height: 100vh; background: #fff; z-index: 2000;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1); transition: right 0.3s ease;
    display: flex; flex-direction: column;
}
.cart-sidebar.open { right: 0; }
.cart-header { display: flex; justify-content: space-between; align-items: center; padding: 20px; border-bottom: 1px solid #eee; }
.close-cart { font-size: 28px; cursor: pointer; color: #999; }
.cart-items { flex: 1; overflow-y: auto; padding: 20px; }
.cart-item { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; border-bottom: 1px solid #f9f9f9; padding-bottom: 10px; }
.item-info h4 { font-size: 14px; margin-bottom: 5px; color: #333; }
.item-price { font-size: 13px; color: #666; font-weight: bold; }
.remove-item { color: #ff4d4d; cursor: pointer; font-size: 16px; }
.cart-footer { padding: 20px; border-top: 1px solid #eee; background: #fafafa; }
.cart-total { font-size: 20px; font-weight: bold; margin-bottom: 15px; text-align: right; color: var(--text-color); }
.btn-whatsapp {
    width: 100%; padding: 15px; background-color: #25D366; color: white;
    border: none; border-radius: 5px; font-size: 16px; cursor: pointer;
    display: flex; justify-content: center; align-items: center; gap: 10px; font-weight: bold;
}
.btn-whatsapp:hover { background-color: #128C7E; }
.cart-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 1999; display: none;
}
.cart-overlay.show { display: block; }
/* Color seleccionado en el Modal */
.color-tag.selected {
    background-color: #2F4858;
    color: #ffffff;
    border-color: #2F4858;
    font-weight: bold;
}