@import url('https://fonts.googleapis.com/css2?family=Asimovian&family=Kanit:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto:ital,wght@0,100..900;1,100..900&family=Sirivennela&display=swap');
/* assets/css/style.css */
/* --- Universal Box Sizing & Font --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
}

:root {
    /* These variables are dynamically set by PHP in header.php */
    --primary-blue: #007bff;
    --light-blue: #6ec3f8;
    --dark-blue: #4134cf;
    --bg-primary: #f8f8f8;
    --bg-secondary: #fff;
    --text-primary: #333333;
    --text-secondary: #f46507ff;
    --border-color: #dee6f4;
    --shadow-light: rgba(0, 0, 0, 0.08);
    --hover-bg: #f0f0f0;
    --slide-gap: 15px;
    --active-scale: 1.1;
    --non-active-scale: 1;
    --horizontal-card-width: 150px;
    --horizontal-card-gap: 15px;
    --secondary-lemon-green: #20bcfa;
    --star-color: #ffcc00;
    --footer-bg-dark: #232F3E;
    --footer-text-light: #DDDDDD;
    --footer-heading-light: #FFFFFF;
    --footer-link-hover: #07b9ea;
    --back-to-top-bg: #37475A;
    --back-to-top-hover-bg: #485769;
    --heading-light-mode-color: #040f6d;
    --search-overlay-bg: rgba(246, 251, 253, 0.304);
    --search-overlay-blur: 5px;
    --brand-primary: #007bff;
    --brand-accent:  #28a745;
    --bg-overlay:    rgba(52,58,64,0.55);
    --cta-bg:        #007bff;
    --cta-text:      #ffffff;
    --dot-active:    rgba(255,255,255,0.98);
    --dot-inactive:  rgba(255,255,255,0.40);
}

body {
    font-family: 'Arial', sans-serif; /* Or your preferred font */
    margin: 0;
    padding: 0;
    background-color: var(--bg-primary); /* Uses CSS variable */
    color: var(--text-primary); /* Uses CSS variable */
    transition: background-color 0.3s ease, color 0.3s ease; /* Smooth theme transition */
    line-height: 1.6;
}

/* --- Dark Mode Variables --- */
body.dark-mode {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2c2c2c;
    --text-primary: #f9f9f9;
    --text-secondary: #f46507ff;
    --border-color: #444444;
    --shadow-light: rgba(255, 255, 255, 0.08);
    --hover-bg: #3a3a3a;

    /* Dark mode header visibility improvement */
    --header-bg-dark: #3a3a3a; /* Slightly lighter header background for visibility */
    --header-shadow-dark: rgba(255,255,255,0.15); /* More prominent shadow */
    --header-border-dark: #555555; /* More visible border */

    /* New: Light color for h2 in dark mode */
    --heading-dark-mode-color: #e0e0e0; /* A light grey that blends well */

    /* Search overlay specific variables for dark mode */
    --search-overlay-bg: rgba(0, 0, 0, 0.6); /* Semi-transparent black for dark mode blur */
}

/* General Link Styling */
a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--dark-red);
}
.txt {
    font-family: "Roboto", sans-serif;
    font-optical-sizing: auto;
    font-style: normal;
    color: var(--text-primary);
}
.text {
    text-align: left;
    font-family: 'Poppins', sans-serif;
    margin-bottom: 25px;
    line-height: 1.5;
    color: var(--text-primary);
}
.h2text {
    font-family: 'Poppins', sans-serif;
    font-weight: 500; /* Example of a good weight for a title */
    text-align: left;
    margin: 40px 0 30px;
    font-size: 1.2rem;
    color: var(--heading-light-mode-color);
    transition: color 0.3s ease;
}
.h3text {
    font-family: 'Poppins', sans-serif;
    font-weight: 400; /* Example of a good weight for a title */
    text-align: left;
    margin: 20px 0 15px;
    font-size: 1rem;
    color: var(--heading-light-mode-color);
    transition: color 0.3s ease;
}
.h4text {
    font-family: 'Poppins', sans-serif;
    font-weight: 400; /* Example of a good weight for a title */
    text-align: left;
    margin: 15px 0 10px;
    font-size: 0.9rem;
    color: var(--heading-light-mode-color);
    transition: color 0.3s ease;
}

/* --- Header --- */
.main-header {
    background-color: var(--bg-secondary);
    box-shadow: 0 2px 10px var(--shadow-light);
    padding: 0;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10000;
    transition: background-color 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

body.dark-mode .main-header {
    background-color: var(--header-bg-dark);
    box-shadow: var(--header-shadow-dark);
    border-color: var(--header-border-dark);
}

/* --- Custom Scrollbar for Dark Mode --- */
body.dark-mode::-webkit-scrollbar {
    width: 10px; /* Sets the width of the scrollbar */
}

body.dark-mode::-webkit-scrollbar-track {
    background: var(--bg-primary); /* Makes the track match your site's dark background */
}

body.dark-mode::-webkit-scrollbar-thumb {
    background-color: #3a3a3a;    /* A slightly lighter grey for the handle */
    border-radius: 6px;       /* Rounds the corners of the handle */
    border: 3px solid var(--bg-primary); /* Creates a padding effect around the handle */
}

body.dark-mode::-webkit-scrollbar-thumb:hover {
    background-color: #555555; /* Makes the handle lighter when hovered */
}

/* For Firefox */
body.dark-mode {
    scrollbar-width: thin;
    scrollbar-color: #555555 var(--bg-primary);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo a {
    display: flex;
    flex-direction: row; /* Aligns image and text */
    justify-content: center; /* Horizontally centers them */
    align-items: center; /* Vertically centers them */
    flex-shrink: 0; /* Prevents the logo from shrinking */
    text-decoration: none; /* Removes underline from the link */
}

.logo a p {
    font-size: 1.6rem;
    font-family: "Asimovian", sans-serif;
    font-weight: 600;
    font-style: normal;
    color: var(--text-primary);
    text-decoration: none;
    margin-top: 16px;
    vertical-align: middle; /* Aligns the text with the image */
    transition: color 0.3s ease;
}
.logo a img {
    height: 20px; /* Adjust logo image height as needed */
    vertical-align: middle; /* Aligns the image with the text */
    margin-right: 5px; /* Space between image and text */
}

.logo a p .logo-blue {
    color: var(--text-secondary);
}

.logo-blue {
    color: var(--text-secondary);
}

.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 25px;
}

.main-nav ul li {
    margin-left: 30px;
}

.main-nav ul li a {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: bold;
    transition: color 0.3s ease;
    position: relative;
    padding: 5px 0;
}

.main-nav ul li a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-blue);
    transition: width 0.3s ease;
}

.main-nav ul li a:hover::after,
.main-nav ul li a.active::after {
    width: 100%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.action-icon, .theme-toggle-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0;
    transition: color 0.3s ease, transform 0.2s ease;
}

.action-icon:hover, .theme-toggle-btn:hover {
    color: var(--primary-blue);
    transform: scale(1.2);
}

.cart-icon-top {
    position: relative;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--primary-blue);
    color: #fff;
    font-size: 0.7rem;
    border-radius: 50%;
    padding: 3px 6px;
    min-width: 18px;
    text-align: center;
    line-height: 1;
}

/* This element's job is to allow dropdowns to pop out. */
.category-nav-container {
    position: relative; /* The dropdowns will be positioned relative to this */
    z-index: 3000;      /* Keep it on top of other content */
    padding: 0;    /* Apply vertical padding here */
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 5px var(--shadow-light);
    /* CRITICAL: NO overflow property here! */
}

/* Category Navigation */
.category-nav {
    padding: 10px;
    box-shadow: 0 2px 5px var(--shadow-light);
    overflow-x: auto; /* Enable scrolling on the main container */
    overflow-y: hidden; /* Ensure vertical overflow is hidden */
    -ms-overflow-style: none;  /* Hide scrollbar for IE/Edge */
    scrollbar-width: none;  /* Hide scrollbar for Firefox */
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
/* Hide scrollbar for Chrome, Safari, and Opera */
.category-nav::-webkit-scrollbar {
    display: none;
}

/* The list item that contains a dropdown */
.category-nav .has-dropdown {
    position: relative; /* This is the anchor for the absolute dropdown menu */
}

/* The class toggled by JavaScript to show the dropdown */
.category-nav .has-dropdown.open > .category-dropdown-menu {
    display: block;
}

body.dark-mode .category-nav {
    background-color: var(--bg-primary); /* Should be darker in dark mode if desired */
    border-color: var(--border-color); /* Adjust if needed */
}

.category-list {
    display: flex;
    gap: 15px; /* Space between category items */
    list-style: none;
    margin: 0;
    padding: 0; /* Remove padding from the list itself */
    align-items: center;
    width: max-content; /* Ensure the list is wide enough to scroll */
}
.category-item {
    display: inline-block; /* Ensure items stay on one line */
    font-family: 'Poppins', sans-serif;
    font-weight: bold;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 20px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.category-item:hover {
    background-color: var(--hover-bg);
    color: var(--primary-blue);
    text-decoration: none;
}

.category-item.active {
    background-color: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
    text-decoration: none;
}
.category-item.active:hover {
    background-color: var(--dark-red); /* Darker red on hover for active */
}

/* Basic Styling for Categories Page */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.category-card {
    border: 1px solid #ddd;
    border-radius: 15px;
    overflow: hidden;
    text-align: center;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.category-card img {
    width: 100%;
    height: 180px; /* Fixed height for consistency */
    object-fit: cover; /* Ensures image covers the area, cropping if necessary */
    display: block;
}

.category-card-content {
    padding: 15px;
    flex-grow: 1; /* Allows content area to expand */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100%; /* Ensure content takes full width */
}

.category-card h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.25em;
    color: #333333;
}

.category-card p {
    font-size: 0.9em;
    color: #666;
    line-height: 1.4;
    margin-bottom: 15px;
    max-height: 60px; /* Limit description height */
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-card .btn-view-products {
    display: inline-block;
    background-color: var(--primary-blue);;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.9em;
    transition: background-color 0.2s ease;
    margin-top: auto; /* Push button to the bottom */
}

.category-card .btn-view-products:hover {
    background-color: #0056b3;
}

.no-categories-message {
    text-align: center;
    padding: 50px;
    font-size: 1.2em;
    color: #888;
}

@media (max-width: 768px) {
    .categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }
    .category-card img {
        height: 150px;
    }

    .main-content, .container {
        padding-left: 15px;
        padding-right: 15px;
    }

    .section-title {
        font-size: 1.4rem; /* Make titles slightly smaller */
    }

    .product-card h3, .product-card-horizontal h3 {
        font-size: 0.8rem; /* Adjust font size for smaller cards */
    }

    .product-card .price, .product-card-horizontal .price {
        font-size: 0.9rem;
    }

    .product-card .add-to-cart-btn {
        padding: 8px 12px;
        font-size: 0.75rem;
        text-align: center;
    }
    .search-overlay {
    /* Change from 'center' to 'flex-start' */
        justify-content: flex-start;
        padding: 5px;
    }

    .search-modal-content {
        width: 95%;
        top: 30px;
    }

    .close-search-btn {
        top: 10px;
        right: 10px;
    }

    .ajax-search-results-container {
        /* Change from absolute to static to flow naturally */
        position: static;
        margin-top: 10px;
        max-height: calc(100vh - 200px); /* Use viewport height */
    }

    .search-suggestions {
        margin-top: 20px;
    }

    .search-suggestions ul {
        /* Stack suggestions instead of horizontal layout */
        flex-direction: column;
        align-items: center;
    }
    .search-results-header {
        text-align: center;
    }

    .search-controls {
        /* Make controls full width */
        justify-content: center;
        margin-bottom: 25px;
    }

    .sort-form {
        display: flex;
        flex-direction: column; /* Stack label and select box */
        align-items: center;
        gap: 8px;
        width: 100%;
    }

    .sort-form select {
        width: 80%; /* Make the select box wider */
        padding: 10px;
        font-size: 1rem;
    }
    
    .delivery-options {
        /* This is the key fix: stacks the delivery options vertically on small screens */
        flex-direction: column;
    }
    .checkout-container {
        /* Change from grid to a single-column flex layout */
        display: flex;
        flex-direction: column;
        padding: 20px 15px; /* Adjust padding for mobile */
    }

    .checkout-summary-section {
        /* Move summary to the top on mobile */
        order: 1; 
        margin-bottom: 30px;
    }

    .checkout-form-section {
        order: 2;
    }

    /* Make all form fields stack vertically */
    .form-grid {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .form-group.full-width {
        grid-column: auto; /* Reset grid-specific property */
    }

    .form-group input {
        padding: 12px;
        font-size: 1rem; /* Ensure font is large enough for mobile */
    }

    .place-order-btn {
        /* Make button large and tappable */
        width: 100%;
        padding: 15px;
        font-size: 1.1rem;
        font-weight: bold;
    }
    /* Make the entire top section of the card a clickable link */
    .product-card-link {
        display: block; /* Ensures the link takes up the full space of its content */
        text-decoration: none;
        color: inherit;
        flex-grow: 1; /* Allows the link to fill the available space in the flex container */
    }

    /* Make the 'Add to Cart' button larger and easier to tap */
    .product-card .add-to-cart-btn,
    .product-card-horizontal .add-to-cart-btn {
        width: 90%; /* Make button wider */
        margin: 0 auto 10px; /* Center and add bottom margin */
        padding: 10px 15px; /* Increase padding for a larger tap area */
        font-size: 0.9rem;  /* Slightly larger font */
        font-weight: 600;
    }
}

body.dark-mode .category-item:hover {
    background-color: var(--hover-bg);
    color: var(--primary-blue);
    text-decoration: none;
}
body.dark-mode .category-item {
    background-color: var(--bg-secondary); /* Adjust for dark mode if needed */
    border-color: var(--border-color);
    color: var(--text-primary);
}

body.dark-mode .category-item.active {
    background-color: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}

/* --- Main Content Area --- */
.main-content {
    background-color: var(--bg-secondary);
    min-height: calc(100vh - 250px); /* Adjust based on header/footer height */
    padding: 25px;
    width: 100%;
    margin: 0 auto;
    overflow-x: clip; /* Prevent horizontal overflow */
}

body.dark-mode .container {
    background-color: var(--bg-secondary); /* Adjusted by PHP for dark mode */
    box-shadow: var(--shadow-light); /* Adjusted by PHP for dark mode */
}

/* Section Titles */
.section-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 600; /* Example of a good weight for a title */
    text-align: left;
    margin: 10px 0 30px;
    font-size: 1.6rem;
    color: var(--heading-light-mode-color);
    transition: color 0.3s ease;
}

body.dark-mode .section-title,
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3 {
    color: var(--heading-dark-mode-color);
}

.all-products-section {
    padding: 1rem 0;
    width: 100%;
    max-width: 1200px;
}
.all-products-section .section-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 600; /* Example of a good weight for a title */
    text-align: left;
    margin-bottom: 20px;
}

.featured-section {
    padding: 2rem;
    position: relative;
    width: 100%;
    margin-bottom: 10px;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    overflow: hidden; /* This hides the scrollbar */
}

.featured-section-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 600; /* Example of a good weight for a title */
    text-align: left;
    margin-bottom: 20px;
}

