/* 
   TiendaJoss - Modern Redesign 
   Inspirado en estilo minimalista y Pura Vida Bracelets
*/

:root {
    /* Paleta de Colores - Elegancia Rosada (Rose Gold Chic) */
    --primary-color: #891997;
    /* Dusty Pink */
    --primary-gradient: linear-gradient(135deg, #d4a5a5 0%, #cbaacb 100%);
    /* Pink to Rose Gold/Lavender */
    --secondary-color: #cbaacb;
    /* Soft Mauve/Rose Gold accent */
    --accent-color: #fce4ec;
    /* Very light pink for backgrounds/highlights */

    /* Colores Funcionales */
    --text-main: #2d3436;
    /* Charcoal Gray (Softer than black) */
    --text-light: #636e72;
    --bg-body: #efefefd9;
    /* Soft Cream */
    --bg-card: #dbcee1f4;
    --border-color: #eee0e5;
    /* Pinkish grey border */
    --success-color: #27ae60;
    --error-color: #e74c3c;

    /* Espaciado y Dimensiones */
    --border-radius: 12px;
    /* Slightly softer radius */
    --card-shadow: 0 10px 30px rgba(212, 165, 165, 0.15);
    /* Pinkish shadow */
    --card-shadow-hover: 0 20px 40px rgba(212, 165, 165, 0.25);
    --transition-speed: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);

    /* Tipografía */
    --font-heading: 'Marcellus', serif;
    --font-body: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* === RESET & BASE STYLES === */
* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    margin: 0;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h2,
h3,
h4 {
    font-family: var(--font-heading);
    margin: 0;
    font-weight: 400;
}

/* === ANNOUNCEMENT BAR === */
.announcement-bar {
    background-color: #ffffff;
    /* Black or Dark Purple */
    color: #030303;
    text-align: center;
    padding: 8px 0;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    /* position: sticky; */
    /* Optional: if you want it sticky */
    /* top: 0; */
    z-index: 1100;
}

.announcement-bar p {
    margin: 0;
}

/* === HEADER === */
.site-header {
    /* Menta "Bien Lindo" (Fresh Mint to Soft Turquoise) */
    background: linear-gradient(90deg, #eb54ff, #96185d);
    background-size: cover;
    background-position: center;
    background-blend-mode: overlay;

    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 0 1rem;
    height: 80px;
    display: flex;
    /* Flex header */
    align-items: center;
    width: 100%;
}

.header-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    /* Changed to Flex */
    justify-content: space-between;
    align-items: center;
}

/* Logo */
.logo-container {
    flex: 0 0 auto;
}

.site-logo {
    height: 250px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Desktop Navigation */
.desktop-nav {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 1.5rem;
    /* Tighter items */
    margin-left: 2rem;
    /* Fixed distance from logo */
    /* Removed flex: 1 to prevent taking up all space */
}

.desktop-nav a,
.dropbtn {
    color: #fff;
    text-decoration: none;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    /* Reduced specific spacing */
    background: none;
    border: none;
    cursor: pointer;
    transition: opacity 0.3s;
    position: relative;
    padding: 8px 0;
}

.desktop-nav a:hover,
.dropbtn:hover {
    opacity: 0.7;
}

/* Icons */
.header-icons {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1.2rem;
    flex: 0 0 auto;
    margin-left: auto;
    /* Push icons to the right, but Nav stays left */
}

.icon-link {
    color: #fff;
    font-size: 1.2rem;
    text-decoration: none;
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    justify-self: start;
}

/* === DROPDOWN (Desktop) === */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #fff;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    border-radius: 4px;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    color: var(--text-main);
    padding: 10px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
    font-size: 0.9rem;
    font-family: var(--font-body);
    text-transform: capitalize;
}

.dropdown-content a:hover {
    background-color: #f1f1f1;
    color: var(--primary-color);
}

/* === MOBILE DRAWER === */
.mobile-drawer {
    position: fixed;
    top: 0;
    left: -100%;
    width: 300px;
    height: 100vh;
    background: #fff;
    z-index: 2000;
    transition: left 0.3s ease-in-out;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.mobile-drawer.active {
    left: 0;
}

.drawer-header {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.drawer-header h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    margin: 0;
}

.close-drawer {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-main);
}

.drawer-content {
    padding: 1rem 0;
    overflow-y: auto;
}

.drawer-content>a,
.drawer-dropbtn {
    display: flex;
    justify-content: space-between;
    padding: 15px 1.5rem;
    color: var(--text-main);
    text-decoration: none;
    font-size: 1rem;
    border-bottom: 1px solid #f9f9f9;
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-family: var(--font-body);
}

.drawer-dropdown-content {
    display: none;
    background: #f8f8f8;
}

.drawer-dropdown-content.show {
    display: block;
}

.drawer-dropdown-content a {
    display: block;
    padding: 12px 1.5rem 12px 2.5rem;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.95rem;
    border-bottom: 1px solid #eee;
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1500;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* === HOME CATEGORY GRID (Replaces Carousel) === */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.category-card {
    position: relative;
    aspect-ratio: 1 / 1;
    /* Square */
    width: 100%;
    /* Fill grid cell */
    max-width: 280px;
    /* Small/Square */
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    /* Softer shadow */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: #f0f0f0;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.category-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}

.category-card:hover img {
    transform: scale(1.1);
}

.category-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 50%);
    display: flex;
    align-items: flex-end;
    padding: 2rem;
}

.category-card h3 {
    color: white;
    font-size: 2rem;
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Mobile responsive tweak */
@media (max-width: 768px) {
    .category-grid {
        grid-template-columns: 1fr;
        /* Stack on mobile */
    }

    .category-card {
        height: 250px;
    }
}

/* === FILTROS === */
.filters {
    display: none;
    /* JS toggle */
    background: var(--bg-card);
    padding: 1.5rem;
    margin: 2rem auto;
    max-width: 800px;
    border-radius: var(--border-radius);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.03);
    text-align: center;
}

.filters input {
    padding: 0.8rem 1.2rem;
    margin: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
    width: 200px;
}

.filters input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(142, 45, 226, 0.1);
}

