/* Zoco Alfombras - Premium Design System */

:root {
    /* Color Palette - HSL (Earthy, Premium, Warm) */
    --clr-primary: 25, 60%, 45%;
    /* Terracotta / Burnt Orange */
    --clr-primary-dark: 25, 65%, 35%;
    --clr-secondary: 35, 30%, 90%;
    /* Warm Beige/Off-white background */
    --clr-accent: 45, 20%, 20%;
    /* Dark Earth/Brown for text */
    --clr-white: 0, 0%, 100%;
    --clr-overlay: 45, 20%, 20%;
    /* Dark overlay */

    /* Typography */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Outfit', sans-serif;

    /* Spacing */
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 2rem;
    --spacing-xl: 4rem;

    /* UI Elements */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 10px 30px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: hsl(var(--clr-secondary));
    color: hsl(var(--clr-accent));
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
}

main {
    flex: 1;
    padding-top: 80px;
    /* Header height */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

/* Header */
.main-header {
    background: hsla(var(--clr-secondary), 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid hsla(var(--clr-accent), 0.1);
    height: 80px;
    display: flex;
    align-items: center;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-size: 2.5rem;
    font-family: var(--font-body);
    /* Sans-serif like the sign */
    font-weight: 800;
    /* Extra bold */
    color: #E71D36;
    /* Bright Red matching the sign */
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.1);
    /* Subtle depth */
    margin-right: auto;
}

/* Removed .logo span as it's no longer used, but keeping rule to avoid errors if added back */
.logo span {
    display: none;
}

.main-nav {
    display: flex;
    gap: var(--spacing-lg);
}

.nav-link {
    font-size: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    padding-bottom: 4px;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: hsl(var(--clr-primary));
    transition: var(--transition);
}

.nav-toggle {
    display: none;
    /* Hidden on desktop */
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: hsl(var(--clr-accent));
    padding: 0.5rem;
}

.header-phone {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: hsl(var(--clr-primary));
    font-weight: 600;
    font-size: 1.05rem;
    text-decoration: none;
    margin-left: auto;
    transition: color 0.3s ease;
}

.header-phone:hover {
    color: hsl(var(--clr-accent));
}

@media (max-width: 768px) {
    .header-phone .phone-number {
        display: none;
    }

    .header-phone {
        margin-left: 0;
        margin-right: var(--spacing-sm);
    }
}

.header-search {
    display: flex;
    align-items: center;
    background: white;
    padding: 0.25rem 0.5rem;
    border-radius: 50px;
    border: 1px solid hsla(var(--clr-accent), 0.2);
    margin-left: var(--spacing-md);
}

.header-search input {
    border: none;
    outline: none;
    font-size: 0.9rem;
    width: 120px;
    font-family: var(--font-body);
    color: hsl(var(--clr-accent));
    background: transparent;
    transition: width 0.3s ease;
}

.header-search input:focus {
    width: 180px;
}

.header-search button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 0 0.25rem;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.header-search button:hover {
    opacity: 1;
}

/* Hero Section */
.hero {
    height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.6)),
        url('../../img/portada.png');
    background-size: cover;
    background-position: center;
    text-align: center;
    margin-top: -80px;
    padding-top: 80px;
}