.featured-section-products {
    display: flex;
    overflow-x: scroll; /* Enables horizontal scrolling */
    scroll-behavior: smooth; /* Provides a smooth sliding effect */
    gap: 15px;
    -webkit-overflow-scrolling: touch; /* Improves scrolling performance on iOS devices */
    scrollbar-width: none; /* Hides the scrollbar for Firefox */
    -ms-overflow-style: none; /* Hides the scrollbar for Internet Explorer and Edge */
}

/* Hides the scrollbar for WebKit browsers (Chrome, Safari) */
.featured-section-products::-webkit-scrollbar {
    display: none;
}

.featured-controls {
    position: absolute;
    top: 50%;
    width: 100%;
    max-width: 1260px; /* Wider than container to place arrows outside */
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    justify-content: space-between;
    z-index: 10;
    padding: 0;
    pointer-events: none; /* Allow clicks to pass through */
}

.featured-controls button {
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-primary);
    transition: all 0.2s ease;
    pointer-events: auto; /* Make buttons clickable */
    box-shadow: 0 2px 8px var(--shadow-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.featured-controls button:hover {
    background-color: var(--primary-blue);
    color: white;
    transform: scale(1.1);
}

body.dark-mode .featured-controls button {
    background-color: rgba(44, 44, 44, 0.9);
    color: var(--text-primary);
    border-color: var(--header-border-dark);
}
.product-card-horizontal a {
    text-decoration: none;
    color: inherit;
    flex-grow: 1; /* Allows the link to fill the available space in the flex container */
}

.product-card-horizontal a:hover h3 {
    color: var(--primary-blue);
}

.product-card-horizontal .price-container {
    margin-top: auto; /* Pushes price above the button */
    padding: 10px 0;
}

/* Star Rating */
.star-rating {
    color: var(--star-color);
    font-size: 0.8rem;
    margin-bottom: 5px;
}
.star-rating .fas, .star-rating .far {
    margin-right: 2px;
}


/* --- Hero Slider --- */
.hero-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
    margin-bottom: 10px;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
    box-shadow: 0 4px 15px var(--shadow-light);
}

.slider-container {
    max-width: 100%;
    margin: 0 auto;
    overflow: hidden;
    position: relative;
    padding: 20px 0 60px 0; /* Adjusted padding for dots */
}