/* === CATEGORÍAS (Botones) === */
.categories {
    display: none;
    /* JS toggle */
    text-align: center;
    padding: 1rem;
    margin-bottom: 2rem;
}

.categories button {
    background: #fff;
    border: 1px solid var(--border-color);
    padding: 0.8rem 1.5rem;
    margin: 0.5rem;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-main);
    transition: var(--transition-speed);
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.categories button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.categories button.active {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    box-shadow: 0 5px 15px rgba(142, 45, 226, 0.3);
}

/* === GRID DE PRODUCTOS === */
.container {
    display: none;
    /* JS toggle */
    grid-template-columns: repeat(3, 1fr);
    /* 3 por fila en escritorio */
    gap: 3rem;
    /* Espaciado generoso */
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto 4rem;
}

/* === TARJETA DE PRODUCTO === */
.card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    transition: var(--transition-speed);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    border: 1px solid transparent;
    /* Para evitar saltos en hover */
    overflow: hidden;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: var(--card-shadow-hover);
    border-color: rgba(142, 45, 226, 0.1);
}

.card img {
    width: 100%;
    aspect-ratio: 4/5;
    /* Formato vertical elegante */
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 1.2rem;
    cursor: pointer;
    transition: transform 0.5s ease;
}

.card:hover img {
    transform: scale(1.03);
}

.card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    line-height: 1.4;
    min-height: 3.4em;
    /* Alinear alturas */
}

.card p {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 1.2rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.card p.expanded {
    display: block;
    -webkit-line-clamp: unset;
    line-clamp: unset;
    overflow: visible;
    height: auto;
}

.card-bottom {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}

/* Precio y Estado */
.price {
    font-family: var(--font-heading);
    color: var(--primary-color);
    font-size: 1.8rem;
    font-weight: 700;
}

.available,
.soldout {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 10px;
    border-radius: 4px;
}

.available {
    color: var(--success-color);
    background: rgba(39, 174, 96, 0.1);
}

.soldout {
    color: var(--error-color);
    background: rgba(231, 76, 60, 0.1);
}

/* Botón Comprar / Consultar */
button.buy {
    width: 100%;
    padding: 12px;
    background: var(--text-main);
    /* Negro/Gris oscuro elegante */
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-speed);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

button.buy:hover {
    background: var(--primary-color);
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(142, 45, 226, 0.3);
}

/* Enlace envoltorio del botón */
a {
    text-decoration: none;
    width: 100%;
}

/* === MODAL === */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    padding-top: 5vh;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    /* Fondo más oscuro */
    backdrop-filter: blur(5px);
    /* Efecto moderno */
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #fff;
    font-size: 50px;
    font-weight: 300;
    cursor: pointer;
    transition: 0.2s;
}

.close:hover {
    color: var(--primary-color);
    transform: rotate(90deg);
}



/* =========================================
   RESPONSIVE LAYOUT
   ========================================= */

/* Tablet (2 columnas) */
@media (max-width: 1024px) {
    .container {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
        padding: 1.5rem;
    }

    .carousel {
        height: 400px;
    }
}

/* Móvil (1 columna y Menú) */
@media (max-width: 768px) {
    .site-header {
        height: 90px;
        /* Reverted to original height as requested */
        padding: 0 1rem;
    }

    .header-container {
        grid-template-columns: 1fr auto 1fr;
    }

    .mobile-toggle {
        display: block;
        font-size: 1.8rem;
        /* Slightly bigger hamburger */
    }

    .desktop-nav {
        display: none;
    }

    .logo-container {
        justify-self: center;
        display: flex;
        align-items: center;
        height: 100%;
    }

    .site-logo {
        height: 120px;
        /* Increased noticeably for mobile as requested */
        width: auto;
        object-fit: contain;
    }

    .header-icons {
        gap: 1rem;
    }

    .icon-link {
        font-size: 1.3rem;
        /* Bigger icons */
    }

    /* Content Layout */
    .container {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .card {
        /* Ensure card has fixed height structure if needed, but flex is usually better. 
           For "fixed size" request, we rely on the constraints of children. */
    }

    .card img {
        height: auto;
        aspect-ratio: 1/1;
    }

    /* Description specifically for mobile to handle "Read More" without resize */
    .card p.mobile-desc {
        max-height: 80px;
        /* Fixed height for text area */
        overflow: hidden;
        position: relative;
        transition: all 0.3s;
    }

    .card p.mobile-desc.expanded {
        overflow-y: auto;
        /* Scroll if content exceeds height */
    }

    .read-more-link {
        color: var(--primary-color);
        font-weight: bold;
        cursor: pointer;
        display: inline-block;
        margin-left: 5px;
    }

    .filters input {
        width: 100%;
        margin: 0.5rem 0;
    }

    .carousel {
        height: 300px;
    }
}

/* === FOOTER === */
footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 3rem 1.5rem;
    margin-top: 4rem;
    font-size: 0.95rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2rem;
}

.footer-info p {
    margin: 0.5rem 0;
}

.footer-info strong {
    color: #fff;
}

.footer-copy {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    width: 100%;
}

.footer-copy p {
    margin: 0.3rem 0;
    font-size: 0.85rem;
    opacity: 0.8;
}

.developer strong {
    color: var(--accent-color);
}