.hero-content h2 {
    font-size: 4rem;
    margin-bottom: var(--spacing-md);
    color: hsl(var(--clr-white));
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.hero-content p {
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto var(--spacing-xl);
    color: hsl(var(--clr-white));
    opacity: 0.95;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: hsl(var(--clr-primary));
    color: hsl(var(--clr-white));
    box-shadow: 0 4px 15px hsla(var(--clr-primary), 0.4);
}

.btn-primary:hover {
    background: hsl(var(--clr-primary-dark));
    transform: translateY(-2px);
    box-shadow: 0 8px 25px hsla(var(--clr-primary), 0.5);
}

/* Footer Premium */
.main-footer {
    background: linear-gradient(180deg, #1a1a2e 0%, #0d0d1a 100%);
    color: #ccc;
    margin-top: auto;
    position: relative;
}

.footer-top-line {
    height: 3px;
    background: linear-gradient(90deg, hsl(var(--clr-primary)), #e67e22, #f39c12, hsl(var(--clr-primary)));
    background-size: 200% 100%;
    animation: footerLineMove 4s ease-in-out infinite;
}

@keyframes footerLineMove {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.2fr 1.5fr 0.8fr 1fr;
    gap: 2rem;
    padding: 3rem 0 2rem;
}


.footer-logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: white;
    margin: 0 0 0.3rem;
    font-family: var(--font-body);
}

.footer-tagline {
    font-size: 0.85rem;
    color: #888;
    margin: 0 0 1rem;
    font-style: italic;
}

.footer-socials {
    display: flex;
    gap: 0.6rem;
}

.social-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    transition: all 0.3s ease;
    text-decoration: none;
}

.social-icon:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
}

.social-icon:nth-child(1):hover {
    background: #1877F2;
    color: white;
}

.social-icon:nth-child(2):hover {
    background: #ea4335;
    color: white;
}

.social-icon.social-whatsapp:hover {
    background: #25d366;
    color: white;
}

.footer-heading {
    font-size: 0.82rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin: 0 0 1rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 25px;
    height: 2px;
    background: hsl(var(--clr-primary));
    border-radius: 2px;
}

.footer-schedule {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-schedule li {
    display: flex;
    justify-content: space-between;
    padding: 0.35rem 0;
    font-size: 0.82rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-schedule li:last-child {
    border-bottom: none;
}

.footer-schedule li span:first-child {
    color: white;
    font-weight: 600;
}

.footer-schedule li.closed span:last-child {
    color: #e74c3c;
    font-weight: 600;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: #999;
    text-decoration: none;
    font-size: 0.88rem;
    transition: all 0.2s ease;
    position: relative;
    padding-left: 0;
}

.footer-links a:hover {
    color: white;
    padding-left: 6px;
}

.footer-contact {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-contact li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.7rem;
    font-size: 0.85rem;
}

.footer-contact li svg {
    flex-shrink: 0;
    color: hsl(var(--clr-primary));
}

.footer-contact a {
    color: #bbb;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-contact a:hover {
    color: white;
}

/* Bottom Bar */
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 1rem 0;
}

.footer-bottom-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    color: #666;
}

.footer-bottom p {
    margin: 0;
}

.footer-legal {
    display: flex;
    gap: 1rem;
}

.footer-legal a {
    color: #666;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-legal a:hover {
    color: #aaa;
}

/* WhatsApp Float */
.whatsapp-float {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 56px;
    height: 56px;
    background: #25d366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    z-index: 998;
    transition: all 0.3s ease;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.6);
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .footer-socials {
        justify-content: center;
    }

    .footer-heading::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .footer-schedule li {
        justify-content: center;
        gap: 1rem;
    }

    .footer-bottom-inner {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}


/* --- Typography Utilities --- */
.center-text {
    text-align: center;
}

.subheading {
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.2em;
    color: hsl(var(--clr-primary));
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    display: block;
}

/* --- Page Header (Premium) --- */
.page-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 40%, #0f3460 100%);
    padding: var(--spacing-xl) 0 var(--spacing-md);
    margin-bottom: 0;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 50%, rgba(255, 255, 255, 0.03) 0%, transparent 70%);
    animation: headerShimmer 8s ease-in-out infinite alternate;
}

@keyframes headerShimmer {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(5%, 3%);
    }
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-sm);
    color: white;
    position: relative;
}

.page-header p,
.page-header .subheading,
.page-header nav {
    color: rgba(255, 255, 255, 0.7);
    position: relative;
}

.page-header #breadcrumb-filters {
    color: #f0a500 !important;
}




/* ===== Catalog Sidebar Layout ===== */
.catalog-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    padding-top: var(--spacing-sm);
    padding-bottom: var(--spacing-xl);
    max-width: 1400px;
    margin: 0 auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* --- Sidebar --- */