.slider-track {
    display: flex;
    align-items: center;
    gap: var(--slide-gap);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide {
    flex: 0 0 calc((100% - (4 * var(--slide-gap))) / 5); /* 5 slides visible on desktop */
    position: relative;
    overflow: hidden;
    width: 100px;
    height: 250px; /* Reduced height for desktop */
    transition: transform 0.5s ease-in-out, border 0.3s ease, box-shadow 0.3s ease, opacity 0.5s ease-in-out;
    border: 3px solid transparent;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    opacity: 1; /* Default opacity */
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 10px;
    transition: transform 0.5s ease-in-out;
}

.slide.active {
    transform: scale(var(--active-scale)); /* Zoom IN the active slide */
    border-color: var(--primary-blue);
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
    z-index: 10;
    opacity: 1; /* Ensure active slide is fully opaque */
}

.slide.active .slide-caption {
    opacity: 1; /* Ensure caption is fully visible on active */
}

.slide-caption {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    color: #FFFFFF;
    text-shadow: 0 1px 3px rgba(0,0,0,0.6);
    background-color: rgba(0, 0, 0, 0.6);
    padding: 15px;
    border-radius: 8px;
    opacity: 0; /* Hidden by default, active slide shows it */
    transition: opacity 0.5s ease;
    text-align: left;
    z-index: 15;
}

.slide-caption h2 {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.slide-caption p {
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.shop-now-btn {
    display: inline-block;
    background-color: var(--primary-blue);
    color: white;
    padding: 8px 16px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.shop-now-btn:hover {
    background-color: var(--dark-red);
    text-decoration: none;
    color: white;
}

.slider-controls {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    max-width: 1300px; /* Make controls slightly wider than container */
    display: flex;
    justify-content: space-between;
    transform: translate(-50%, -50%);
    padding: 0 10px;
    z-index: 20;
    pointer-events: none; /* Let clicks pass through the container */
}

.slider-btn {
    background-color: rgba(255, 255, 255, 0.8);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 12px;
    width: 45px;
    height: 45px;
    cursor: pointer;
    font-size: 1.2rem;
    border-radius: 50%;
    transition: background-color 0.3s ease, transform 0.2s ease;
    pointer-events: auto; /* Make buttons clickable */
    display: flex;
    align-items: center;
    justify-content: center;
}

body.dark-mode .slider-btn {
    background-color: rgba(44, 44, 44, 0.8);
    color: var(--text-primary);
}

.slider-btn:hover {
    background-color: var(--primary-blue);
    color: white;
    transform: scale(1.1);
}

/* --- Slider Dots --- */
.slider-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 15;
}

.dot {
    width: 10px;
    height: 10px;
    background-color: var(--text-secondary);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.dot.active {
    background-color: var(--primary-blue);
    transform: scale(1.3);
}

/* --- Horizontal Scroll Section (New Arrivals) --- */
.horizontal-scroll-section {
    max-width: 1200px;
    margin: 40px auto; /* Increased margin for spacing */
    padding: 0 20px;
}
.horizontal-scroll-section .section-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 600; /* Example of a good weight for a title */
    font-size: 1.6rem;
    color: var(--heading-light-mode-color); /* Use variable for light mode */
    margin-bottom: 25px;
    text-align: left; /* Align title left */
    padding-left: 8px; /* Slight padding to match scroll container start */
    transition: color 0.3s ease; /* Smooth transition for color change */
}

.product-scroll-container {
    overflow-x: auto; /* Allows horizontal scrolling */
    padding-bottom: 15px; /* Space for scrollbar */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: var(--primary-blue) var(--border-color); /* Firefox */
}

.product-scroll-container::-webkit-scrollbar {
    display: none;
}

.product-scroll-track {
    display: flex;
    gap: var(--horizontal-card-gap);
    padding: 5px; /* Padding for visual spacing around cards */
    /* Ensure content takes up minimum space to allow scrolling */
    width: fit-content;
}

.product-card-horizontal {
    flex: 0 0 var(--horizontal-card-width); /* Uses CSS variable for fixed width */
    flex-shrink: 0; /* Prevent cards from shrinking */
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;         /* Prevents zoomed content from overflowing */
    text-align: center;
    box-shadow: 0 2px 8px var(--shadow-light);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    white-space: normal; /* Allow text inside to wrap */
    min-width: var(--horizontal-card-width); /* Ensure minimum width */
    display: flex; /* Use flex for internal layout */
    flex-direction: column;
    justify-content: space-between; /* Push button to bottom */
}

.product-card-horizontal:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.product-card-horizontal img {
    max-width: 100%;
    width: 100%; /* Ensure full width within the card */
    height: 110px;
    object-fit: cover;
    margin-bottom: 0px;
    transition: transform 0.3s ease; /* Smooth zoom effect on hover */
}
.product-card-horizontal img:hover {
    transform: scale(1.1); /* Zoom in on hover */
    overflow: hidden;         /* Prevents zoomed content from overflowing */
    will-change: transform;   /* Optimizes animation performance */
    transition: transform 0.3s ease;
}

.product-card-horizontal .info {
    padding: 10px;
    text-align: left;
    flex-grow: 1; /* Allows content area to expand */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-card-horizontal a:hover h3 {
    color: var(--primary-blue);
    text-decoration: none;
}

.product-card-horizontal h3 {
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 5px;
    height: 2.4em; /* Limit to 2 lines */
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2em; /* Adjust line height for better spacing */
}

.product-card-horizontal .price {
    font-size: 1rem;
    font-weight: bold;
    color: var(--primary-blue);
    display: block;
    margin-top: 2px;
}

.product-card-horizontal .old-price {
    text-decoration: line-through;
    color: var(--text-secondary);
    font-weight: normal;
    margin-left: 5px;
    font-size: 0.7em;
}
.product-card-horizontal .add-to-cart-form {
    align-self: center;
}

.product-card-horizontal .add-to-cart-btn {
    background-color: var(--primary-blue);
    color: white;
    border: none;
    padding: 6px 18px;
    border-radius: 40px;
    cursor: pointer;
    font-size: 0.8rem;
    margin-top: 3px;
    transition: background-color 0.3s ease;
}

.product-card-horizontal .add-to-cart-btn:hover {
    background-color: var(--text-secondary);
}

/* --- Product Grid (All Products) --- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    max-width: 100%;
    margin: 0 auto;
}

.product-card {
    flex: 0 0 var(--horizontal-card-width); /* Uses CSS variable for fixed width */
    flex-shrink: 0; /* Prevent cards from shrinking */
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    overflow: hidden;         /* Prevents zoomed content from overflowing */
    box-shadow: 0 2px 8px var(--shadow-light);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    white-space: normal; /* Allow text inside to wrap */
    min-width: var(--horizontal-card-width); /* Ensure minimum width */
    display: flex; /* Use flex for internal layout */
    flex-direction: column;
    justify-content: space-between; /* Push button to bottom */
}
.product-card-link {
    display: block; /* Ensures the link takes up the full space of its content */
    text-decoration: none;
    color: inherit;
    flex-grow: 1; /* Allows the link to fill the available space in the flex container */
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.product-card img {
    max-width: 100%;
    width: 100%; /* Ensure full width within the card */
    height: 125px;
    object-fit: cover;
    margin-bottom: 3px;
    transition: transform 0.3s ease; /* Smooth zoom effect on hover */
}
.product-card img:hover {
    transform: scale(1.1); /* Zoom in on hover */
    overflow: hidden;         /* Prevents zoomed content from overflowing */
    will-change: transform;   /* Optimizes animation performance */
    transition: transform 0.3s ease;
}
.product-card a:hover h3 {
    color: var(--primary-blue);
    text-decoration: none;
}
.product-card .info {
    padding: 10px;
    text-align: left;
    flex-grow: 1; /* Allows content area to expand */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-card h3 {
    font-size: 0.85rem;
    margin-bottom: 2px;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.product-card .price {
    font-size: 1rem;
    font-weight: bold;
    color: var(--primary-blue);
    display: block;
    margin-top: 2px;
}

.product-card .old-price {
    text-decoration: line-through;
    color: var(--text-secondary);
    font-weight: normal;
    margin-left: 8px;
    font-size: 0.7em;
}
.product-card .add-to-cart-form {
    align-self: center;
}

.product-card .add-to-cart-btn {
    background-color: var(--primary-blue);
    color: white;
    border: none;
    padding: 6px 18px;
    border-radius: 40px;
    text-align: center;
    cursor: pointer;
    font-size: 0.8rem;
    margin-top: 3px;
    transition: background-color 0.3s ease;
}

.product-card .add-to-cart-btn:hover {
    background-color: var(--text-secondary);
}

/* --- Product Detail Page (product_detail.php) --- */
.product-detail-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    box-shadow: 0 2px 10px var(--shadow-light);
}

.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.product-image-area img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.product-short-description {
    font-size: 1.1em;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.product-rating {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.product-rating .star-rating {
    font-size: 1.1em; /* Make stars slightly larger */
}

.review-count {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.product-price {
    font-size: 2.2rem; /* Make price stand out */
    font-weight: bold;
    color: var(--primary-blue);
    margin-bottom: 15px;
    display: flex;
    align-items: baseline;
}

.product-price .old-price {
    text-decoration: line-through;
    color: var(--text-secondary);
    font-size: 1.4rem; /* Adjusted for better hierarchy with new price */
    font-weight: normal;
    margin-left: 15px;
}

.product-description h3 {
    margin-top: 30px;
    margin-bottom: 10px;
    color: var(--heading-light-mode-color);
    font-size: 1.4rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

.product-description p {
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 20px;
}

.product-actions {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    gap: 15px;
    margin-top: 20px;
    align-items: center;
}

.product-actions .add-to-cart-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.product-actions label {
    color: var(--text-primary);
    white-space: nowrap; /* Prevent "Quantity:" from wrapping */
}

.product-actions .quantity-input {
    width: 80px; /* Slightly wider input */
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    text-align: center;
    font-size: 1rem;
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

.btn {
    border: none;
    padding: 12px 25px; /* Slightly larger buttons */
    border-radius: 30px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease, transform 0.1s ease;
    white-space: nowrap; /* Prevent button text from wrapping */
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: var(--disabled-color); /* Add a disabled color variable */
}

.add-to-cart-btn {
    background-color: var(--primary-blue);
    color: white;
}
.add-to-cart-btn:hover {
    background-color: var(--primary-blue-hover); /* Darker red on hover */
}

.add-to-wishlist-btn {
    background-color: var(--text-secondary);
    color: white;
}
.add-to-wishlist-btn:hover {
    background-color: var(--text-secondary-hover); /* Darker gray on hover */
}

.stock-info {
    margin-top: 20px;
    font-size: 0.95rem;
    font-weight: bold;
}

.stock-info .in-stock {
    color: var(--success-color); /* Green for in stock */
}

.stock-info .out-of-stock {
    color: var(--error-color); /* Red for out of stock */
}

.product-meta {
    margin-top: 30px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    color: var(--text-primary);
}

.product-meta p {
    margin-bottom: 8px;
}

.product-meta strong {
    color: var(--heading-light-mode-color);
}

.link-primary {
    color: var(--primary-blue);
    text-decoration: none;
    transition: color 0.2s ease;
}
.link-primary:hover {
    text-decoration: underline;
    color: var(--primary-blue-hover);
}

/* Reviews Section */
.product-reviews-section {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 2px solid var(--border-color);
}

.product-reviews-section .section-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 600; /* Example of a good weight for a title */
    color: var(--heading-light-mode-color);
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.6em;
}

.reviews-list {
    max-width: 800px; /* Constrain width for readability */
    margin: 0 auto;
}

.review-item {
    background-color: var(--bg-primary);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 1px 5px var(--shadow-light);
}

.review-item .review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.95em;
}

.review-item .review-author {
    font-weight: bold;
    color: var(--text-primary);
}

.review-item .review-date {
    color: var(--text-secondary);
}

.review-item .review-rating {
    margin-bottom: 10px;
}

.review-item .review-comment {
    color: var(--text-primary);
    line-height: 1.5;
    font-size: 0.95em;
}

.no-reviews-message {
    text-align: center;
    color: var(--text-secondary);
    padding: 20px;
}

.write-review-btn {
    display: block;
    margin: 30px auto 0;
    background-color: var(--secondary-lemon-green);
    color: var(--text-primary); /* Assuming text-primary is dark for light mode */
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
}
.write-review-btn:hover {
    background-color: var(--secondary-lemon-green-hover);
}

/* SLIDER MEDIA QUERIES */
/* For Tablets (and smaller desktops) */
@media (max-width: 992px) {
    .slide {
        flex: 0 0 calc((100% - (2 * var(--slide-gap))) / 3); /* Show 3 slides */
        transform: scale(0.8); /* Scale down non-active slides */
        opacity: 0.7; /* Fade non-active slides */
    }

    .slide.active {
        transform: scale(var(--active-scale)); /* Active scale remains larger */
        opacity: 1;
    }

    .slide img {
        height: 280px; /* Adjust height for tablets */
    }

    .slide-caption {
        opacity: 0; /* Captions only on active slide */
    }
}

/* For Mobile Phones */
@media (max-width: 576px) {
    .main-header {
        padding: 2px;
    }
    .main-content, .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    .slide {
        flex: 0 0 80%; /* Show 1 slide at a time */
        transform: scale(0.9); /* Slightly larger non-active slides */
        opacity: 0.8; /* Slightly more visible non-active slides */
    }
    .shop-now-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    .slider-controls {
        display: none; /* Hide controls on mobile */
    }

    .slider-btn {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }

    .slider-dots {
        bottom: 10px;
    }

    .dot {
        width: 8px;
        height: 8px;
    }
}
@media (prefers-reduced-motion: reduce) {
    .slider-track, .slide {
    /* Disable animations */
    transition: none;
}
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .product-short-description, .product-description p {
        font-size: 1em;
    }

    .product-price {
        justify-content: center; /* Center price on mobile */
    }

    .product-actions {
        flex-direction: column; /* Stack buttons */
        align-items: center;
    }

    .product-actions .add-to-cart-form {
        flex-direction: column;
        gap: 10px;
        width: 100%; /* Take full width */
    }

    .product-actions label, .product-actions .quantity-input, .product-actions .btn {
        width: 100%; /* Full width for input and buttons */
        text-align: center;
    }

    .stock-info, .product-meta {
        text-align: center;
    }

    .product-reviews-section .section-title {
        font-family: 'Poppins', sans-serif;
        font-weight: 600; /* Example of a good weight for a title */
        font-size: 1.5em;
    }
}

/* --- Shopping Cart Page (cart.php) --- */
.cart-items .cart-item {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.cart-items .cart-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.cart-item img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 5px;
    margin-right: 20px;
}

.cart-item h3 {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.cart-item p {
    font-size: 0.95rem;
}

.cart-item form {
    display: inline-block;
    margin-right: 15px; /* Space between forms */
}

.cart-item input[type="number"] {
    width: 60px;
    padding: 5px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    text-align: center;
}

.cart-item button[type="submit"] {
    border: none;
    padding: 6px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.cart-item button[type="submit"]:first-of-type { /* Update button */
    background-color: var(--secondary-lemon-green);
    color: var(--text-primary);
}
.cart-item button[type="submit"]:first-of-type:hover {
    background-color: #9ecc6a;
}

.cart-item button[type="submit"]:last-of-type { /* Remove button */
    background-color: var(--light-red);
    color: white;
}
.cart-item button[type="submit"]:last-of-type:hover {
    background-color: var(--dark-red);
}


.cart-summary {
    text-align: right;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
}

.cart-summary h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.cart-summary a.checkout-btn {
    display: inline-block;
    background-color: var(--primary-blue);
    color: white;
    padding: 12px 25px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 1.1rem;
    margin-top: 20px;
    transition: background-color 0.3s ease;
}
.cart-summary a.checkout-btn:hover {
    background-color: var(--dark-red);
    text-decoration: none;
}


/* --- Checkout Page (checkout.php) --- */
.checkout-container {
    padding: 40px;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    box-shadow: 0 2px 10px var(--shadow-light);
}
.checkout-summary table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background-color: var(--bg-primary);
    border-radius: 5px;
    overflow: hidden; /* For rounded corners with borders */
}

.checkout-summary th,
.checkout-summary td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
.checkout-summary th {
    background-color: var(--hover-bg);
    font-weight: bold;
}
.checkout-summary td:last-child,
.checkout-summary th:last-child {
    text-align: right; /* For price/subtotal columns */
}
.checkout-summary tfoot td {
    border-top: 2px solid var(--border-color);
    font-weight: bold;
}

/* Forms general styling */
form label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: var(--text-primary);
}

form input[type="text"],
form input[type="email"],
form input[type="password"],
form input[type="number"],
form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

form input[type="text"]:focus,
form input[type="email"]:focus,
form input[type="password"]:focus,
form input[type="number"]:focus,
form textarea:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(220, 20, 60, 0.2);
}

form button[type="submit"] {
    background-color: var(--primary-blue);
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

form button[type="submit"]:hover {
    background-color: var(--dark-red);
}

/* Specific radio buttons */
input[type="radio"] {
    width: auto;
    margin-right: 10px;
}
.payment-method-section label {
    font-weight: normal; /* Override bold for radio labels */
}


/* --- Footer --- */
.rotarylog-footer {
    background-color: var(--footer-bg-dark);
    color: var(--footer-text-light);
    font-size: 0.85rem;
    line-height: 1.5;
    text-align: center;
    position: relative;
}

.back-to-top {
    display: block;
    background-color: var(--back-to-top-bg);
    color: white;
    text-align: center;
    padding: 15px 0;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.back-to-top:hover {
    background-color: var(--back-to-top-hover-bg);
    text-decoration: none;
}

.footer-links-area {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-col h3 {
    color: var(--footer-heading-light);
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul li a {
    color: var(--footer-text-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-col ul li a:hover {
    color: var(--footer-link-hover);
    text-decoration: none;
}

.footer-base {
    padding: 20px 0;
    background-color: var(--footer-bg-dark); /* Should be consistent with parent */
}

.footer-base-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-wrap: wrap; /* Allow wrapping */
    justify-content: center;
    align-items: center;
    gap: 20px 40px;
    padding-bottom: 20px;
}

.footer-base .logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
}

.footer-base .logo .logo-red {
    color: var(--primary-blue);
}

.language-selector {
    display: flex;
    align-items: center;
    gap: 5px;
    border: 1px solid var(--footer-text-light);
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
}

.language-selector i {
    font-size: 1rem;
}

.social-links a {
    color: white;
    font-size: 1.2rem;
    margin: 0 10px;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--primary-blue);
}

.footer-legal {
    display: flex;
    flex-direction: column;
    text-align: center;
    justify-content: center;
    align-items: center;
    padding: 10px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-legal a {
    color: var(--footer-text-light);
    text-align: center;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-legal a:hover {
    color: var(--footer-link-hover);
    text-decoration: none;
}

.footer-legal span {
    color: var(--footer-text-light);
    font-size: 0.8rem;
}


/* --- Search Overlay --- */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 10px;
    background-color: var(--search-overlay-bg); /* Controlled by config.php */
    backdrop-filter: blur(var(--search-overlay-blur)); /* Controlled by config.php */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.close-search-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10001;
    transition: color 0.3s ease;
}

.close-search-btn:hover {
    color: var(--primary-blue);
}

.search-input-wrapper {
    display: flex;
    width: 90%;
    max-width: 600px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.search-overlay-input {
    flex-grow: 1;
    padding: 15px;
    border: none;
    font-size: 1.2rem;
    outline: none;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.search-overlay-submit-btn {
    background-color: var(--primary-blue);
    color: white;
    border: none;
    padding: 15px 25px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-overlay-submit-btn:hover {
    background-color: var(--dark-red);
}

.search-suggestions {
    position: relative;
    top: 30px;
    margin-top: 30px;
    align-items: center;
    text-align: center;
    color: var(--text-primary);
}

.search-suggestions p {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.search-suggestions ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    padding: 0;
    justify-content: center;
    gap: 10px;
}

.search-suggestions ul li a {
    display: block;
    background-color: var(--hover-bg);
    padding: 8px 15px;
    border-radius: 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.search-suggestions ul li a:hover {
    background-color: var(--primary-blue);
    color: white;
    text-decoration: none;
}

/* --- Mobile Bottom Navigation --- */
.mobile-bottom-nav {
    display: none; /* Hidden by default, shown on mobile */
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--bg-secondary);
    box-shadow: 0 -2px 10px var(--shadow-light);
    border-top: 1px solid var(--border-color);
    z-index: 10000;
    justify-content: space-around;
    align-items: center;
    padding: 2px; /* Vertical padding */
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.mobile-bottom-nav .cart-item {
    position: relative; /* Anchor for the cart count */
}

.mobile-bottom-nav .cart-count {
    position: absolute;
    top: 2px;
    right: 5px;
    font-size: 0.65rem;
    padding: 2px 5px;
    line-height: 1;
}


.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.8rem;
    gap: 4px;
    transition: color 0.3s ease;
    padding: 3px;
}

.mobile-nav-item i {
    font-size: 1.2rem;
    transition: color 0.3s ease;
}
.mobile-nav-item span {
    text-decoration: none;
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
    color: var(--primary-blue);
}

.mobile-nav-item.active i {
    color: var(--primary-blue);
}

/* --- Vendors Dashboard (Minimal Styling) --- */
/* Vendor specific styles (can go into a separate admin.css or at the top of this file) */
.vendor-dashboard-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    box-shadow: 0 4px 15px var(--shadow-light);
    color: var(--text-primary);
}
.venor-dashboard-container h1 {
    font-size: 2.5rem;
    color: var(--heading-light-mode-color);
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.vendor-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}
.vendor-nav a {
    background-color: var(--primary-blue);
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.vendor-nav a:hover,
.vendor-nav a.active {
    background-color: var(--dark-red);
}
.vendor-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}
.stat-card {
    background-color: var(--hover-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 2px 8px var(--shadow-light);
    transition: transform 0.3s ease;
}
.stat-card:hover {
    transform: translateY(-5px);
}
.stat-card h3 {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}
.stat-card .value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-blue);
}

body.dark-mode .vendor-dashboard-container h1 {
    color: var(--heading-dark-mode-color);
}
body.dark-mode .stat-card {
    background-color: var(--bg-primary);
}

.vendor-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.vendor-table th,
.vendor-table td {
    border: 1px solid var(--border-color);
    padding: 10px;
    text-align: left;
}

.vendor-table th {
    background-color: var(--hover-bg);
}

.vendor-actions a, .vendor-actions button {
    background-color: var(--primary-blue);
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    text-decoration: none;
    margin-right: 5px;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.vendor-actions button.delete {
    background-color: var(--light-red);
}
.vendor-actions a:hover, .vendor-actions button:hover {
    background-color: var(--dark-red);
}
.vendor-actions button.delete:hover {
    background-color: var(--dark-red);
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    .main-nav, .header-actions .user-icon-top .cart-icon-top {
        display: none; /* Hide main nav and desktop user icon on smaller screens */
    }
    body {
        padding-bottom: 50px; /* Adjust based on mobile-bottom-nav height */
    }

    .header-content {
        padding: 0 15px;
    }

    .header-actions {
        gap: 10px;
    }

    .main-header {
        padding: 10px 0;
    }

    .category-nav {
        padding: 8px 0;
    }

    .category-list {
        justify-content: flex-start; /* Align categories to start, allow scroll */
        overflow-x: auto;
        white-space: nowrap;
        padding: 0 15px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Hide scrollbar for Firefox */
    }
    .category-list::-webkit-scrollbar {
        display: none; /* Hide scrollbar for Webkit */
    }


    .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 10px;
        padding: 0 10px;
    }

    .hero-slider {
        margin: 10px 0;
        height: 300px; /* Adjust height for smaller screens */
    }
    .slider-container {
        width: 100%;
        padding: 10px 0;
    }
    .slide {
        flex: 0 0 calc((100% - (2 * var(--slide-gap))) / 3); /* Show 3 images on medium screens */
    }
    .slide.active {
        transform: scale(var(--active-scale));
    }
    .slide img {
        height: 300px;
    }

    .slider-dots {
        bottom: 15px; /* Adjust dot position for smaller screens */
    }
    .slide-caption h2 {
        font-size: 1.8rem;
    }
    .slide-caption p {
        font-size: 1rem;
    }
    .shop-now-btn {
        padding: 10px 20px;
        font-size: 1rem;
    }

    .product-detail-grid {
        grid-template-columns: 1fr; /* Stack on mobile */
        gap: 20px;
    }
    .product-price {
        font-size: 1.5rem;
    }
    .product-actions {
        flex-direction: column; /* Stack buttons vertically */
    }
    .product-actions form, .product-actions button {
        width: 100%;
    }


    .footer-links-area {
        grid-template-columns: 1fr; /* Stack footer columns */
        text-align: center;
    }

    .footer-col ul {
        padding-left: 0;
    }
    .footer-col ul li {
        margin-bottom: 5px;
    }

    .footer-base-content {
        flex-direction: column;
        gap: 15px;
    }
    .footer-legal ul {
        flex-direction: column;
        gap: 5px;
    }

    .mobile-bottom-nav {
        display: flex; /* Show mobile nav */
    }

    /* Hide desktop search icon, show mobile one for consistent UX */
    .search-icon-top {
        display: none !important;
    }
    .search-icon-mobile {
        display: flex !important; /* Ensure it's visible */
        border: none;
        background: none;
    }
}
@media (max-width: 320px) {
    .main-content, .container {
        padding-left: 5px;
        padding-right: 5px;
    }
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .logo a {
        font-size: 1.2rem;
    }
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    .category-list {
        padding: 0 10px;
    }
    .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 5px;
        padding: 0 5px;
    }
    
}

@media (max-width: 480px) {
    .main-content, .container {
        padding-left: 5px;
        padding-right: 5px;
        padding: 5px;
        margin-top: 0;
    }
    .header-content {
        flex-direction: row;
        justify-content: space-between;
    }
    .logo a {
        font-size: 1.5rem;
    }
    .hero-slider {
        width: 100%;
        height: 240px;
        margin-bottom: 5px;
    }
    .slider-container {
        width: 100%;
        padding: 5px 0;
    }
    .slide img {
        height: 250px;
    }
    .slide-caption h2 {
        font-size: 1.1rem;
    }
    .slide-caption p {
        font-size: 0.75rem;
    }
    .shop-now-btn {
        padding: 8px 15px;
        font-size: 0.6rem;
    }
    .horizontal-scroll-section {
        margin: 10px 0;
    }
    .horizontal-scroll-section .section-title {
        font-size: 1.2rem;
        margin-bottom: 8px;
    }
    .product-carousel-section .section-title {
        font-size: 1.2rem;
        margin-bottom: 8px;
    }
    .product-carousel-section .carousel-controls {
        left: 3px;
        right: 3px;
    }
    .product-carousel-section .carousel-track {
        gap: 8px;
    }
    .product-card-horizontal {
        flex: 0 0 100px; /* Show 3 cards */
        border-radius: 6px;
    }
    .product-card-horizontal a {
        text-decoration: none;
    }
    .product-card-horizontal img {
        height: 100px; /* Adjust image height for mobile horizontal scroll */
    }
    .product-card-horizontal .info {
        padding: 6px;
    }
    .product-card-horizontal .price-container {
        margin: 4px 0;
        padding: 0;
    }
    .product-card-horizontal .add-to-cart-btn {
        height: 35px;
        width: 100%;
        padding: 10px 14px;
        font-size: 0.7rem;
        align-content: center;
    }
    .product-detail-container {
        margin: auto;
        padding: 5px;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 5px;
        padding: 0 5px;
    }

    .all-products-section {
        padding: 5px 0;
    }
    .all-products-section .section-title {
        font-size: 1.5rem;
        margin-bottom: 10px;
    }
    .product-card {
        border-radius: 5px;
    }

    .product-card img {
        height: 150px; /* Adjust image height for mobile grid */
    }

    .product-card img, .product-card-horizontal img {
        height: auto; /* Let the aspect ratio define the height */
        aspect-ratio: 1 / 1; /* Create a perfect square for consistency */
        object-fit: cover;
    }
    .product-card .info {
        padding: 8px;
    }
    .product-card .add-to-cart-btn {
        height: 35px;
        width: 100%;
        padding: 10px 14px;
        font-size: 0.7rem;
        align-content: center;
    }

    /* Refined font sizes for better readability */
    .product-card h3, .product-card-horizontal h3 {
        font-size: 0.8rem; /* Smaller to prevent awkward wrapping */
        line-height: 1.2;
        height: 2.4em; /* Explicitly set height for 2 lines of text */
        margin-bottom: 4px;
    }

    .product-card .price, .product-card-horizontal .price {
        font-size: 1rem; /* Make price prominent but not oversized */
        font-weight: 700;
    }
    /* Adjust the star rating size */
    .product-card .star-rating, .product-card-horizontal .star-rating {
        font-size: 0.7rem;
    }

    .search-input-wrapper {
        width: 95%;
    }
    .search-overlay-input {
        padding: 10px;
        font-size: 1rem;
    }
    .search-overlay-submit-btn {
        padding: 10px 15px;
        font-size: 1rem;
    }
}

/* --- Mobile Optimizations (applies to screens up to 768px wide) --- */
@media (max-width: 768px) {
    /* Hide desktop navigation */
    .main-nav {
        display: none;
    }

    /* Hide desktop auth/cart links */
    .auth-cart-actions {
        display: none;
    }

    /* Change header layout for mobile */
    .header-content {
        justify-content: space-between;
        gap: 0;
    }

    /* Show mobile navigation button (assuming you have one in your mobile_nav.php) */
    .mobile-menu-toggle {
        display: block;
    }
}

.desktop-login-menu {
    display: flex;
    align-items: center;
    gap: 10px;
}

.desktop-login-menu .user-icon-top {
    position: relative;
    padding: 0 10px; /* Adjust padding for better spacing */
    transition: all 0.3s ease;
}
/* The active state, toggled by JavaScript */
.user-menu .user-dropdown.active {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.auth-text {
    white-space: nowrap;
    overflow: hidden;
    max-width: 0;
    transition: max-width 0.3s ease-in-out, opacity 0.3s ease-in-out;
    opacity: 0;
    margin-left: 5px;
    font-size: 0.9em;
}

.auth-text-default {
    max-width: 100px; /* Set a default width */
    opacity: 1;
}

.desktop-login-menu:hover .auth-text-default,
.desktop-login-menu:hover .auth-text-default + .auth-text-hover {
    max-width: 0;
    opacity: 0;
}

.desktop-login-menu:hover .auth-text-hover {
    max-width: 100px; /* Expand on hover */
    opacity: 1;
}

.login-register-links {
    display: flex;
    align-items: center;
    gap: 8px; /* Space between the links */
    font-weight: bold;
    font-size: 0.9em;
    padding: 0 5px;
}

.login-register-links a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.login-register-links a:hover {
    color: var(--primary-blue);
}

.link-divider {
    color: var(--text-secondary);
}

/* Ensure the header actions are all properly aligned */
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* You might need to adjust this if your previous code was different */
.auth-cart-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .auth-cart-actions, .main-nav {
        display: none;
    }
}
.flash-messages-container {
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    background: #fff;
    border-radius: 6px;
    padding: 10px;
}
.flash-message-item {
    margin-bottom: 10px;
    padding: 10px 20px 10px 10px;
    background: #f0f4f8;
    border-left: 4px solid #007bff;
    border-radius: 4px;
    position: relative;
}
.close-btn {
    font-size: 18px;
    color: #888;
}

/* --- User Menu Dropdown --- */
/* The main container. It ONLY serves as a positioning anchor. */
.auth-cart-actions .user-menu {
    position: relative;
    line-height: 1; /* Prevents extra vertical space */
}

/* The dropdown panel itself. Positioned absolutely relative to .user-menu */
.user-menu .user-dropdown {
    display: none; /* Hide by default */
    position: absolute;
    top: calc(100% + 12px); /* Position it below the icon */
    right: 0;
    width: 220px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    z-index: 2000; /* High z-index to appear on top of everything */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

/* The active state, toggled by JavaScript */
.user-menu .user-dropdown.active {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Styling for the header part of the dropdown */
.user-dropdown .dropdown-header {
    padding: 12px 15px;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    font-size: 0.9rem;
}

/*  Reset the <ul> element to remove default browser/framework styling */
.user-dropdown .dropdown-link-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 5px 0 !important; /* Add some vertical padding inside the list */
}

.user-dropdown .dropdown-link-list li {
    margin: 0 !important;
    padding: 0 !important;
}

/* Style both links and the button to look and act identically */
.user-dropdown .dropdown-item,
.user-dropdown .dropdown-item-button {
    /* Behavior */
    display: flex;
    align-items: center;
    width: 100%;
    text-align: left;
    cursor: pointer;

    /* Reset button/link styles aggressively */
    background: transparent;
    border: none;
    font-family: inherit;
    /* Appearance */
    gap: 12px;
    padding: 10px 15px;
    font-size: 0.95rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

/*  Shared hover state */
.user-dropdown .dropdown-item:hover,
.user-dropdown .dropdown-item-button:hover {
    background-color: var(--hover-bg);
    color: var(--primary-blue);
    text-decoration: none;
}

/* Ensure the form wrapper has no styles */
.user-dropdown .dropdown-item-form {
    margin: 0;
    padding: 0;
    display: block;
}

/* --- Search Results Page (search.php) --- */
.search-loading-spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-blue);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}
.search-loading-spinner .spinner {
    display: none; /* Hidden by default */
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.search-results-container {
    padding-top: 30px;
    padding-bottom: 50px;
}

.search-results-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.search-results-header h1 {
    font-size: 2.2rem;
    color: var(--heading-light-mode-color);
    margin-bottom: 10px;
    word-wrap: break-word; /* Handle long search queries */
}

.search-results-header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.no-results-message {
    text-align: center;
    padding: 60px 20px;
    background-color: var(--bg-primary);
    border-radius: 8px;
    margin-top: 20px;
}

.no-results-message h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: var(--heading-light-mode-color);
}

.no-results-message p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.no-results-message .btn {
    display: inline-block;
    background-color: var(--primary-blue);
    color: white;
    padding: 12px 25px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.no-results-message .btn:hover {
    background-color: var(--dark-red);
    text-decoration: none;
    color: white;
}
.ajax-search-results-container {
    width: 90%;
    max-width: 600px;
    background-color: var(--bg-secondary);
    border-radius: 0 0 15px 15px;
    margin-top: -10px;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
.ajax-result-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-primary);
    transition: background-color 0.2s ease;
}
.ajax-result-item:hover {
    background-color: var(--hover-bg);
}
.ajax-result-item:last-child {
    border-bottom: none;
}
.ajax-result-item img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    margin-right: 15px;
    border-radius: 5px;
}
.ajax-result-info h4 {
    margin: 0;
    font-size: 1rem;
}
.ajax-result-info .price {
    font-size: 0.9rem;
    color: var(--primary-blue);
    font-weight: bold;
}
/* --- New Styles for Restructured Product Detail Page --- */

.main-image-container {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px var(--shadow-light);
}
.main-image-container img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
}

.main-product-image {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.main-product-image:hover {
    transform: scale(1.05);
}

.thumbnail-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
}

.thumbnail-item {
    border: 2px solid transparent;
    border-radius: 5px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.thumbnail-item img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}

.thumbnail-item:hover {
    transform: scale(1.05);
    border-color: var(--text-secondary);
}

.thumbnail-item.active {
    border-color: var(--primary-blue);
    box-shadow: 0 0 8px var(--primary-blue);
}

/* Restyled Info Area */
.product-info-area {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.product-header .vendor-link {
    font-size: 0.9rem;
    color: var(--primary-blue);
    font-weight: 500;
    text-decoration: none;
    margin-bottom: 0.5rem;
    display: inline-block;
}
.product-header .vendor-link:hover {
    text-decoration: none;
}

.info-divider {
    border: 0;
    height: 1px;
    background-color: var(--border-color);
    margin: 0;
}

.product-purchase-section .add-to-cart-btn {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: bold;
}
.product-purchase-section .add-to-cart-btn i {
    margin-right: 8px;
}

.stock-info .low-stock {
    color: #ff9800; /* Orange for low stock */
    font-weight: bold;
}

/* Trust Signals Section */
.product-trust-signals {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.signal-item {
    display: flex;
    align-items: center;
    gap: 15px;
}
.signal-item i {
    font-size: 1.5rem;
    color: var(--primary-blue);
    width: 30px;
    text-align: center;
}
.signal-item strong {
    display: block;
    font-size: 0.95rem;
}
.signal-item p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}


/* Social Sharing */
.social-share {
    margin-top: 1rem;
}
.social-share strong {
    margin-right: 10px;
}
.social-share .social-icons {
    display: inline-flex;
    gap: 10px;
    vertical-align: middle;
}
.social-share .social-icon {
    font-size: 1.2rem;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}
.social-share .social-icon:hover {
    color: var(--primary-blue);
}

/* Full Details Section */
.product-full-details {
    grid-column: 1 / -1; /* Span full width of the grid */
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}
.related-products-section {
    grid-column: 1 / -1;
}

/* --- Responsive Media Queries for New Product Page --- */
@media (max-width: 768px) {
    .thumbnail-gallery {
        /* Change to a horizontally scrollable strip on mobile */
        display: flex;
        overflow-x: auto;
        padding-bottom: 10px;
        scrollbar-width: none; /* Hide scrollbar for Firefox */
    }
    .thumbnail-gallery::-webkit-scrollbar {
        display: none; /* Hide scrollbar for Webkit */
    }

    .thumbnail-item {
        flex: 0 0 70px; /* Fixed width for each thumbnail */
    }
}

/* --- Wishlist Button --- */
.wishlist-btn {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 12px;
    font-size: 1.2rem;
    line-height: 1;
}
.wishlist-btn i {
    color: var(--text-secondary);
}
.wishlist-btn.active {
    background-color: #ffdde0;
    color: #d9534f;
    border-color: #d9534f;
}

/* --- Product Tabs & Reviews --- */
.product-tabs-container {
    grid-column: 1 / -1;
    margin-top: 1rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1rem;
}
.tab-link {
    padding: 10px 20px;
    cursor: pointer;
    background: none;
    border: none;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}
.tab-link.active {
    color: var(--primary-blue);
    border-color: var(--primary-blue);
}
.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
    padding: 0.5rem;
}

/* Review Form & List */
.review-form-container {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}
.star-rating-input {
    display: inline-flex;
    flex-direction: row-reverse;
}
.star-rating-input input { display: none; }
.star-rating-input label {
    font-size: 2rem;
    color: #ccc;
    cursor: pointer;
    transition: color 0.2s;
}
.star-rating-input input:checked ~ label,
.star-rating-input label:hover,
.star-rating-input label:hover ~ label {
    color: var(--star-color);
}
.reviews-list .review-item {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
}
.reviews-list .review-item:last-child {
    border-bottom: none;
}
.review-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}
.review-author { font-weight: bold; }

/* Live Search (ajax_search.php) */
.ajax-result-item .ajax-result-icon {
    width: 50px;
    flex-shrink: 0;
    text-align: center;
    font-size: 1.5rem;
    color: var(--primary-blue);
    margin-right: 15px;
}
.ajax-result-info .category-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Main Search Page (search.php) */
.category-results-section {
    margin-bottom: 40px;
    padding: 20px;
    background-color: var(--bg-primary);
    border-radius: 8px;
}
.category-results-section h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--heading-light-mode-color);
}
.category-results-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}
.category-result-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: var(--bg-secondary);
    padding: 10px 20px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}
.category-result-card:hover {
    background-color: var(--primary-blue);
    color: #fff;
    border-color: var(--primary-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px var(--shadow-light);
}
.category-result-card i {
    color: var(--primary-blue);
    transition: color 0.2s ease;
}
.category-result-card:hover i {
    color: #fff;
}

/* Search Controls (Sorting Dropdown) */
.search-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
    padding: 0 10px;
}
.sort-form {
    display: flex;
    align-items: center;
    gap: 10px;
}
.sort-form label {
    font-weight: 500;
}
.sort-form select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
}

/* --- Enhanced Search Overlay --- */
.search-modal-content {
    width: 90%;
    max-width: 650px;
    position: relative; /* Anchor for the results container */
    top: 50px;
}

.search-overlay-input-wrapper {
    position: relative; /* Anchor for the spinner */
    display: flex;
    border-radius: 50px; /* Fully rounded search bar */
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border: 1px solid var(--border-color);
}

.search-overlay-form {
    display: flex;
    width: 100%;
}

.search-overlay-input {
    border-radius: 50px 0 0 50px;
    padding-left: 25px; /* More space for text */
}

.search-overlay-submit-btn {
    border-radius: 0 50px 50px 0;
}

.search-highlight {
    background-color: var(--primary-blue);
    color: white;
    border-radius: 2px;
    font-weight: bold;
}

.ajax-no-results {
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
}

.ajax-search-spinner {
    position: absolute;
    right: 70px; /* Position it before the button */
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

.ajax-search-results-container {
    position: absolute;
    top: calc(100% + 10px); /* Position below the search bar */
    left: 0;
    width: 100%;
    background-color: var(--bg-secondary);
    border-radius: 15px;
    max-height: 70vh; /* Limit height relative to viewport */
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: none; /* Hidden by default */
    border: 1px solid var(--border-color);
}

.ajax-result-group {
    padding: 10px;
}

.ajax-result-group-header {
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    color: var(--text-secondary);
    padding: 8px 15px;
    border-bottom: 1px solid var(--border-color);
}

.ajax-result-item {
    border-radius: 8px;
    margin: 5px 0;
}

.ajax-result-item:hover {
    background-color: var(--hover-bg);
}

.ajax-search-footer {
    padding: 15px;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.ajax-search-footer a {
    font-weight: bold;
    color: var(--primary-blue);
    text-decoration: none;
}

/* --- Vendor Page --- */
.vendor-page-container {
    padding-top: 40px;
    padding-bottom: 40px;
}
.vendor-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}
.vendor-header h1 {
    font-size: 2.5rem;
    color: var(--heading-light-mode-color);
}
.vendor-header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* --- Hierarchical Category Navigation --- */
.category-menu-item {
    position: relative; /* Anchor for the dropdown */
}

.category-menu-item .category-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    border-radius: 20px;
}

.category-dropdown-menu {
    display: none; /* Hidden by default */
    position: absolute;
    top: 100%; /* Position below the parent item */
    left: 0;
    z-index: 3001; /* Ensures dropdown is on top of the nav bar */
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 15px var(--shadow-light);
    list-style: none;
    padding: 10px 0;
    margin: 0;
    min-width: 200px;
}

.category-menu-item.open > .category-dropdown-menu {
    display: block;
    z-index: 5000;
}

/* Optional: Rotate the chevron icon when the menu is open */
.category-menu-item.open .dropdown-icon {
    transform: rotate(180deg);
    font-size: 0.6em;
    transition: transform 0.2s ease-in-out;
}

.category-dropdown-menu li a {
    display: block;
    padding: 8px 20px;
    color: var(--text-primary);
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.category-dropdown-menu li a:hover {
    background-color: var(--hover-bg);
    color: var(--primary-blue);
}

.cart-page-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    align-items: start;
    padding: 2rem 0;
}
.cart-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 20px;
}
.cart-items-list {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow-light);
    overflow: hidden;
}
.cart-item-card {
    display: grid;
    grid-template-columns: 100px 1fr auto;
    gap: 20px;
    padding: 20px;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}
.cart-item-card:last-child {
    border-bottom: none;
}
.cart-item-image img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 5px;
}
.cart-item-details .item-name {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    margin-bottom: 5px;
}
.cart-item-details .item-price-each {
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.remove-item-btn {
    background: none;
    border: none;
    color: var(--primary-blue);
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 10px;
    padding: 0;
}
.remove-item-btn i {
    margin-right: 5px;
}
.cart-item-actions {
    text-align: right;
}
.quantity-selector {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 5px;
}
.quantity-btn {
    background-color: var(--text-secondary);
    border: none;
    width: 30px;
    height: 30px;
    font-size: 1.2rem;
    cursor: pointer;
}
.quantity-input {
    width: 40px;
    height: 30px;
    text-align: center;
    border: none;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}
.item-subtotal {
    display: block;
    margin-top: 15px;
    font-weight: bold;
    font-size: 1.1rem;
}
.cart-summary-sidebar {
    position: sticky;
    top: 100px; /* Adjust based on your header height */
}
.cart-summary-box {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px var(--shadow-light);
}
.cart-summary-box h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}
.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}
.summary-row span {
    color: var(--text-primary);
}
.summary-price {
    font-weight: 600;
}
.total-row {
    font-size: 1.2rem;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    margin-top: 15px;
}
.total-price {
    color: var(--primary-blue);
}
.btn-checkout {
    display: block;
    width: 100%;
    text-align: center;
    text-decoration: none;
    background-color: var(--primary-blue);
    color: white;
    padding: 12px;
    border-radius: 5px;
    font-weight: 600;
    font-size: 1.1rem;
    margin-top: 20px;
}
.btn-checkout.disabled {
    background-color: #ccc;
    cursor: not-allowed;
}
.cart-empty-state {
    text-align: center;
    padding: 50px;
    background-color: var(--bg-secondary);
    border-radius: 8px;
}
.cart-empty-state i {
    font-size: 4rem;
    color: var(--border-color);
    margin-bottom: 20px;
}
.cart-empty-state h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}
.btn-start-shopping {
    display: inline-block;
    margin-top: 20px;
    background-color: var(--primary-blue);
    color: white;
    padding: 10px 25px;
    border-radius: 5px;
}

