/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 12px;
}

:root {
    --primary: #111827; /* A very dark, near-black for a modern feel */
    --primary-dark: #000000; /* Pure black for hover states */
    --secondary: #6c757d;
    --success: #28a745;
    --danger: #dc3545;
    --light: #ffffff; /* A clean white background */
    --dark: #1f2937; /* A softer dark gray for body text */
    --gray: #6c757d;
    --light-gray: #e9ecef;
    --border-radius: 12px;
    --shadow: 0 4px 20px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background-color: var(--light);
    overflow-y: scroll; /* Always show scrollbar to prevent layout shift */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6, .logo, .btn {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    letter-spacing: 0.5px;
}

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

/* Navigation */
.navbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--light-gray);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    color: #000000;
    text-decoration: none;
    font-weight: 900;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;

}

.nav-links a {
    font-size: 1rem;
    text-decoration: none;
    color: var(--dark);
    font-weight: 600;
    transition: var(--transition);
    padding: 0.25rem 0;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
    background: none;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

#cart-icon {
    position: relative;
    font-size: 1.2rem;
    margin-top: 7px; /* Add space for the count bubble */
}

#cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 0; /* Remove gap for pill look */
    margin-left: 1rem;
    background-color: #f1f5f9; /* Light gray track background */
    padding: 4px;
    border-radius: 24px; /* Pill shape */
}

.lang-btn {
    background: transparent;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    padding: 4px 10px; /* Horizontal padding for click area */
    transition: all 0.3s ease;
    opacity: 0.6;
    filter: grayscale(100%); /* Inactive flags are gray */
    display: flex;
    align-items: center;
    justify-content: center;
}

.lang-btn:hover,
.lang-btn.active {
    opacity: 1;
    filter: grayscale(0); /* Active flag has color */
}

.lang-btn:hover {
    background-color: rgba(255,255,255, 0.5);
}

.lang-btn.active {
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* Lifted effect for active state */
    transform: scale(1);
}

.lang-btn img {
    width: 20px; /* Slightly smaller to fit the pill nicely */
    height: auto;
    display: block;
    border-radius: 2px;
}

/* Hamburger Menu Button */
.hamburger {
    display: none; /* Hidden by default on larger screens */
    background: none;
    border: none;
    color: var(--dark);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Breadcrumbs */
.breadcrumbs-nav {
    background-color: #f8f9fa; /* A slightly off-white color */
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--light-gray);
    font-size: 0.9rem;
}