.catalog-sidebar {
    width: 190px;
    flex-shrink: 0;
    order: 1;
    position: sticky;
    top: 75px;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
    background: white;
    border-radius: 10px;
    padding: 0.8rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid #f0f0f0;
}

.catalog-sidebar::-webkit-scrollbar {
    width: 3px;
}

.catalog-sidebar::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.6rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.sidebar-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    flex-shrink: 0;
}

.sidebar-reset-btn {
    margin-left: auto;
    background: linear-gradient(135deg, hsl(var(--clr-primary)), #e67e22);
    color: white;
    border: none;
    padding: 0.2rem 0.6rem;
    border-radius: 50px;
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: var(--font-body);
    white-space: nowrap;
}

.sidebar-reset-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px hsla(var(--clr-primary), 0.4);
}

.sidebar-close-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.1rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.sidebar-search {
    margin-bottom: 0.6rem;
}

.sidebar-search-input {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 0.78rem;
    transition: border-color 0.2s;
}

.sidebar-search-input:focus {
    outline: none;
    border-color: hsl(var(--clr-primary));
    box-shadow: 0 0 0 2px hsla(var(--clr-primary), 0.1);
}

.sidebar-group {
    margin-bottom: 0.55rem;
}

.sidebar-group-title {
    font-size: 0.65rem;
    font-weight: 700;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 0.3rem;
    margin-top: 0;
}

.sidebar-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.chip {
    background: #f5f5f5;
    border: 1px solid #e8e8e8;
    border-radius: 50px;
    padding: 0.22rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-family: var(--font-body);
}

.chip:hover {
    background: #eee;
    border-color: #bbb;
    color: #333;
}

.chip.active {
    background: hsl(var(--clr-primary));
    border-color: hsl(var(--clr-primary));
    color: white;
    box-shadow: 0 1px 6px hsla(var(--clr-primary), 0.3);
}

.sidebar-count {
    display: block;
    text-align: center;
    margin-top: 0.5rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: #bbb;
}

.sidebar-count span {
    color: hsl(var(--clr-primary));
    font-weight: 800;
}

/* --- Main Grid Area --- */
.catalog-main {
    flex: 1;
    min-width: 0;
    order: 2;
    /* Grid on the right */
}

/* --- Mobile Toggle Bar (hidden on desktop) --- */
.sidebar-mobile-toggle {
    display: none;
}

.sidebar-overlay {
    display: none;
}

/* Hide old elements */
.mobile-filter-bar {
    display: none;
}

.chip-filters {
    display: none;
}

.filter-bar-compact {
    display: none;
}

/* --- Search Input --- */
.search-container {
    position: relative;
    margin-right: var(--spacing-sm);
}

.search-input {
    padding: 0.6rem 1rem 0.6rem 2.2rem;
    /* Left padding for icon */
    border: 1px solid hsla(var(--clr-accent), 0.2);
    border-radius: 50px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    width: 200px;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: hsl(var(--clr-primary));
    width: 220px;
    /* Slight expand */
    box-shadow: 0 0 0 3px hsla(var(--clr-primary), 0.1);
}

.icon-search {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.5;
    font-style: normal;
    font-size: 0.9rem;
    pointer-events: none;
}

/* --- Favorites Button --- */
.product-card {
    position: relative;
    /* Context for absolute fav btn */
}

.btn-fav {
    position: absolute;
    top: 10px;
    right: 10px;
    background: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    opacity: 0;
    /* Hidden by default until hover or active */
    transform: translateY(-5px);
}

.product-card:hover .btn-fav,
.btn-fav.active {
    opacity: 1;
    transform: translateY(0);
}

.btn-fav .icon-heart {
    font-style: normal;
    color: #ccc;
    font-size: 1.2rem;
    line-height: 1;
    transition: color 0.3s ease;
}

.btn-fav:hover .icon-heart {
    color: #e74c3c;
}