@media (max-width: 768px) {
    .cart-page-container {
        grid-template-columns: 1fr;
    }
    .cart-item-card {
        grid-template-columns: 80px 1fr;
        grid-template-rows: auto auto;
    }
    .cart-item-image {
        grid-row: 1 / 3;
    }
    .cart-item-actions {
        grid-column: 2 / 3;
        grid-row: 2 / 3;
        text-align: left;
        margin-top: 10px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .cart-summary-sidebar {
        position: static;
        margin-top: 30px;
    }
}

/* --- Product Detail Page Enhancement --- */
.delivery-info-box {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    background-color: var(--bg-primary);
}
.delivery-info-box .info-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}
.delivery-info-box .info-item:last-child {
    border-bottom: none;
}
.delivery-info-box .info-item i {
    font-size: 1.5rem;
    color: var(--primary-blue);
    width: 30px;
    text-align: center;
}
.delivery-info-box .info-item strong {
    display: block;
    font-size: 0.95rem;
}
.delivery-info-box .info-item span {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* --- Cookie Consent Popup --- */
.cookie-consent-popup {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    padding: 20px 30px;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.1);
    border-top: 1px solid var(--border-color);
    z-index: 11000; /* High z-index to appear above all content */
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    transform: translateY(0);
    transition: transform 0.5s ease-in-out;
}