.breadcrumbs {
    list-style: none;
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item a {
    color: var(--gray);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumb-item a:hover {
    color: var(--primary);
}

.breadcrumb-item + .breadcrumb-item::before {
    content: none;
}

.breadcrumb-separator {
    margin: 0 0.5rem;
    color: var(--gray);
}

/* Hero Section */
.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    padding: 2rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
    align-items: center;
}

.hero-content h1 {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.highlight {
    color: var(--primary);
}

.hero-content p {
    font-size: 1.2rem;
    color: var(--gray);
    margin-bottom: 2rem;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 1rem 2rem;
    border-radius: 8px; /* Slightly sharper radius for this font */
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    display: inline-block;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
}

.hero-image img {
    width: 100%;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

/* Featured Products */
.featured {
    padding: 4rem 2rem;
    background: white;
    max-width: 1200px;
    margin: 0 auto;
}

.featured-header {
    text-align: center;
    margin-bottom: 3rem;
}

.featured-header h2 {
    font-size: 2.5rem;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.featured-header p {
    font-size: 1.1rem;
    color: var(--gray);
}

.featured-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start; /* Align items to the top */
}

.products-area {
    flex: 1; /* Allows this element to grow and fill available space */
    min-width: 0; /* Prevents flex items from overflowing */
}

.filters-sidebar .search-box {
    border-bottom: 1px solid var(--light-gray);
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.filters-sidebar {
    width: 240px;
    flex-shrink: 0;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}
.filters-header h3 {
    margin: 0;
}

.filter-group details {
    border-bottom: 1px solid var(--light-gray);
    padding: 1rem 0;
}

.filter-group summary {
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    list-style: none; /* Remove default marker */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-group summary::-webkit-details-marker {
    display: none; /* Hide marker for Chrome/Safari */
}

.filter-group summary::after {
    content: '\f078'; /* FontAwesome down arrow */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    transition: transform 0.2s ease;
}

.filter-group details[open] > summary::after {
    transform: rotate(180deg);
}

.filter-group ul {
    list-style: none;
    padding-top: 1rem;
}

.filter-group ul li a {
    display: block;
    padding: 0.5rem 0;
    color: var(--gray);
    text-decoration: none;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}
.filter-group ul li a:hover {
    color: var(--primary);
}

.tick {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid var(--light-gray);
    border-radius: 4px;
    transition: all 0.2s;
    color: transparent; /* Hide the checkmark by default */
}

.filter-group ul li a.active .tick {
    border-color: var(--primary);
    background-color: var(--primary);
    color: white; /* Show the checkmark */
}

.filter-group ul li a.active .tick::before {
    content: '✔';
    display: block;
    text-align: center;
    font-size: 12px;
    line-height: 15px; /* Vertically center the tick */
}

.filter-group ul li a.active {
    color: var(--primary);
}
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Explicitly set to 3 columns */
    gap: 2rem;
}

.no-products-found {
    grid-column: 1 / -1; /* Span all columns in the grid */
    text-align: center;
    padding: 4rem 2rem;
    color: var(--gray);
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
}

.no-products-found .fa-box-open {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.no-products-found h3 {
    font-size: 1.5rem;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

@keyframes cardUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.product-card {
  opacity: 0;
  transform: translateY(50px);
  animation: cardUp 0.6s cubic-bezier(.23, 1, .32, 1) forwards;
}
.product-card:nth-child(1) { animation-delay: 0.0s; } /* Start Immediately */
.product-card:nth-child(2) { animation-delay: 0.1s; } 
.product-card:nth-child(3) { animation-delay: 0.2s; } 
.product-card:nth-child(4) { animation-delay: 0.3s; }
.product-card:nth-child(5) { animation-delay: 0.4s; }
.product-card:nth-child(7) { animation-delay: 0.4s; }
.product-card:nth-child(8) { animation-delay: 0.4s; }
.product-card:nth-child(9) { animation-delay: 0.4s; }

/* --- Pagination Controls --- */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination-btn {
    border: 2px solid var(--light-gray);
    background-color: white;
    color: var(--gray);
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    min-width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
}

.pagination-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination-btn.active {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
}

.pagination-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    background-color: var(--light-gray);
}

.close-filters-btn,
.mobile-controls {
    display: none; /* Hidden by default */
}

.close-filters-btn {
    background-color: var(--primary);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    font-size: 1rem;
}

.close-filters-btn:hover {
    background-color: var(--danger);
    transform: rotate(90deg);
}

/* How It Works */
.how-it-works {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.how-it-works h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.step {
    text-align: center;
    padding: 1rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.step-number {
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 auto 1rem;
}

.step h3 {
    margin-bottom: 1rem;
    color: var(--dark);
}

/* Fixed "Go to Cart" button */
#go-to-cart-btn {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    animation: slideUp 0.5s ease-out;
    /* Let the button size to its content */
    padding: 0.8rem 1.5rem;
    /* Add flex properties to align icon and text */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

@keyframes slideUp {
    from {
        transform: translate(-50%, 100px);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

/* Footer */
footer {
    background: #111827;
    color: white;
    padding: 3rem 2rem 1rem;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.footer-section a {
    color: var(--light-gray);
    text-decoration: none;
    display: block;
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

.footer-section a:hover {
    color: white;
    padding-left: 5px;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: var(--light-gray);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }

    .featured-header h2 {
        font-size: 1.8rem;
    }
    
    .nav-container {
        padding: 1rem;
    }

    .nav-links {
        display: none; /* Hide nav links by default */
        position: absolute;
        top: 70px; /* Adjust based on your navbar height */
        left: 0;
        background-color: white;
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem 0;
        box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    }

    .nav-links.active {
        display: flex; /* Show nav links when active */
        padding: 1rem;
    }

    .hamburger {
        display: block; /* Show hamburger on small screens */
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }

    /* --- Mobile Filter Panel Logic --- */
    .mobile-controls {
        display: flex;
        margin-bottom: 1.5rem;
        gap: 0.5rem;
        align-items: center;
        width: 100%;
    }

    .mobile-controls .search-box {
        flex: 1;
        min-width: 0; /* Allows search bar to shrink to fit */
        margin-bottom: 0;
    }

    #mobile-filter-btn {
        width: auto;
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        flex-shrink: 0; /* Prevents button from being squished */
        white-space: nowrap;
    }

    .filters-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100%;
        width: 300px;
        max-width: 85%;
        background: white;
        z-index: 2001;
        padding: 1.5rem;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        overflow-y: auto;
    }

    .filters-sidebar.active {
        transform: translateX(0);
        box-shadow: 5px 0 25px rgba(0,0,0,0.1);
    }

    .filters-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.4);
        z-index: 2000;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease;
    }
    .filters-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .filters-sidebar .search-box {
        display: none;
    }

    .close-filters-btn { display: flex; }
}

/* Scroll To Top Button */
.scroll-top-btn {
    position: fixed;
    bottom: 3rem;
    right: 2rem;
    z-index: 999;
    background: none;
    border: none;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    padding: 0.5rem;
}

.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-text {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--primary);
    transform: rotate(180deg); /* Flips text to read bottom-to-top */
}

.scroll-line {
    width: 2px;
    height: 40px;
    background-color: var(--primary);
    transition: height 0.3s ease;
    position: relative;
}

.scroll-top-btn:hover .scroll-line {
    height: 60px;
}

.scroll-top-btn:hover .scroll-text {
    color: var(--primary-dark);
}

@media (max-width: 600px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on smaller tablets */
    }
}