.btn-fav.active .icon-heart {
    color: #e74c3c;
    animation: heartPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes heartPop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }

    100% {
        transform: scale(1);
    }
}

.dropdown-group {
    position: relative;
}

.dropdown-trigger {
    background: white;
    border: 1px solid hsla(var(--clr-accent), 0.2);
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    color: hsl(var(--clr-accent));
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.dropdown-trigger:hover,
.dropdown-trigger.active {
    border-color: hsl(var(--clr-primary));
    color: hsl(var(--clr-primary));
    background: white;
    /* Keep white for cleanliness */
}

.dropdown-content {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: white;
    min-width: 200px;
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    z-index: 101;
}

.dropdown-content.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Filter buttons inside dropdown */
.filter-btn {
    background: transparent;
    border: none;
    text-align: left;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: hsl(var(--clr-accent));
    font-size: 0.9rem;
    transition: var(--transition);
}

.filter-btn:hover {
    background: hsla(var(--clr-secondary), 0.5);
    color: hsl(var(--clr-primary));
    padding-left: 0.75rem;
    /* Slight shift effect */
}

.filter-btn.active {
    background: hsl(var(--clr-primary));
    color: white;
    font-weight: 600;
    padding-left: 0.75rem;
}

/* Actions & Counter */
.filter-actions-compact {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-left: var(--spacing-md);
    padding-left: var(--spacing-md);
    border-left: 1px solid hsla(var(--clr-accent), 0.2);
}

.btn-reset {
    background: none;
    border: none;
    text-decoration: underline;
    font-size: 0.85rem;
    color: hsl(var(--clr-accent));
    cursor: pointer;
    opacity: 0.7;
}

.btn-reset:hover {
    opacity: 1;
    color: #e74c3c;
    /* Red for clear action */
}

.results-count-compact {
    font-size: 0.85rem;
    color: hsla(var(--clr-accent), 0.6);
    white-space: nowrap;
}


/* --- Admin Panel --- */
.admin-section {
    padding-bottom: var(--spacing-xl);
    display: flex;
    justify-content: center;
}

.admin-login-box {
    background: white;
    padding: var(--spacing-xl);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-hover);
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.admin-login-box h3 {
    margin-bottom: var(--spacing-md);
    color: hsl(var(--clr-primary));
}

.admin-dashboard {
    width: 100%;
    max-width: 800px;
    background: white;
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid hsla(var(--clr-accent), 0.1);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.full-width {
    grid-column: 1 / -1;
}

.form-input,
.form-input-file,
select.form-input {
    padding: 0.8rem;
    border: 1px solid hsla(var(--clr-accent), 0.2);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 1rem;
    width: 100%;
}

.form-input:focus {
    outline: none;
    border-color: hsl(var(--clr-primary));
}

.checkbox-group {
    flex-direction: row;
    align-items: center;
    grid-column: 1 / -1;
}

.form-actions {
    margin-top: var(--spacing-lg);
    text-align: center;
}

/* Alerts */
.alert {
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.alert.error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.alert.success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}



.catalog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
}

/* --- Product Card --- */
.product-card {
    background: hsl(var(--clr-white));
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
    border: 1px solid transparent;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: hsla(var(--clr-primary), 0.2);
}

.card-image {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.product-card:hover .card-image img {
    transform: scale(1.05);
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: hsla(var(--clr-overlay), 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    /* Separate buttons */
    opacity: 0;
    transition: var(--transition);
    backdrop-filter: blur(2px);
}

.card-overlay .btn {
    margin: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 45px;
    /* Fixed height */
    min-width: 140px;
    /* Fixed width for uniformity */
    padding: 0 1.5rem !important;
    font-size: 0.85rem;
    font-family: var(--font-body);
    line-height: 1;
    border: none;
    /* Reset button border */
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
}

.product-card:hover .card-overlay {
    opacity: 1;
}

.card-info {
    padding: var(--spacing-md);
    text-align: center;
}

.card-info h3 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.card-meta {
    font-size: 0.9rem;
    color: hsla(var(--clr-accent), 0.7);
}

.badge {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    background: hsl(var(--clr-primary));
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* --- Buttons --- */
.btn-light {
    background: white;
    color: hsl(var(--clr-accent));
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.btn-light:hover {
    background: hsl(var(--clr-primary));
    color: white;
}

.btn-whatsapp {
    background: #25D366;
    color: white;
    width: 100%;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-whatsapp:hover {
    background: #20BA5C;
    box-shadow: 0 5px 15px rgba(37, 211, 102, 0.3);
}

/* --- Product Detail Page --- */
.product-detail {
    padding-top: var(--spacing-lg);
    padding-bottom: var(--spacing-xl);
}

.breadcrumb {
    margin-bottom: var(--spacing-lg);
    color: hsla(var(--clr-accent), 0.6);
    font-size: 0.9rem;
}

.breadcrumb a:hover {
    color: hsl(var(--clr-primary));
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
}

@media (min-width: 768px) {
    .detail-grid {
        grid-template-columns: 1.5fr 1fr;
        align-items: start;
        gap: var(--spacing-xl);
    }
}

.detail-image {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.detail-image img {
    width: 100%;
    display: block;
}

.detail-info h1 {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-sm);
    color: hsl(var(--clr-accent));
}

.detail-origin {
    font-size: 1.1rem;
    color: hsla(var(--clr-accent), 0.7);
    margin-bottom: var(--spacing-lg);
    border-bottom: 1px solid hsla(var(--clr-accent), 0.1);
    padding-bottom: var(--spacing-md);
}

.detail-description {
    margin-bottom: var(--spacing-lg);
}

.detail-description h3 {
    font-size: 1.1rem;
    margin-bottom: var(--spacing-sm);
    font-family: var(--font-body);
    /* Subtle header */
    opacity: 0.8;
}

.detail-specs {
    background: white;
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
}

.spec-item {
    display: flex;
    flex-direction: column;
}

.spec-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: hsla(var(--clr-accent), 0.5);
    font-weight: 600;
}

.spec-value {
    font-weight: 600;
    font-size: 1.1rem;
}

.detail-badge {
    position: static;
    display: inline-block;
    margin-bottom: var(--spacing-sm);
}

/* --- Floating WhatsApp Button --- */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 20px;
    right: 20px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 3px #999;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.whatsapp-float:hover {
    background-color: #20ba5c;
    transform: scale(1.1);
    box-shadow: 3px 3px 6px #777;
}

/* Use standard img or svg icon inside */
.whatsapp-float img {
    width: 35px;
    height: 35px;
    filter: brightness(0) invert(1);
}

/* --- Utility for Filtering --- */
.hidden {
    display: none !important;
}

/* --- Testimonials --- */
.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

.testimonial-card {
    background: white;
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    transition: var(--transition);
    border: 1px solid hsla(var(--clr-accent), 0.1);
}

.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: hsla(var(--clr-primary), 0.3);
}

.stars {
    color: #f1c40f;
    font-size: 1.2rem;
    letter-spacing: 2px;
}

.review-text {
    font-size: 1rem;
    font-style: italic;
    color: hsla(var(--clr-accent), 0.8);
    flex-grow: 1;
}

.reviewer {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-weight: 600;
}

.reviewer img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

/* --- Related Products (Ficha) --- */
.related-products {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

.related-products h3 {
    margin-bottom: 2rem;
    color: hsl(var(--clr-primary));
    text-align: center;
}

/* --- Carousel Visual Match --- */
.carousel-custom-wrapper {
    display: flex;
    align-items: center;
    position: relative;
    /* Wrapper ensures arrows are outside/aligned */
}

.carousel-viewport {
    width: 100%;
    margin: 0 auto;
    /* Ensure viewport doesn't overflow */
}

.carousel-track-custom {
    display: flex;
    gap: 20px;
    padding: var(--spacing-sm) 0;
    /* Space for shadow */
}

.carousel-item-custom {
    flex: 0 0 calc((100% - 40px) / 3);
    /* 3 items minus 2 gaps of 20px = (100% - 40px)/3 */
    max-width: calc((100% - 40px) / 3);
}

.carousel-control {
    background: transparent;
    border: none;
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    transition: transform 0.2s;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-control:hover {
    transform: translateY(-50%) scale(1.2);
}

.carousel-control.prev-custom {
    left: 0;
}

.carousel-control.next-custom {
    right: 0;
}

@media (max-width: 900px) {
    .carousel-item-custom {
        flex: 0 0 calc((100% - 20px) / 2);
        /* 2 items */
        max-width: calc((100% - 20px) / 2);
    }
}

.carousel-item-custom {
    flex: 0 0 100%;
    /* 1 item */
    max-width: 100%;
}




/* --- Quick View Modal --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 0;
    border: 1px solid #888;
    width: 90%;
    max-width: 800px;
    border-radius: var(--radius-md);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.modal.show .modal-content {
    transform: translateY(0);
}

.close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 20px;
    cursor: pointer;
    z-index: 10;
}

.close-modal:hover,
.close-modal:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.modal-body {
    display: flex;
    flex-wrap: wrap;
}

.modal-image {
    flex: 1 1 300px;
    background: #f4f4f4;
    min-height: 300px;
}

.modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-info {
    flex: 1 1 300px;
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
}

/* --- Mobile Optimizations --- */
@media (max-width: 600px) {

    /* --- Header / Nav Mobile Layout --- */
    .main-header {
        height: auto;
        min-height: 60px;
        position: fixed;
        /* Force fixed */
        top: 0;
        left: 0;
        width: 100%;
        z-index: 1000;
        background-color: hsl(var(--clr-secondary));
        /* Ensure opaque background */
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        /* Slight shadow */
    }

    .header-content {
        flex-wrap: nowrap;
        /* Force single line */
        justify-content: space-between;
        align-items: center;
        position: relative;
        padding: 0.5rem 0;
        gap: 0.5rem;
    }

    /* 1. Logo */
    .logo {
        font-size: 1.5rem;
        order: 1;
        flex: 0 0 auto;
    }

    /* 2. Search (Compact in middle) */
    .header-search {
        order: 2;
        margin: 0 10px;
        flex: 1 1 auto;
        /* Take available space */
        width: auto !important;
        /* Override desktop width */
        padding: 0.25rem 0.5rem;
        margin-top: 0;
        /* Reset */
    }

    .header-search input {
        width: 100%;
        min-width: 0;
        /* Allow shrink */
    }

    /* 3. Toggle Button */
    .nav-toggle {
        display: block;
        order: 3;
    }

    /* 4. Main Nav (Drawer) */
    .main-nav {
        display: none;
        /* Hidden by default */
        width: 100%;
        order: 4;
        flex-direction: column;
        background: white;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        padding: 1rem;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
        border-top: 1px solid #eee;
        z-index: 1000;
        gap: 1rem;
        align-items: center;
    }

    .main-nav.active {
        display: flex;
    }

    .nav-link {
        font-size: 1.1rem;
        width: 100%;
        text-align: center;
        padding: 0.5rem 0;
        border-bottom: 1px solid #f9f9f9;
        color: #333;
    }

    /* Hide desktop-specific search logic if any */

    /* ===== Sidebar Mobile ===== */
    .sidebar-mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        padding: 0.6rem 0;
        margin-top: 0.5rem;
    }

    .sidebar-toggle-btn {
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        background: #1a1a1a;
        color: white;
        border: none;
        padding: 0.5rem 1.2rem;
        border-radius: 8px;
        font-size: 0.85rem;
        font-weight: 600;
        cursor: pointer;
        font-family: var(--font-body);
    }

    .sidebar-mobile-count {
        font-size: 0.82rem;
        font-weight: 600;
        color: #888;
    }

    .sidebar-mobile-reset {
        background: none;
        border: 1.5px solid #ddd;
        padding: 0.4rem 0.8rem;
        border-radius: 8px;
        font-size: 0.78rem;
        font-weight: 600;
        color: #999;
        cursor: pointer;
        font-family: var(--font-body);
    }

    /* Sidebar as slide-in panel */
    .catalog-sidebar {
        position: fixed;
        top: 0;
        left: -300px;
        width: 280px;
        height: 100vh;
        max-height: 100vh;
        z-index: 1000;
        border-radius: 0;
        border: none;
        box-shadow: 4px 0 30px rgba(0, 0, 0, 0.15);
        transition: left 0.3s ease;
        padding: 1rem 1.2rem;
    }

    .catalog-sidebar.open {
        left: 0;
    }

    .sidebar-close-btn {
        display: block;
    }

    /* Overlay behind sidebar */
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 999;
    }

    .sidebar-overlay.open {
        display: block;
    }

    /* Layout becomes single column */
    .catalog-layout {
        flex-direction: column;
        gap: 0;
    }

    .catalog-main {
        width: 100%;
    }

    .search-input {
        width: 100%;
    }

    .search-input:focus {
        width: 100%;
    }

    /* Catalog Grid */
    .catalog-grid {
        grid-template-columns: 1fr;
    }

    /* Contact Page */
    .contact-section>div {
        gap: 1.5rem !important;
    }

    .contact-section>div>div {
        flex-basis: 100% !important;
        max-width: 100% !important;
    }

    /* Carousel Buttons -> Now correctly inside media query */

    /* Carousel Buttons */
    .card-overlay .btn {
        min-width: auto !important;
        /* Allow shrinking */
        padding: 0 1rem !important;
        font-size: 0.75rem;
        height: 40px;
    }

    /* Modal */
    .modal-content {
        width: 95%;
        margin: 10px;
    }

    .modal-image {
        min-height: 200px;
    }

    /* Fix Hero Title Size */
    .hero-content h2 {
        font-size: 2.2rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    /* Product Detail Page Mobile layout */
    .detail-grid {
        grid-template-columns: 1fr !important;
    }

    .detail-info h1 {
        font-size: 1.8rem;
        line-height: 1.2;
    }
}

/* --- Automated Detail Viewer --- */
.detail-viewer {
    width: 100%;
    /* Default aspect ratio for vertical carpets */
    aspect-ratio: 4/5;
    /* Fallback min-height */
    min-height: 500px;
    position: relative;
    overflow: hidden;
    background-color: #f5f5f5;
    /* Placeholder color */
    border-radius: var(--radius-lg);
    /* Match detail-image style */
}

.detail-viewer-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    position: absolute;
    top: 0;
    left: 0;
    will-change: transform, background-image;
}

/* --- Automated Detail Viewer & Layout --- */
/* --- Automated Detail Viewer & Layout --- */
.detail-image-wrapper {
    display: flex;
    gap: var(--spacing-md);
    height: 500px;
    width: 100%;
    min-width: 0;
    /* Prevent grid blowout */
}

/* Thumbnails Column */
.detail-thumbnails {
    width: 80px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    /* Scroll if many thumbs */
    padding-right: 5px;
    /* Space for scrollbar */
}

.detail-thumbnails::-webkit-scrollbar {
    width: 4px;
}

.detail-thumbnails::-webkit-scrollbar-thumb {
    background-color: hsla(var(--clr-accent), 0.2);
    border-radius: 4px;
}

.thumbnail-item {
    width: 100%;
    aspect-ratio: 1;
    /* Square thumbs */
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
    flex-shrink: 0;
}

.thumbnail-item:hover,
.thumbnail-item.active {
    border-color: hsl(var(--clr-primary));
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Main View Column */
.detail-main-view {
    flex: 1;
    height: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.detail-viewer {
    width: 100%;
    height: 100%;
    /* Fill the main view container */
    position: relative;
    overflow: hidden;
    background-color: #f5f5f5;
    cursor: zoom-in;
    /* [NEW] Indicate zoom capability */
}