/* This class hides the popup by moving it off-screen */
.cookie-consent-popup.hidden {
    transform: translateY(100%);
}

.cookie-content {
    max-width: 70%;
}

.cookie-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--heading-light-mode-color);
    margin-bottom: 5px;
}

body.dark-mode .cookie-title {
    color: var(--heading-dark-mode-color);
}

.cookie-text {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin: 0;
}

.cookie-text a {
    color: var(--primary-blue);
    text-decoration: underline;
    font-weight: 500;
}

.cookie-actions {
    display: flex;
    gap: 15px;
    flex-shrink: 0;
}

.cookie-actions .btn {
    border: none;
    padding: 10px 25px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

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

.cookie-actions .btn-primary:hover {
    background-color: var(--dark-red);
}

.cookie-actions .btn-secondary {
    background-color: var(--hover-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.cookie-actions .btn-secondary:hover {
    background-color: #e0e0e0; /* A slightly darker hover for the secondary button */
}

body.dark-mode .cookie-actions .btn-secondary:hover {
    background-color: #4a4a4a;
}


/* Responsive styles for mobile */
@media (max-width: 768px) {
    .cookie-consent-popup {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .cookie-content {
        max-width: 100%;
        margin-bottom: 15px;
    }

    .cookie-actions {
        width: 100%;
        justify-content: center;
    }
}

/* --- Product Review Form --- */
.review-form-container {
    background-color: var(--bg-primary);
    padding: 2rem;
    border-radius: 8px;
    margin-top: 2rem;
    border: 1px solid var(--border-color);
}

.review-form-container h3 {
    font-size: 1.5rem;
    color: var(--heading-light-mode-color);
    margin-bottom: 1.5rem;
    text-align: left;
    border-bottom: none;
    padding-bottom: 0;
}

.review-form-container .form-group {
    margin-bottom: 1.5rem;
}

.review-form-container .form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.review-form-container textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    min-height: 120px;
    resize: vertical;
}

.review-form-container textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.review-form-container .btn {
    background-color: var(--primary-blue);
    color: white;
    padding: 12px 25px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    border: none;
}

.review-form-container .btn:hover {
    background-color: var(--dark-blue);
}

/* Star Rating Input Enhancement */
.star-rating-input {
    display: inline-flex;
    flex-direction: row-reverse; /* This is key */
    align-items: center;
    justify-content: flex-end; /* Align to the left */
}
.star-rating-input input[type="radio"] {
    display: none;
}
.star-rating-input label {
    font-size: 2rem;
    color: #ccc;
    cursor: pointer;
    padding: 0 0.1em;
    transition: color 0.2s ease-in-out;
}
.star-rating-input label:hover,
.star-rating-input label:hover ~ label,
.star-rating-input input[type="radio"]:checked ~ label {
    color: var(--star-color);
}

.login-prompt {
    text-align: center;
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: var(--bg-primary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.no-reviews-message {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* --- Reusable Product Carousel --- */
.product-carousel-section {
    position: relative;
    max-width: 100%;
    padding: 1rem;
}

.carousel-viewport {
    overflow: hidden; /* This hides the scrollbar visually */
}

.carousel-track {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
    padding-bottom: 15px; /* Add space so shadow isn't cut off */
    margin-bottom: -15px; /* Counteract the padding */
}

.carousel-track::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome, Safari, Opera */
}

.carousel-track.dragging {
    scroll-behavior: auto; /* Disable smooth scroll while dragging */
    cursor: grabbing;
}
.carousel-track.dragging .product-card-horizontal {
    pointer-events: none; /* Prevent clicks while dragging */
}

.carousel-controls {
    position: absolute;
    top: 50%;
    left: -15px;
    right: -15px;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    pointer-events: none; /* Allow clicks to pass through */
    z-index: 10;
}

.carousel-controls button {
    display: flex; /* Changed from none */
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-primary);
    transition: all 0.2s ease;
    pointer-events: auto; /* Make buttons clickable */
    box-shadow: 0 2px 8px var(--shadow-light);
}

.carousel-controls button:hover {
    background-color: var(--primary-blue);
    color: white;
    transform: scale(1.1);
}

body.dark-mode .carousel-controls button {
    background-color: rgba(44, 44, 44, 0.9);
    color: var(--text-primary);
}

@media (min-width: 1024px) {
    .carousel-viewport {
        /* On larger screens, add padding to the right to show a glimpse of the next card */
        padding-right: 50px;
        margin-right: -50px;
    }
}

/* --- FRANCHISE PAGE STYLES --- */
.franchise-page-container {
    background-color: var(--bg-primary);
}

.franchise-hero {
    background: linear-gradient(45deg, var(--primary-blue), var(--dark-blue));
    color: #fff;
    text-align: center;
    padding: 100px 20px;
    border-bottom-left-radius: 50% 20%;
    border-bottom-right-radius: 50% 20%;
}

.franchise-hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.franchise-hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.franchise-hero p {
    font-size: 1.25rem;
    margin-bottom: 40px;
    line-height: 1.7;
    opacity: 0.9;
}

.btn-franchise-apply {
    background-color: #fff;
    color: var(--primary-blue);
    padding: 15px 40px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.btn-franchise-apply:hover {
    background-color: #f0f0f0;
    transform: translateY(-3px) scale(1.05);
    color: var(--dark-blue);
}

.franchise-about, .franchise-requirements {
    padding: 80px 0;
}

.franchise-page-container .section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
}

.text-center-align {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 50px auto;
    font-size: 1.1rem;
}

.franchise-benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.benefit-card {
    background-color: var(--bg-secondary);
    padding: 40px 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px var(--shadow-light);
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.benefit-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.12);
}

.benefit-card i {
    font-size: 2.5rem;
    color: #fff;
    margin-bottom: 25px;
    background: linear-gradient(45deg, var(--primary-blue), var(--light-blue));
    width: 70px;
    height: 70px;
    line-height: 70px;
    border-radius: 50%;
}

.benefit-card h3 {
    font-size: 1.4rem;
    margin-bottom: 15px;
}

.franchise-requirements {
    background-color: var(--hover-bg);
}

.requirements-list {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.requirement-item {
    display: flex;
    align-items: center;
    gap: 30px;
    background-color: var(--bg-secondary);
    padding: 25px;
    border-radius: 12px;
    border-left: 5px solid var(--primary-blue);
}

.req-icon {
    font-size: 2.2rem;
    color: var(--primary-blue);
    flex-shrink: 0;
}

.req-text h3 {
    font-size: 1.25rem;
    margin-bottom: 8px;
}

.franchise-cta {
    text-align: center;
    padding: 80px 20px;
    background-color: var(--dark-color);
    color: #fff;
}

.franchise-cta h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.franchise-cta p {
    margin-bottom: 30px;
    opacity: 0.8;
}

/* --- PICKUP POINT LOCATOR PAGE STYLES --- */
.pickup-locator-container {
    padding: 60px 0;
    background-color: var(--bg-primary);
}

.locator-header {
    text-align: center;
    margin-bottom: 50px;
}

.locator-header h1 {
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--heading-light-mode-color);
    margin-bottom: 15px;
}

.locator-header p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
}

.franchise-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.franchise-location-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 5px 20px var(--shadow-light);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.franchise-location-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.franchise-location-card h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.franchise-location-card p {
    margin: 0;
    color: var(--text-primary);
    line-height: 1.7;
    font-size: 0.95rem;
    display: flex;
    align-items: flex-start;
}

.franchise-location-card p i {
    margin-top: 4px;
    margin-right: 12px;
    color: var(--text-secondary);
    width: 20px;
    text-align: center;
}

.franchise-location-card .phone {
    margin-top: 15px;
}

.no-locations-message {
    text-align: center;
    padding: 60px 20px;
}

@media (max-width: 768px) {
    .franchise-hero h1 { font-size: 2.2rem; }
    .franchise-hero p { font-size: 1.1rem; }
    .franchise-page-container .section-title { font-size: 1.8rem; }
    .locator-header h1 { font-size: 2rem; }
}

#map {
    height: 380px;
    width: 100%;
    border-radius: 15px;
    margin-bottom: 35px;
}
@media (max-width: 480px) {
    #map {
        height: 200px;
    }
}

/* --- Checkout Page Enhancements --- */
.delivery-options {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.delivery-option-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.delivery-option-label:hover {
    border-color: var(--primary-blue);
    background-color: var(--hover-bg);
}

.delivery-option-label input[type="radio"]:checked + span {
    color: var(--primary-blue);
    font-weight: bold;
}

.delivery-option-label input[type="radio"] {
    display: none;
}

.checkout-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
}

.location-sorter {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.btn-find-near-me {
    background-color: var(--primary-blue);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s ease;
}
.btn-find-near-me:hover {
    background-color: var(--dark-blue);
}
.btn-find-near-me:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}
.location-status {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.confirmation-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-top: 20px;
}
.order-items-list {
    list-style: none; padding: 0;
}
.order-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}
.order-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    margin-right: 15px;
    border-radius: 5px;
}
.order-item-info {
    flex-grow: 1;
}
.delivery-details-box {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    height: fit-content;
}
/* Mobile responsiveness */
@media (max-width: 768px) {
    .confirmation-grid {
        grid-template-columns: 1fr;
    }
    .delivery-details-box {
        grid-row: 1; /* Show delivery info first on mobile */
    }
}

/* --- Product Detail Page: Video & Media UI Enhancements --- */

/* Main Video Player Styling */
.main-product-video {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1; /* Ensures a consistent square shape like the image */
    object-fit: cover;
    border-radius: 10px;
    background-color: #000; /* Black background for letterboxing */
    display: block;
}

/* Make the main image container a proper wrapper */
#image-wrapper {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px var(--shadow-light);
}

/* Remove default border from main image, as the wrapper now has it */
.main-product-image {
    border-radius: 0;
    box-shadow: none;
}

/* --- Enhanced Thumbnail Styles --- */
.thumbnail-item {
    position: relative; /* Needed for the overlay */
    border: 2px solid transparent;
    border-radius: 8px; /* Slightly more rounded */
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.thumbnail-item:hover {
    transform: scale(1.05);
    border-color: var(--text-secondary);
}

/* A more prominent active state for thumbnails */
.thumbnail-item.active {
    border-color: var(--primary-blue);
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.5);
}

/* Overlay for the video thumbnail */
.thumbnail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    color: #fff;
    opacity: 1;
    transition: opacity 0.2s ease;
    border-radius: 6px;
}

.thumbnail-item:hover .thumbnail-overlay {
    opacity: 0.8;
}

/* --- General UI/UX Improvements for Product Detail Page --- */
/* Group action buttons for a cleaner CTA area */
.product-actions {
    display: flex;
    gap: 10px;
    align-items: stretch; /* Make buttons the same height */
}

.product-actions .add-to-cart-form {
    flex-grow: 1; /* Allow the form to take up available space */
}

.product-actions .btn {
    width: 100%;
    height: 100%;
}

/* Better stock status visibility */
.stock-info {
    margin-top: 15px;
    font-weight: 500;
}
.stock-info .in-stock {
    color: #28a745;
}
.stock-info .out-of-stock {
    color: #dc3545;
}
.stock-info i {
    margin-right: 5px;
}
/* --- Policy Page Enhancements --- */

/* Style for the sticky navigation sidebar */
#policy-nav .nav-link {
    color: #555;
    padding: 0.3rem 1rem;
    border-left: 2px solid transparent;
}

#policy-nav .nav-link:hover {
    color: #000;
    background-color: #f8f9fa; /* A light grey for hover */
}

/* Active state for the navigation link */
#policy-nav .nav-link.active {
    color: #0d6efd; /* Bootstrap primary blue */
    font-weight: bold;
    border-left: 2px solid #0d6efd;
}

/* Custom card background color for summary */
.bg-light-blue {
    background-color: #e7f3ff !important; /* A very light, pleasant blue */
    border: 1px solid #cce0ff;
}

/* Add some space between sections for better visual separation */
.policy-section {
    padding-top: 2rem; /* This helps with scroll-spy accuracy */
    margin-top: -2rem; /* Negative margin to counteract the padding */
}

/* --- Hero Slider Optimizations for Small Mobile Screens (320px) --- */
@media (max-width: 480px) {
    .main-header {
        padding: 2px;
    }
    .product-detail-grid {
        grid-template-columns: 1fr; /* Stack columns vertically */
        gap: 10px; /* Add some space between sections */
    }
    .product-info-area {
        margin-top: 0;
        padding: 8px; /* Reduce padding for small screens */
    }
    .product-header .section-title {
        font-family: 'Poppins', sans-serif;
        font-weight: 600;
        text-align: left;
        margin: 0 0 10px 0;
        font-size: 1rem;
        color: var(--heading-light-mode-color);
        transition: color 0.3s ease;
    }
    .media-display-container {
        height: 230px; /* Reduce height for small screens */
    }
    .product-image-area {
        height: 285px; /* Reduce height for small screens */
        gap: 1px; /* Reduce gap between main image and thumbnails */
    }
    .main-product-image, .main-product-video {
        height: 230px; /* Match the container height */
        border-radius: 2px; /* Slightly less rounded for small screens */
    }
    #image-wrapper {
        height: 230px;
        border-radius: 2px; /* Match the image rounding */
    }
    .thumbnail-gallery {
        gap: 3px; /* Reduce gap between thumbnails */
        padding: 0; /* Add slight padding to the sides */
    }
    .thumbnail-item {
        flex: 0 0 50px; /* Smaller thumbnails */
        height: 50px;
    }

    .slider-track {
        /* Decrease the gap between slides for a tighter look on narrow screens */
        gap: 2px;
    }

    .slide {
        /* * Make the main slide take up 85% of the screen width.
         * This allows the previous and next slides to "peek" from the sides,
         * inviting the user to swipe.
        */
        flex: 0 0 65%;
        /* Reduce the height to be more proportional on a small screen */
        height: 200px;
        /* Scale down non-active slides slightly and reduce their opacity */
        transform: scale(0.8);
        opacity: 0.8;
        transition: transform 0.4s ease, opacity 0.4s ease;
    }

    .slide.active {
        /* * Ensure the active slide is fully scaled and opaque.
         * This makes it 'pronounced' and the clear focal point, as requested.
        */
        transform: scale(1);
        opacity: 1;
    }

    /* Adjust the slide caption for better readability on a smaller area */
    .slide-caption {
        bottom: 10px;
        left: 10px;
        right: 10px;
        padding: 10px;
    }

    .slide-caption h2 {
        font-size: 1rem; /* Make the title slightly smaller */
        margin-bottom: 5px;
    }
    .slider-dots {
        bottom: 10px; /* Move dots closer to the bottom */
        gap: 4px; /* Reduce gap between dots */
        margin-top: 10px; /* Add slight margin above dots */
    }
    .dot {
        width: 6px;
        height: 6px;
        margin: 0 1px;
    }
    .dot.active {
        width: 8px;
        height: 6px;
    }

    .shop-now-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

/* --- ENHANCED PRODUCT DETAIL PAGE (like eBay) --- */

/* Media Gallery Enhancements */
.product-image-area {
    text-align: center;
    display: flex;
    flex-direction: column;
}
#image-wrapper, #video-wrapper {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px var(--shadow-light);
    background-color: #000;
}

.thumbnail-item {
    position: relative;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease;
}
.thumbnail-item img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}
.thumbnail-item:hover {
    transform: scale(1.05);
}
.thumbnail-item.active {
    border-color: var(--primary-blue);
    box-shadow: 0 0 8px var(--primary-blue);
}
.thumbnail-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0,0,0,0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    color: #fff;
    opacity: 1;
    transition: opacity 0.2s ease;
    border-radius: 6px;
}
.thumbnail-item:hover .thumbnail-overlay {
    opacity: 0.8;
}

/* Product Info Area & Header */
.product-info-area {
    display: flex;
    flex-direction: column;
}
.product-header {
    margin-bottom: 5px;
}
.product-header .vendor-link {
    font-size: 0.9rem;
    color: var(--primary-blue);
    font-weight: 500;
    text-decoration: none;
    margin-bottom: 8px;
    display: inline-block;
}
.product-header .vendor-link:hover {
    text-decoration: underline;
}
.product-rating {
    margin-top: 10px;
}
.info-divider {
    border: 0;
    height: 1px;
    background-color: var(--border-color);
    margin: 15px 0;
}
.product-short-description {
    margin: 0;
}

/* The Action Panel */
.product-action-panel {
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    border-radius: 8px;
    padding: 20px;
    margin-top: 0;
}
.product-action-panel .product-price {
    font-size: 2rem; /* Make price stand out */
    margin-bottom: 10px;
}
.product-action-panel .stock-info {
    font-weight: 500;
    margin-bottom: 20px;
}
.stock-info .in-stock { color: #28a745; }
.stock-info .low-stock { color: #fd7e14; }
.stock-info .out-of-stock { color: #dc3545; }
.stock-info i { margin-right: 5px; }

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}
.quantity-selector .quantity-input {
    width: 70px;
}
.product-actions {
    display: flex;
    gap: 10px;
}
.product-actions .add-to-cart-btn {
    flex-grow: 1;
    padding: 12px;
    font-size: 1rem;
    font-weight: 600;
}
.product-actions .wishlist-btn {
    padding: 12px 15px;
    font-size: 1rem;
    flex-shrink: 0;
    background-color: var(--hover-bg);
    border: 1px solid var(--border-color);
}
/* Delivery & Trust Signals */
.delivery-info-box {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
}
.delivery-info-box .info-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}
.delivery-info-box .info-item:last-child {
    border-bottom: none;
}
.delivery-info-box i {
    font-size: 1.5rem;
    color: var(--primary-blue);
    width: 30px;
    text-align: center;
}
.delivery-info-box strong { font-size: 0.95rem; }
.delivery-info-box span, .delivery-info-box a {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Social Sharing */
.social-share {
    margin-top: auto; /* Pushes to the bottom */
    padding-top: 15px;
}
.social-share strong {
    margin-right: 10px;
    vertical-align: middle;
}
.social-share .social-icons {
    display: inline-flex;
    gap: 15px;
    vertical-align: middle;
}
.social-share .social-icon {
    font-size: 1.2rem;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}
.social-share .social-icon:hover {
    color: var(--primary-blue);
}

/* Responsive adjustments for the new layout */
@media (max-width: 992px) {
    .product-detail-grid {
        grid-template-columns: 1fr;
    }
    .product-info-area {
        margin-top: 2px;
    }
}

/* --- WISHLIST ICON ON IMAGE --- */

/* Create a positioning context for the icon */
.media-display-container {
    position: relative;
}

.wishlist-btn-overlay {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10; /* Ensure it's above the image */
    /* Style the button for better visibility */
    background-color: var(--bg-secondary);
    backdrop-filter: blur(5px);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 45px;
    height: 45px;
    border-radius: 50%; /* Make it circular */
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px var(--shadow-light);
    transition: all 0.2s ease;
}

.wishlist-btn-overlay:hover {
    background-color: var(--primary-blue);
    transform: scale(1.1);
}

/* Override the previous active state for the new design */
.wishlist-btn-overlay.active {
    background-color: #d9534f; /* Red for active */
    color: white;
    border-color: #d43f3a;
}

@media (max-width: 480px) {
    .wishlist-btn-overlay {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        top: 10px;
        right: 10px;
    }
    .product-action-panel {
        padding: 15px;
    }
    .product-action-panel .product-price {
        font-size: 1.2rem;
    }
    .btn-franchise-apply {
        padding: 10px 18px;
        font-size: 0.8rem;
    }
}

/* --- Account Sidebar & Mobile Tabs --- */

/* DESKTOP SIDEBAR STYLES */
.account-sidebar {
    padding: 20px 10px; /* Adjusted padding */
}

.account-nav {
    display: flex;
    flex-direction: column;
}

.account-nav-link {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    margin: 4px 0;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    color: var(--text-secondary);
    border-left: 4px solid transparent; /* Placeholder for active border */
    transition: all 0.2s ease-in-out;
}

.account-nav-link i {
    width: 20px; /* Ensures consistent icon alignment */
    margin-right: 15px;
    font-size: 1rem;
}

/* Hover state for non-active links */
.account-nav-link:not(.active):hover {
    background-color: var(--hover-bg);
    color: var(--primary-blue);
    transform: translateX(5px);
}

/* Active link state */
.account-nav-link.active {
    background-color: var(--hover-bg);
    color: var(--primary-blue);
    font-weight: 700;
    border-left-color: var(--primary-blue);
}

/* Logout Button */
.account-logout-form {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.account-logout-btn {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-radius: 8px;
    font-weight: 500;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s ease-in-out;
}

.account-logout-btn:hover {
    background-color: #ffebee; /* Light red background */
    color: #c62828; /* Darker red text */
}

body.dark-mode .account-logout-btn:hover {
    background-color: rgba(239, 83, 80, 0.1); /* Translucent red for dark mode */
    color: #ef5350; /* Brighter red for dark mode */
}

.account-logout-btn i {
    width: 20px;
    margin-right: 15px;
}

/* MOBILE TABS STYLES */
.account-tabs-mobile {
    background-color: var(--bg-secondary);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 4px 12px var(--shadow-light);
}

.account-tabs-scroll-container {
    position: relative;
    overflow-x: auto;
    /* Hide scrollbar */
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}
.account-tabs-scroll-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* Gradient overlay to hint at scrollability */
.account-tabs-scroll-container::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 40px;
    background: linear-gradient(to right, transparent, var(--bg-secondary));
    pointer-events: none; /* Allows clicks to pass through */
}

.account-tabs-nav {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
}

.account-tab-item {
    flex-shrink: 0; /* Prevent tabs from shrinking */
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    white-space: nowrap;
    border-radius: 8px;
    transition: all 0.2s ease-in-out;
}

/* Mobile active tab style */
.account-tab-item.active {
    background-color: var(--primary-blue);
    color: #fff;
    box-shadow: 0 2px 5px rgba(0, 123, 255, 0.3);
}

.account-tab-item:not(.active):hover {
    background-color: var(--hover-bg);
}

/* --- ACCOUNT PAGE & SIDEBAR OPTIMIZATIONS --- */

/* --- FIX 1: Restore Missing Icons & Refine Styles --- */
.account-nav-link i,
.account-logout-btn i {
    color: inherit; /* This is the key fix to make icons inherit the link's color */
    transition: color 0.2s ease-in-out;
    font-size: 1.1rem; /* Slightly larger icons */
}

/* Increase specificity to override global button styles for the logout button */
.account-logout-form .account-logout-btn {
    background: none !important; /* Force override of any global button background */
    border: none !important;
}


/* --- FIX 2: Responsive Visibility (Replicating Tailwind's md:hidden) --- */

/* By default (on mobile), hide the desktop sidebar and adjust the main content */
.account-sidebar {
    display: none;
}
.account-main-content {
    width: 100%;
}

/* Show the mobile tabs by default */
.account-tabs-mobile {
    display: block;
}

/* On medium screens and larger (e.g., 768px and up) */
@media (min-width: 768px) {
    /* Show the desktop sidebar */
    .account-sidebar {
        display: block;
    }

    /* Make the main content area take up the remaining space */
    .account-main-content {
        width: 75%; /* Equivalent to md:w-3/4 */
    }

    /* Hide the mobile tabs on desktop */
    .account-tabs-mobile {
        display: none;
    }
}


/* --- General UI Polish --- */

/* Add a subtle transition to the main content area for a smoother resize effect */
.account-main-content {
    transition: width 0.3s ease-in-out;
}

/* Refined mobile tab active state for better contrast */
.account-tab-item.active {
    font-weight: 700;
}

/* --- OPTIMIZED ACCOUNT PAGE & SIDEBAR STYLES --- */

/* Main container for the account page layout */
.account-container {
    display: flex;
    flex-direction: column; /* Mobile-first: stack sidebar/tabs and content */
    gap: 24px;
}

/* --- DESKTOP SIDEBAR (Visible on screens > 768px) --- */
.account-sidebar {
    display: none; /* Hide sidebar on mobile by default */
    background-color: var(--bg-secondary);
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow-light);
    padding: 20px;
    align-self: flex-start; /* Prevents sidebar from stretching vertically */
}

.account-nav {
    display: flex;
    flex-direction: column;
}

.account-nav-link {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    margin: 4px 0;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    color: var(--text-secondary); /* A good default non-active color */
    border-left: 4px solid transparent;
    transition: all 0.2s ease-in-out;
}

.account-nav-link i {
    width: 20px;
    margin-right: 15px;
    font-size: 1rem;
    color: inherit; /* Ensures icon color matches text color */
}

/* Hover state for non-active links */
.account-nav-link:not(.active):hover {
    background-color: var(--hover-bg);
    color: var(--primary-blue);
    transform: translateX(5px);
}

/* Active link state */
.account-nav-link.active {
    background-color: var(--hover-bg);
    color: var(--primary-blue);
    font-weight: 700;
    border-left-color: var(--primary-blue);
}

/* Logout Button */
.account-logout-form {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.account-logout-btn {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-radius: 8px;
    font-weight: 500;
    color: var(--text-secondary);
    background: none !important; /* Override global button styles */
    border: none !important;
    cursor: pointer;
    text-align: left;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s ease-in-out;
}

.account-logout-btn:hover {
    background-color: rgba(211, 47, 47, 0.1) !important; /* Light red background */
    color: #c62828 !important; /* Darker red text */
}

body.dark-mode .account-logout-btn:hover {
    background-color: rgba(239, 83, 80, 0.15) !important;
    color: #ef5350 !important;
}

/* --- MOBILE TABS (Visible on screens < 768px) --- */
.account-tabs-mobile {
    display: block; /* Show tabs on mobile by default */
    background-color: var(--bg-secondary);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 4px 12px var(--shadow-light);
}

.account-tabs-scroll-container {
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.account-tabs-scroll-container::-webkit-scrollbar {
    display: none;
}

.account-tabs-nav {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
}

.account-tab-item {
    flex-shrink: 0;
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    white-space: nowrap;
    border-radius: 8px;
    transition: all 0.2s ease-in-out;
}

.account-tab-item.active {
    background-color: var(--primary-blue);
    color: #fff;
    box-shadow: 0 2px 5px rgba(0, 123, 255, 0.3);
}

/* --- RESPONSIVE LAYOUT LOGIC --- */
@media (min-width: 768px) {
    /* Switch to a side-by-side layout on desktop */
    .account-container {
        flex-direction: row;
        align-items: flex-start; /* Align items to the top */
        gap: 32px;
    }

    /* Show the sidebar and define its width */
    .account-sidebar {
        display: block;
        flex: 0 0 22%; /* Sidebar takes up 22% of the width and doesn't grow/shrink */
        max-width: 280px;
    }

    /* Hide the mobile tabs */
    .account-tabs-mobile {
        display: none;
    }

    /* Main content takes the remaining space */
    .account-main-content {
        flex: 1 1 auto;
    }
}

/* --- ENHANCED ACCOUNT & ADDRESS PAGE STYLES --- */

.account-content-box {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 4px 12px var(--shadow-light);
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.content-header .section-title {
    margin: 0;
}

.content-header .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.address-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.address-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.address-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.address-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.default-badge {
    background-color: #e6f7ff;
    color: var(--primary-blue);
    font-size: 0.75rem;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid var(--primary-blue);
}
body.dark-mode .default-badge {
    background-color: rgba(0, 123, 255, 0.2);
}

.address-details {
    font-style: normal;
    color: var(--text-secondary);
    line-height: 1.6;
    flex-grow: 1;
}

.address-details .phone-number {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
}

.address-card-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

/* Empty state for no addresses */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px 20px;
    background-color: var(--bg-primary);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
}
.empty-state i {
    font-size: 3rem;
    color: var(--border-color);
    margin-bottom: 15px;
}
.empty-state p {
    color: var(--text-secondary);
}

/* --- MODAL STYLES --- */
.modal-content {
    background: var(--bg-secondary);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    padding: 15px;
    flex-direction: column;
    transform: scale(1);
    transition: transform 0.3s ease;
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-title { margin: 0; font-size: 1.25rem; }
.modal-close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Form Styles inside Modal */
.form-vertical { display: flex; flex-direction: column; gap: 15px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-group label { font-weight: 500; margin-bottom: 5px; display: block; }
.form-group input { width: 100%; }

.form-group-checkbox { display: flex; align-items: center; gap: 10px; }
.form-group-checkbox input[type="checkbox"] { width: auto; }

.feedback-message {
    padding: 10px;
    border-radius: 5px;
    margin-top: 10px;
    text-align: center;
    display: none; /* Hidden by default */
}
.feedback-message.error { background-color: #f8d7da; color: #721c24; display: block; }

.btn-danger { background-color: #dc3545; color: white; }
.btn-danger:hover { background-color: #c82333; }

/* --- ADDRESS PAGE & MODAL MOBILE OPTIMIZATIONS --- */
@media (max-width: 768px) {
    /* Adjust main content padding for mobile */
    .account-content-box {
        padding: 15px;
    }

    /* Stack the header content vertically */
    .content-header {
        flex-direction: column;
        align-items: stretch; /* Make items take full width */
        text-align: center;
    }

    .content-header .btn-primary {
        width: 100%; /* Make button a large, easy tap target */
    }

    /* Stack two-column form grids into a single column */
    .form-grid-2 {
        grid-template-columns: 1fr;
    }
    /* Increase modal width on mobile for better usability */
    .modal-content {
        width: 95%;
        max-width: 500px;
    }
    /* Stack modal footer buttons and reverse order for better UX */
    .modal-footer {
        flex-direction: column-reverse; /* Primary action on top */
        gap: 12px;
    }

    .modal-footer .btn {
        width: 100%; /* Make buttons full-width */
    }
}

@media (max-width: 480px) {
    /* Further reduce padding for very small screens */
    .account-content-box {
        padding: 12px;
    }

    .address-card {
        padding: 15px;
    }

    /* Adjust typography for small devices */
    .content-header .section-title {
        font-size: 1.5rem;
    }

    .address-name {
        font-size: 1rem;
    }

    .modal-title {
        font-size: 1.1rem;
    }

    /* Give the modal a bit more space from the top on mobile */
    .modal-overlay {
        align-items: flex-start;
        padding-top: 5vh;
    }
}

/* --- ENHANCED ACCOUNT & ADDRESS PAGE STYLES --- */

.account-content-box {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 4px 12px var(--shadow-light);
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.content-header .section-title {
    margin: 0;
}

.content-header .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.address-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.address-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
/* Apply hover effects only on devices that can truly hover (like desktops with a mouse) */
@media (hover: hover) and (pointer: fine) {
    .address-card:hover {
        box-shadow: 0 6px 16px var(--shadow-light);
        transform: translateY(-3px);
    }
}


.address-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.address-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.default-badge {
    background-color: #e6f7ff;
    color: var(--primary-blue);
    font-size: 0.75rem;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid var(--primary-blue);
}
body.dark-mode .default-badge {
    background-color: rgba(0, 123, 255, 0.2);
}

.address-details {
    font-style: normal;
    color: var(--text-secondary);
    line-height: 1.6;
    flex-grow: 1;
}

.address-details .phone-number {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
}

.address-card-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

/* FIX: Improved Mobile Tap Targets for Address Actions */
.address-card-actions .action-btn {
    background-color: var(--hover-bg);
    border: 1px solid var(--border-color);
    color: var(--primary-blue);
    cursor: pointer;
    font-weight: 500;
    padding: 6px 12px;
    text-decoration: none; /* Remove underline */
    border-radius: 20px;   /* Pill shape */
    font-size: 0.8rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* Apply hover effects only on devices that can truly hover (like desktops with a mouse) */
@media (hover: hover) and (pointer: fine) {
    .address-card-actions .action-btn:hover {
        background-color: var(--primary-blue);
        color: #fff;
        border-color: var(--primary-blue);
    }
}


/* Empty state for no addresses */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px 20px;
    background-color: var(--bg-primary);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
}
.empty-state i {
    font-size: 3rem;
    color: var(--border-color);
    margin-bottom: 15px;
}
.empty-state p {
    color: var(--text-secondary);
}

/* --- MODAL STYLES --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: var(--search-overlay-bg);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 1;
    transition: opacity 0.3s ease;
}
.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transform: scale(1);
    transition: transform 0.3s ease;
}
.modal-overlay.hidden .modal-content {
    transform: scale(0.95);
}
.modal-content.small {
    max-width: 400px;
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-title { margin: 0; font-size: 1.25rem; }
.modal-close-btn { background: none; border: none; font-size: 1.8rem; cursor: pointer; color: var(--text-secondary); }

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Form Styles inside Modal */
.form-vertical { display: flex; flex-direction: column; gap: 15px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-group label { font-weight: 500; margin-bottom: 5px; display: block; }
.form-group input { width: 100%; }

.form-group-checkbox { display: flex; align-items: center; gap: 10px; }
.form-group-checkbox input[type="checkbox"] { width: auto; }

.feedback-message {
    padding: 10px;
    border-radius: 5px;
    margin-top: 10px;
    text-align: center;
    display: none; /* Hidden by default */
}
.feedback-message.error { background-color: #f8d7da; color: #721c24; display: block; }

.btn-danger { background-color: #dc3545; color: white; }
.btn-danger:hover { background-color: #c82333; }

/* --- ADDRESS PAGE & MODAL MOBILE OPTIMIZATIONS --- */
@media (max-width: 768px) {
    /* Adjust main content padding for mobile */
    .account-content-box {
        padding: 15px;
    }

    /* Stack the header content vertically */
    .content-header {
        flex-direction: column;
        align-items: stretch; /* Make items take full width */
        text-align: center;
    }

    .content-header .btn-primary {
        width: 100%; /* Make button a large, easy tap target */
    }

    /* Stack two-column form grids into a single column */
    .form-grid-2 {
        grid-template-columns: 1fr;
    }

    /* Give the modal a bit more space from the top on mobile */
    .modal-overlay {
        align-items: flex-start;
        padding-top: 5vh;
    }

    /* Stack modal footer buttons and reverse order for better UX */
    .modal-footer {
        flex-direction: column-reverse; /* Primary action on top */
        gap: 12px;
    }

    .modal-footer .btn {
        width: 100%; /* Make buttons full-width */
    }
}

@media (max-width: 480px) {
    /* Further reduce padding for very small screens */
    .account-content-box {
        padding: 12px;
    }

    .address-card {
        padding: 15px;
    }

    /* Adjust typography for small devices */
    .content-header .section-title {
        font-size: 1.5rem;
    }

    .address-name {
        font-size: 1rem;
    }

    .modal-title {
        font-size: 1.1rem;
    }
}

.hidden {
  display: none; /* or visibility: hidden */
}

/* --- ENHANCED PROFILE DETAILS PAGE STYLES --- */

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.form-section {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
}

.form-section-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--heading-light-mode-color);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

body.dark-mode .form-section-title {
    color: var(--heading-dark-mode-color);
}

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

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.2s ease-in-out;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

.disabled-input {
    background-color: var(--hover-bg) !important;
    cursor: not-allowed;
    opacity: 0.7;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.form-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 150px;
}

.form-actions .spinner {
    font-size: 1rem;
}

/* Feedback message styles */
#form-feedback {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 500;
    border-left-width: 5px;
    border-left-style: solid;
}

#form-feedback.success {
    background-color: #e6f7ec;
    border-color: #5cb85c;
    color: #3c763d;
}

#form-feedback.error {
    background-color: #f2dede;
    border-color: #d9534f;
    color: #a94442;
}

/* --- ENHANCED CART PAGE STYLES --- */

.cart-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    padding-bottom: 15px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}
.cart-title {
    margin: 0;
    font-size: 1.8rem;
}
.cart-item-count {
    font-size: 1.1rem;
    color: var(--text-secondary);
}
.btn-text-danger {
    background: none;
    border: none;
    color: #c82333;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    margin-left: auto; /* Pushes button to the right */
    padding: 5px;
}
.btn-text-danger:hover {
    text-decoration: underline;
}

.cart-item-card {
    display: grid;
    grid-template-columns: 100px 1fr 150px; /* Image | Details | Actions */
    gap: 20px;
    padding: 20px;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}
.cart-items-list {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}
.cart-items-list .cart-item-card:last-child {
    border-bottom: none;
}
.remove-item-btn-mobile {
    display: none; /* Hidden on desktop */
}

/* Stock Info text inside cart */
.stock-info-cart {
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 5px;
}
.stock-info-cart.low-stock { color: #fd7e14; }
.stock-info-cart.out-of-stock { color: #dc3545; }


/* --- MOBILE STYLES FOR CART (320px+) --- */
@media (max-width: 768px) {
    .cart-page-container {
        grid-template-columns: 1fr; /* Stack main content and summary */
    }
    .cart-summary-sidebar {
        position: static;
        margin-top: 30px;
    }
    .cart-item-card {
        grid-template-columns: 80px 1fr; /* Image | Details+Actions */
        grid-template-rows: auto auto;
        gap: 10px 15px;
        padding: 15px;
    }
    .cart-item-image {
        grid-row: 1 / 3;
    }
    .cart-item-details {
        grid-column: 2 / 3;
        grid-row: 1 / 2;
    }
    .cart-item-actions {
        grid-column: 2 / 3;
        grid-row: 2 / 3;
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 10px;
    }
    .remove-item-btn-mobile {
        display: block;
        background: none;
        border: none;
        color: var(--text-secondary);
        font-size: 1.2rem;
        cursor: pointer;
    }
    .item-subtotal {
        font-size: 1rem;
    }
}

/* --- TOAST NOTIFICATION STYLES --- */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 12000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast-notification {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    border-left: 5px solid;
    display: flex;
    align-items: center;
    gap: 15px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.4s cubic-bezier(0.215, 0.610, 0.355, 1);
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-notification.success { border-color: #28a745; }
.toast-notification.error { border-color: #dc3545; }
.toast-notification.info { border-color: var(--primary-blue); }

.toast-notification .icon { font-size: 1.2rem; }
.toast-notification.success .icon { color: #28a745; }
.toast-notification.error .icon { color: #dc3545; }
.toast-notification.info .icon { color: var(--primary-blue); }

/* --- PRODUCT DETAIL PAGE RESPONSIVE OPTIMIZATIONS --- */
@media (max-width: 992px) {
    .product-detail-grid {
        grid-template-columns: 1fr; /* Stack columns on tablets and mobile */
    }
    .product-main-details {
        /* On mobile, move the action panel up for immediate visibility */
        display: flex;
        flex-direction: column;
    }
    .product-action-panel {
        order: -1; /* This is the magic: moves the price/add-to-cart box to the top */
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {
    .product-detail-grid {
        gap: 20px;
    }
    .section-title {
        font-size: 1.4rem;
    }
    .product-price {
        font-size: 1.8rem;
    }
    .product-action-panel {
        padding: 15px;
    }
    .quantity-selector {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 15px;
    }
    #addToCartBtn {
        width: 100%;
        padding: 12px;
    }
}

/* --- ENHANCED PARTNERSHIP HERO SLIDER STYLES --- */

/* Wrapper for sizing and spacing */
.rl-hero-wrapper {
    width: 100%;
    margin: 1rem 0;
    padding: 0;
}

/* The slider container, which acts as the viewport */
.rl-hero-slider {
    position: relative;
    overflow: hidden; /* This is crucial for the carousel effect */
}

/* The track holds all slides and moves horizontally */
.rl-hero-track {
    display: flex; /* This allows slides to sit side-by-side */
    will-change: transform;
}

/* Individual slides */
.rl-hero-slide {
    position: static; /* Overridden from 'absolute' */
    flex-shrink: 0;   /* Prevents slides from shrinking */
    width: 100%;      /* Mobile-first: one slide takes full width */
    opacity: 1;
    height: 220px; /* Fixed height for mobile */
    border-radius: 12px;
    transform: scale(1);
    transition: transform 0.6s linear, opacity 0.6s linear;
    box-sizing: border-box;
    padding: 0 5px; /* Adds spacing between slides */
}

.rl-hero-slide .rl-hero-img {
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rl-hero-slide .rl-hero-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    inset: 5px; /* Matches the slide padding */
    border-radius: 12px; /* Matches the image rounding */
    background: linear-gradient(90deg, rgba(0,0,0,0.65) 0%, rgba(0, 0, 0, 0.217) 50%, rgba(0, 0, 0, 0.03) 100%);
    display: flex;
    align-items: center;
}
.rl-hero-content {
    padding: 10px;
    max-width: 80%;
}
.rl-hero-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: rgba(255,255,255,0.95);
    margin: 0;
    line-height: 1.2;
}

/* --- DESKTOP STYLING (3-SLIDE VIEW) --- */
@media (min-width: 768px) {
    .rl-hero-slide {
        width: 30%; /* Displays three slides within the viewport */
        transform: scale(0.8); /* Scales down non-active slides */
        opacity: 0.6;
    }

    /* The active (center) slide is zoomed in and fully opaque */
    .rl-hero-slide.active {
        transform: scale(1);
        opacity: 1;
        z-index: 2; /* Brings the active slide forward */
    }
}

.rl-hero-sub {
    font-size: 0.95rem;
    font-family: "Roboto", sans-serif;
    font-optical-sizing: auto;
    font-style: normal;
    margin-top: 0.5rem;
    color:rgba(255,255,255,0.95);
}

/* CTAs */
.rl-hero-ctas {
    margin-top:1.25rem;
    display:flex;
    gap: 0.6rem;
    align-items:center;
}

.rl-hero-cta-primary {
    display:inline-block;
    padding: 0.6rem 0.8rem;
    border-radius:10px;
    font-weight:600;
    background: var(--cta-bg);
    color: var(--cta-text);
    text-decoration: none;
    box-shadow: 0 8px 22px rgba(0,0,0,0.16);
}

.rl-hero-cta-primary:hover {
    opacity: 0.95;
    transform: translateY(-1px);
}

.rl-hero-cta-ghost {
    display:inline-block;
    padding: 0.5rem 0.8rem;
    border-radius:10px;
    font-weight:600;
    background: var(--bg-primary);
    color:var(--text-primary);
    text-decoration:none;
    border:1px solid rgba(0,0,0,0.06);
}

  /* Nav buttons */
.rl-hero-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 30;
    border-radius: 999px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.92);
    border: none;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
}
.rl-hero-prev {
    left: 14px;
}
.rl-hero-next {
    right: 14px;
}
.rl-hero-nav:hover {
    transform: translateY(-50%) scale(1.03);
}

  /* Dots */
.rl-hero-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 35;
}
.rl-hero-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: var(--dot-inactive);
    transition: transform .25s ease, background .25s ease;
}
.rl-hero-dot[aria-pressed="true"] {
    background: var(--dot-active);
    transform: scale(1.08);
}

  /* Small devices: hide nav buttons and show slightly larger dots */
@media (max-width:767px) {
    .rl-hero-nav {
        display:none;
    }
    .rl-hero-dot {
        width:12px;
        height:12px;
    }
    .rl-hero-content {
        max-width:90%;
    }
}
/* --- ENHANCED PRODUCT DETAIL PAGE FOR MOBILE --- */

/* Hide the back button on desktop by default */
.page-back-btn {
    display: none;
}

@media (max-width: 576px) {
    body.page-product-detail .main-header {
        display: none;
    }
    /* --- Style and position the new back button --- */
    body.page-product-detail .page-back-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed; /* Keeps it on screen even when scrolling */
        top: 15px;
        left: 15px;
        z-index: 100;
        width: 40px;
        height: 40px;
        background-color: var(--bg-secondary);
        backdrop-filter: blur(5px);
        border: 1px solid var(--border-color);
        border-radius: 50%;
        box-shadow: 0 2px 8px var(--shadow-light);
        color: var(--text-primary);
        font-size: 1rem;
        text-decoration: none;
    }
    body.page-product-detail .page-back-btn:hover {
        background-color: var(--primary-blue);
        box-shadow: 0 4px 12px var(--shadow-light);
    }

    /* --- Make the product image area full-width --- */
    body.page-product-detail .main-content > .container {
        padding-left: 0;
        padding-right: 0;
    }

    /* Remove border-radius for a seamless edge-to-edge look */
    body.page-product-detail .product-image-area #image-wrapper,
    body.page-product-detail .product-image-area #video-wrapper,
    body.page-product-detail .product-image-area .main-product-image {
        border-radius: 0;
    }
    /* Add padding back to the other sections so they stay aligned */
    body.page-product-detail .product-main-details,
    body.page-product-detail .product-tabs-container {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* --- QUICK VIEW STYLES --- */
.product-card, .product-card-horizontal {
    position: relative; /* Context for the button */
}

.quick-view-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
    background-color: var(--bg-secondary);
    backdrop-filter: blur(4px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 5px;
    opacity: 0; /* Hidden by default */
    transform: translateY(-10px);
    transition: all 0.2s ease-in-out;
}

/* Show button on hover for desktop */
@media (hover: hover) {
    .product-card:hover .quick-view-btn,
    .product-card-horizontal:hover .quick-view-btn {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Always show button on touch devices */
@media (hover: none) {
    .quick-view-btn {
        opacity: 1;
        transform: translateY(0);
    }
}


/* --- ENHANCED QUICK VIEW MODAL STYLES --- */

/* Make the modal content wider on desktop */
.modal-content {
    max-width: 850px;
    width: 90%;
}

#quickViewContent {
    padding: 0;
}
.quick-view-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    gap: 15px;
    padding: 40px;
}
.quick-view-loading .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* The main two-column grid for desktop */
.quick-view-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

/* 1. Gallery Column (Desktop) */
.quick-view-gallery {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 15px;
    padding: 20px;
    align-items: flex-start;
}
.quick-view-main-image-container {
    order: 2; /* Main image appears to the right of thumbnails */
    border-radius: 8px;
    overflow: hidden;
}
.quick-view-thumbnails {
    order: 1; /* Thumbnails appear on the left */
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 450px;
    overflow-y: auto;
}
.quick-view-thumbnail {
    border: 2px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s ease;
}
.quick-view-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 1/1;
    object-fit: cover;
}
.quick-view-thumbnail:hover {
    border-color: var(--primary-blue);
}
.quick-view-thumbnail.active {
    border-color: var(--primary-blue);
    box-shadow: 0 0 5px var(--primary-blue);
}
#quickViewMainImage {
    width: 100%;
    height: 100%;
    max-height: 450px;
    object-fit: cover;
    aspect-ratio: 1/1;
}

/* Details Column (Desktop) */
.quick-view-details {
    padding: 25px 30px;
    background-color: var(--bg-primary);
    display: flex;
    flex-direction: column;
}
.quick-view-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.2;
}
.quick-view-details .star-rating {
    margin-bottom: 15px;
}
.quick-view-price {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 15px;
}
.quick-view-desc {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 20px;
    flex-grow: 1; /* Pushes actions to the bottom */
}
.quick-view-actions {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 10px;
    margin-bottom: 20px;
}
.quick-view-actions .quantity-input {
    padding: 12px;
    text-align: center;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1.1rem;
}
.quick-view-actions .add-to-cart-btn {
    padding: 12px;
    font-size: 1rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.quick-view-full-details-link {
    text-align: center;
    font-weight: 500;
    margin-top: auto;
    padding-top: 15px;
}

/* --- MOBILE RESPONSIVENESS for Quick View --- */
@media (max-width: 768px) {
    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }
    .modal-content {
        width: 100%;
        max-width: 100%;
        height: 90vh;
        border-radius: 16px 16px 0 0;
    }
    .modal-body {
        overflow-y: auto;
    }
    .quick-view-grid {
        grid-template-columns: 1fr;
    }
    .quick-view-gallery {
        grid-template-columns: 1fr;
        padding: 15px;
    }
    .quick-view-main-image-container {
        order: 1;
    }
    .quick-view-thumbnails {
        order: 2;
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 10px;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    .quick-view-thumbnails::-webkit-scrollbar {
        display: none;
    }
    .quick-view-thumbnail {
        flex: 0 0 60px;
    }
    .quick-view-details {
        padding: 0 15px 15px 15px;
    }
    .quick-view-title { font-size: 1.5rem; }
    .quick-view-price { font-size: 1.5rem; }
}

/* --- CATEGORY GRID SECTION --- */
.category-grid-section {
    padding: 40px 0;
    background-color: var(--bg-primary);
}
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}
.category-grid-item {
    position: relative;
    display: block;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    box-shadow: 0 4px 12px var(--shadow-light);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.category-grid-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}
.category-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.category-grid-item:hover img {
    transform: scale(1.05);
}
.category-grid-item-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 50%);
    display: flex;
    align-items: flex-end;
    padding: 20px;
}
.category-grid-item-overlay h3 {
    color: #fff;
    font-size: 1.25rem;
    margin: 0;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

/* --- ENHANCED PRODUCT DETAIL SPECIFICATIONS & TAGS --- */

.spec-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.95rem;
}

.spec-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
}

.spec-table tr:last-child td {
    border-bottom: none;
}

.spec-table tr:nth-child(even) {
    background-color: var(--bg-primary);
}

.spec-key {
    font-weight: 600;
    color: var(--text-primary);
    width: 35%;
}

.spec-value {
    color: var(--text-secondary);
}

.product-tags-container {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.product-tag {
    display: inline-block;
    background-color: var(--hover-bg);
    color: var(--text-secondary);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.product-tag:hover {
    background-color: var(--primary-blue);
    color: #fff;
}

.warranty-info-box {
    margin-top: 20px;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    background-color: var(--bg-primary);
}
.warranty-info-box i {
    font-size: 1.5rem;
    color: var(--primary-blue);
}
.warranty-info-box strong {
    display: block;
    font-size: 0.95rem;
}
.warranty-info-box span {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* --- Brand Page & Link Styles --- */
.spec-brand-link {
    color: var(--primary-blue);
    text-decoration: underline;
    font-weight: 600;
}
.spec-brand-link:hover {
    color: var(--dark-blue);
}

.brand-page-container {
    padding-top: 40px;
    padding-bottom: 40px;
}
.brand-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}
.brand-header h1 {
    font-size: 2.5rem;
    color: var(--heading-light-mode-color);
}
.brand-header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* --- Order Tracking Timeline --- */
.order-tracking-section {
    padding: 25px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 30px;
}

.order-tracker {
    display: flex;
    justify-content: space-between;
    list-style-type: none;
    padding: 0 40px;
    margin: 0;
    overflow: visible; /* Ensure the line is not hidden */
}

.tracker-step {
    flex: 1;
    text-align: center;
    position: relative; /* FIX: This is essential for positioning the line */
}

/* The connecting line (desktop) */
.tracker-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 20px; /* Vertically center with the icon */
    left: 50%;
    width: 100%;
    height: 4px;
    background-color: var(--border-color);
    z-index: 1;
}

.tracker-icon {
    width: 40px;
    height: 40px;
    line-height: 40px;
    border-radius: 50%;
    background-color: var(--border-color);
    color: var(--text-secondary);
    display: inline-block;
    position: relative;
    z-index: 2;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.tracker-label {
    margin-top: 10px;
}

.tracker-label strong {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
}

.tracker-label small {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* Styling for completed steps */
.tracker-step.complete .tracker-icon {
    background-color: var(--brand-accent); /* Green for completed */
    color: #fff;
}

.tracker-step.complete:not(:last-child)::after {
    background-color: var(--brand-accent);
}

/* Styling for the currently active step */
.tracker-step.active .tracker-icon {
    background-color: var(--primary-blue);
    color: #fff;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(0, 123, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 123, 255, 0); }
}

/* --- Responsive Styles for Mobile Tracker --- */
@media (max-width: 768px) {
    .order-tracker {
        flex-direction: column;
        align-items: flex-start;
    }

    .tracker-step {
        display: flex;
        align-items: flex-start;
        text-align: left;
        padding-left: 20px;
        padding-bottom: 30px;
        flex: none;
        width: 100%;
    }

    /* The connecting line (mobile) */
    .tracker-step:not(:last-child)::after {
        height: 100%;
        width: 4px;
        top: 20px;
        left: 0;
        transform: translateX(18px); /* Center on the icon */
    }
    
    .tracker-icon {
        margin-right: 20px;
        flex-shrink: 0; /* Prevent icon from shrinking */
    }
    
    .tracker-label {
        margin-top: 5px;
    }
}