@charset "utf-8";

:root {
  --pink: #ff2f8f;
  --dark: #0f172a;
  --gray: #64748b;
  --light: #f8fafc;
  --radius: 999px;
  --purple: #673ab7;
}

* {
  box-sizing: border-box;
}

    body { font-family:'Inter',sans-serif; margin:0; background:#f5f5f5; overflow-x: hidden; }
        .container-main { display:flex; padding:15px; gap:20px; min-height: 80vh; transition: all 0.3s ease; }
        
        /* Sidebar Styling */
        .sidebar { width:260px; min-width:260px; background:#fff; border-radius:8px; padding:15px; height: fit-content; position: sticky; border: 1px solid #eee; transition: 0.3s ease; z-index: 100;   }
        
        /* Desktop Toggle Logic */
        .sidebar.collapsed { margin-left: -280px; opacity: 0; visibility: hidden; }

        .category-list { list-style:none; padding:0; }
        .category-item { border-bottom: 1px solid #f1f1f1; }
        .cat-header { display: flex; justify-content: space-between; align-items: center; padding: 10px 5px; cursor: pointer; }
        .cat-header a { text-decoration: none; color: #333; font-weight: 500; font-size: 14px; flex-grow: 1; }
        .subcategory-list { list-style:none; padding-left:15px; background: #fafafa; padding-bottom: 10px; }
        .subcategory-list li { padding: 8px 10px; font-size: 13px; cursor: pointer; color: #555; border-radius: 4px; }
        .subcategory-list li:hover { background: #eee; color: #673ab7; }
        .arrow { font-size: 10px; color: #ccc; transition: 0.3s; }
        .rotate { transform: rotate(90deg); }

        /* Content Area */
        .product-area { flex:1; min-width: 0; } /* min-width:0 prevents flex items from breaking layout */
        .hero-banner { border-radius: 12px; overflow: hidden; margin-bottom: 35px; box-shadow: 0 4px 12px rgba(0,0,0,0.05); background: #ececec; }

        /* Horizontal Scroll Rows */
        .section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
        .section-header h5 { font-weight: 700; color: #222; margin: 0; font-size: 18px; }
        .scroll-row { display: flex; overflow-x: auto; gap: 20px; padding-bottom: 20px; scrollbar-width: none; }
        .scroll-row::-webkit-scrollbar { display: none; }

        /* Product Card */
        .product-card { flex: 0 0 auto; width: 210px; background:#fff; border-radius:10px; padding:15px; border:1px solid #eee; position: relative; transition: 0.3s; }
        .product-card:hover { box-shadow:0 8px 20px rgba(0,0,0,0.08); }
        .img-holder { position: relative; width: 100%; height: 160px; margin-bottom: 10px; cursor: pointer; }
        .img-holder img { width: 100%; height: 100%; object-fit: contain; }
        
        .cart-action-wrap { position: absolute; bottom: -5px; right: 0; z-index: 5; }
        .round-btn {
            width: 40px; height: 40px; border-radius: 50%; border: 2px solid #673ab7;
            background: #fff; color: #673ab7; font-size: 20px; font-weight: bold;
            cursor: pointer; display: flex; align-items: center; justify-content: center;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1); transition: 0.2s;
        }

        .round-btn.has-items { background: #673ab7; color: #fff; font-size: 15px; border: none; }
        
        .product-name { font-size:14px; font-weight:500; height:40px; overflow:hidden; text-align: left; cursor: pointer; margin-top: 10px; }
        .product-price { font-weight:700; color:#fb5353; font-size:18px; text-align: left; margin-top: 5px; }

        /* Floating Cart & Sidebar */
        #floating-cart { position: fixed; right: 0; top: 50%; transform: translateY(-50%); background: #ffde00; padding: 15px 10px; cursor: pointer; z-index: 1000; border-radius: 12px 0 0 12px; text-align: center; border: 1px solid #e2c600; box-shadow: -2px 0 10px rgba(0,0,0,0.1); }
        #cart-sidebar { position: fixed; right: -350px; top: 0; width: 320px; height: 100%; background: white; z-index: 2000; transition: 0.4s; display: flex; flex-direction: column; box-shadow: -5px 0 25px rgba(0,0,0,0.2); }
        #cart-sidebar.open { right: 0; }
        .cart-header { padding: 20px; background: #673ab7; color: white; display: flex; justify-content: space-between; }
        #cart-items-list { flex: 1; overflow-y: auto; padding: 15px; }
        
        /* Mobile Overlay */
        #overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); display: none; z-index: 1500; }
        #overlay.active { display: block; }

        @media (max-width: 991px) {
            .sidebar { position: fixed; left: -300px; top: 0; height: 100vh; z-index: 3000; border-radius: 0;  overflow: scroll; }
            .sidebar.mobile-open { left: 0; }
        }
        .product-grid {
    transition: opacity 0.3s ease-in-out;
}

#searchSuggestions {
    top: 100%; /* Positions it exactly below the input */
    left: 0;
    max-height: 400px;
    overflow-y: auto;
    border-radius: 0 0 10px 10px;
    border-top: none;
    z-index: 9999;
}

#searchSuggestions .list-group-item {
    cursor: pointer;
    transition: background 0.2s;
}

#searchSuggestions .list-group-item:hover {
    background-color: #f8f9fa;
    color: #673ab7;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 products per row on mobile */
        gap: 10px;
    }
}

/* Target screens smaller than 576px (Mobile) */
@media (max-width: 575px) {
    .product-grid {
        display: grid !important;
        /* This forces exactly 3 columns */
        grid-template-columns: repeat(3, 1fr) !important; 
        gap: 8px !important; /* Smaller gap for small screens */
        padding: 10px !important;
    }

    .product-card {
        padding: 5px !important;
        border-radius: 8px !important;
    }

    .product-card .product-name {
        font-size: 11px !important; /* Smaller text to prevent overlapping */
        line-height: 1.2;
        height: 2.4em; /* Limits to 2 lines */
        overflow: hidden;
    }

    .product-card .product-price {
        font-size: 12px !important;
        font-weight: bold;
    }

    /* Make the '+' button slightly smaller for the 3-column layout */
    .round-btn {
        width: 80px !important;
        height: 80px !important;
        font-size: 14px !important;
        line-height: 80px !important;
    }
}
/* mobile specific layout fixes */
@media (max-width: 768px) {
    .topbar-inner {
        display: flex;
        flex-wrap: wrap; /* Allows items to wrap if they are too wide */
        align-items: center;
        padding: 10px;
        height: auto !important; /* Let the bar grow to fit the search box */
    }

    .menu-toggle {
        order: 1; /* Keep menu first */
        margin-right: 15px;
    }

    .logo {
        order: 2; /* Keep logo next to menu */
        flex-grow: 1;
    }

    .actions {
        order: 3; /* Keep cart on the right */
    }

    /* Move search to a new line so it doesn't crush the menu */
    #search-form {
        order: 4; 
        width: 100%;
        margin-top: 10px;
        padding: 0 5px;
    }

    /* Adjust the main content margin so the topbar doesn't cover it */
    .container-main {
        margin-top: 20px; 
    }
    
    /* Ensure sidebar stays on top of everything when open */
    .sidebar {
        z-index: 9999 !important;
    }
}
#mainSidebar {
    z-index: 1050; /* Higher than the topbar */
    transition: 0.3s;
}

/* Ensure the overlay is also very high */
#overlay {
    z-index: 1040;
}

/* Mobile Header Adjustment */
@media (max-width: 768px) {
    .topbar {
        height: auto !important; /* Allows header to expand for the search bar */
        padding-bottom: 10px;
        position: fixed;
        top: 0;
        width: 100%;
        z-index: 1000;
    }

    .topbar-inner {
        flex-wrap: wrap; /* Forces the search bar to the next line */
        height: auto !important;
    }

    /* Target the search form specifically */
    #search-form {
        width: 100%;
        margin: 10px 15px 5px 15px; /* Adds space around the search box */
        order: 10; /* Ensures it stays at the bottom of the header */
    }

    /* IMPORTANT: Push the main content down so it starts AFTER the taller header */
    .container-main {
        margin-top: 130px !important; /* Adjust this value until 'Popular Product' is fully visible */
    }

    /* Ensure the sidebar appears correctly over the content */
    .sidebar {
        top: 0;
        height: 100vh;
        z-index: 2000 !important;
    }
}
/* Ensure the sidebar overlay is the highest element when active */
#overlay {
    z-index: 1500 !important;
}

#mainSidebar.mobile-open {
    z-index: 1600 !important;
    box-shadow: 5px 0 15px rgba(0,0,0,0.2);
}
@media (max-width: 575px) {
     
    .scroll-row { display: flex; overflow-x: auto;  scrollbar-width: none; }
        
    .product-card {
        flex: 0 0 31%; /* Slightly less than 33% to show a hint of the next product */
        margin-right: 8px;
    }
}

/* Ensure the modal and its backdrop are always on the very top */
.modal {
    z-index: 2050 !important;
}
.modal-backdrop {
    z-index: 2040 !important;
}

/* Ensure the sidebar stays behind the modal layer */
.sidebar {
    z-index: 100 !important; 
}
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 10px;
}

/* Ensure the grid is hidden by default if you want to see the slider first */
.product-grid[style*="display: none"] {
    display: none !important;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    color: #673ab7 !important; /* Matches your purple theme */
    margin-bottom: 10px;
}

.product-grid {
    min-height: 400px; /* Prevents the footer from jumping up while loading */
    transition: opacity 0.3s ease;
}
body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: #f5f5f5;
  color: #111;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ===== HEADER & NAVIGATION ===== */
.topbar {
  background: #fff;
  border-bottom: 1px solid #eee;
  padding: 10px 20px;
  position: sticky;
  top: 0;
  z-index: 1000;
}

/* Container Logic */
.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap; /* Allows search to wrap */
    gap: 10px;
}

/* Desktop Alignment */
.menu-toggle { order: 1; }
.logo        { order: 2; margin-right: 20px; }
#search-form { order: 3; flex: 1; max-width: 600px; }
.actions     { order: 4; display: flex; align-items: center; gap: 15px; }

/* Mobile Logic (Screen width below 991px) */
@media (max-width: 991px) {
    .topbar-inner {
        padding: 8px 15px;
    }

    /* Keep these three on the first row */
    .menu-toggle { 
        order: 1; 
    }
    
    .logo { 
        order: 2; 
        flex-grow: 1; /* This pushes the actions to the right */
        margin-left: 10px;
    }

    .actions { 
        order: 3; 
        margin-left: auto; /* Ensures it sticks to the right */
    }

    /* Force Search to the second row */
    #search-form { 
        order: 4; 
        width: 100%; 
        max-width: 100%; 
        margin-top: 8px;
    }
    
    .logo img {
        height: 28px;
    }
}


/* Sidebar Item Styling */
.cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-bottom: 1px solid #f8f8f8;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    display: block;
}

.cart-item-price {
    font-size: 13px;
    color: #fb5353;
    font-weight: 700;
}

/* Enhanced Quantity Controller */
.qty-ctrl {
    display: flex;
    align-items: center;
    background: #f1f1f1;
    border-radius: 25px;
    padding: 2px;
}

.qty-ctrl button {
    width: 26px;
    height: 26px;
    border: none;
    background: #fff;
    color: #673ab7;
    border-radius: 50%;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.qty-ctrl button:hover {
    background: #673ab7;
    color: #fff;
}

.qty-ctrl span {
    padding: 0 10px;
    font-size: 14px;
    font-weight: 700;
}
/* The Bounce Animation */
@keyframes bounceBadge {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

/* Class to trigger the animation */
.bounce-effect {
    animation: bounceBadge 0.3s ease-out;
}

/* Animation for the Floating Cart tab */
@keyframes cartBounce {
    0% { transform: translateY(-50%) scale(1); }
    30% { transform: translateY(-50%) scale(1.2) }
    50% { transform: translateY(-50%) scale(0.9); }
    100% { transform: translateY(-50%) scale(1); }
}

.product-grid {
    transition: opacity 0.3s ease-in-out;
}
.cart-bounce-effect {
    animation: cartBounce 0.4s ease-out;
}

.menu-toggle {
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  min-width: 30px;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #333;
  transition: 0.3s;
}

.logo {
  display: flex;
  align-items: center;
  margin-right: 10px;
}

.logo img {
  height: 35px;
  width: auto;
}

/* Search Bar (Chaldal Style) */
#search-form {
  flex: 1;
  max-width: 800px;
  position: relative;
}

.search-wrap {
  display: flex;
  background: #f3f3f3;
  border-radius: 8px;
  padding: 2px 10px;
  border: 1px solid transparent;
  align-items: center;
  position: relative;
}

.search-wrap:focus-within {
  background: #fff;
  border-color: #ffde00;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

#search-input {
  width: 100%;
  height: 40px;
  border: none;
  background: transparent;
  padding: 0 10px;
  font-size: 14px;
  outline: none;
}

.search-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 5px;
}

.search-btn svg {
  width: 20px;
  height: 20px;
  stroke: var(--gray);
}

#search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #ddd;
  border-top: none;
  list-style: none;
  margin: 0;
  padding: 0;
  z-index: 9999;
  max-height: 300px;
  overflow-y: auto;
  display: none;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

#search-suggestions li {
  padding: 12px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
}

#search-suggestions li:hover {
  background: #f5f5f5;
}

/* Actions */
.actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.pill {
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid #e5e7eb;
  cursor: pointer;
  background: #fff;
  white-space: nowrap;
}

.pill.pink {
  background: var(--pink);
  color: #fff;
  border-color: var(--pink);
}

/* ===== MAIN LAYOUT ===== */
.container-main {
  display: flex;
  padding: 15px;
  gap: 20px;
  max-width: 99%;
  margin: 0 auto;
}



.category-list {
  list-style: none;
  padding: 0;
}

.cat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
}

.cat-header:hover {
  background: #f8f9fa;
  color: var(--purple);
}

/* ===== PRODUCT GRID ===== */
.product-area {
  flex: 1;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.product-card {
  background: #fff;
  border-radius: 10px;
  padding: 15px;
  text-align: center;
  border: 1px solid #eee;
  transition: 0.3s;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  transform: translateY(-3px);
}

.product-card img {
  width: 100%;
  height: 160px;
  object-fit: contain;
  margin-bottom: 12px;
}

.product-name {
  font-size: 14px;
  font-weight: 500;
  height: 40px;
  overflow: hidden;
  margin-bottom: 10px;
}

.product-price {
  font-weight: 700;
  color: var(--pink);
  font-size: 18px;
  margin-top: auto;
}

.btn-view {
  width: 100%;
  padding: 8px 0;
  background: var(--purple);
  color: #fff;
  border: none;
  border-radius: 5px;
  margin-top: 12px;
  cursor: pointer;
}

/* ===== PRODUCT DETAILS PAGE ===== */
.s_product_inner {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  padding: 40px 0;
}

.s_product_img {
  flex: 1;
  min-width: 300px;
  background: #fff;
  border-radius: 14px;
  padding: 20px;
}

.carousel-item img {
  width: 100%;
  max-height: 450px;
  object-fit: contain;
}

.s_product_text {
  flex: 1;
  min-width: 300px;
}

.s_product_text h3 { font-size: 26px; font-weight: 800; }
.s_product_text h2 { color: var(--pink); font-size: 24px; margin: 15px 0; }

/* ===== FOOTER ===== */
.footer-section {
  background: var(--dark);
  color: var(--light);
  padding: 60px 20px 20px;
  margin-top: 50px;
}

.footer-container {
  max-width: 1280px;
  margin: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
}

.footer-column {
  flex: 1;
  min-width: 200px;
}

.footer-column h4 { margin-bottom: 20px; }
.footer-column a { display: block; color: #ccc; margin-bottom: 10px; font-size: 14px; }
.footer-column a:hover { color: var(--pink); }

/* Sidebar */
.sidebar {
  width: 260px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 15px;
  height: fit-content;
  position: sticky;
  top: 80px;
}

.sidebar h3 {
  font-size: 16px;
  margin-bottom: 15px;
  font-weight: 600;
  border-bottom: 2px solid var(--purple);
  padding-bottom: 8px;
}

/* Sidebar (Left Drawer) */
@media (max-width: 991px) {
    .sidebar {
        position: fixed;
        left: -300px; /* Hidden left */
        top: 0;
        width: 280px;
        height: 100vh;
        background: #fff;
        z-index: 2000;
        transition: 0.3s ease;
        box-shadow: 5px 0 15px rgba(0,0,0,0.1);
    }
    .sidebar.active {
        left: 0; /* Slide in */
    }
}

/* Cart (Right Drawer) */
.cart-drawer {
    position: fixed;
    right: -400px; /* Hidden right */
    top: 0;
    width: 350px;
    height: 100vh;
    background: #fff;
    z-index: 2000;
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
}

.cart-drawer.active {
    right: 0; /* Slide in */
}

/* Overlay background when either is open */
.drawer-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    z-index: 1500;
}

.drawer-overlay.active {
    display: block;
}

/* Cart Icon Styling */
.cart-trigger {
    position: relative;
    cursor: pointer;
    color: var(--purple);
}

#cart-count-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--pink);
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
}

 
.footer-section { background: #fff; padding: 40px 20px; border-top: 1px solid #eee; margin-top: 50px; }
.footer-container { max-width: 1200px; margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 30px; }
.footer-brand { flex: 1; min-width: 250px; }
.footer-logo { height: 40px; margin-bottom: 15px; }
.footer-links { display: flex; flex: 2; justify-content: space-around; flex-wrap: wrap; gap: 20px; }
.footer-column h4 { font-size: 16px; font-weight: 700; margin-bottom: 15px; color: #333; }
.footer-column a { display: block; text-decoration: none; color: #666; font-size: 14px; margin-bottom: 8px; transition: 0.2s; }
.footer-column a:hover { color: #673ab7; }
.footer-bottom { text-align: center; padding-top: 30px; margin-top: 30px; border-top: 1px solid #f1f1f1; color: #999; font-size: 13px; }

/* Fixed Search Suggestions UI */
#search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border: 1px solid #eee;
    z-index: 2000;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    padding: 0;
}
/* Update these sections in your stylen.css */

.container-main {
    display: flex;
    padding: 15px;
    gap: 20px;
    transition: all 0.3s ease; /* Smooth transition when menu toggles */
}

.sidebar {
    width: 260px;
    min-width: 260px; /* Keep width consistent */
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
    z-index: 1100;
}

/* Desktop & Tablet Toggle State */
@media (min-width: 992px) {
    .sidebar.collapsed {
        margin-left: -280px; /* Slides it out of view */
        opacity: 0;
        visibility: hidden;
    }
}

/* Mobile Toggle State (Your existing logic) */
@media (max-width: 991px) {
    .sidebar {
        position: fixed;
        left: -300px;
        top: 0;
        height: 100vh;
        z-index: 3000;
        display: block !important; /* Ensure it's not hidden by display:none */
    }
    .sidebar.mobile-open {
        left: 0;
    }
}

/* ===== SIDEBAR RESPONSIVE LOGIC ===== */
.menu-toggle {
    display: flex !important; /* Force show on all screens */
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    min-width: 30px;
}
/* Desktop / Large Monitors (992px and up) */
@media (min-width: 992px) {
    .sidebar {
        display: block !important; /* Always show on desktop */
        position: sticky;
        top: 80px;
        left: 0 !important; /* Reset any mobile-open offsets */
        width: 260px;
    }
    
    .menu-close-header {
        display: none !important; /* Hide close button on desktop */
    }
    
    /* Optional: Hide the hamburger menu icon on desktop since menu is always open */
    .menu-toggle {
        display: none;
    }
}

/* Mobile / Small Screens (991px and down) */
@media (max-width: 991px) {
    .sidebar {
        display: none; /* Hidden by default on mobile */
        position: fixed;
        left: -300px;
        top: 0;
        width: 280px;
        height: 100vh;
        background: #fff;
        z-index: 3000;
        transition: 0.3s ease;
        box-shadow: 5px 0 15px rgba(0,0,0,0.1);
    }
    
    .sidebar.mobile-open {
        display: block !important; /* Show when toggled */
        left: 0;
    }
    
    .menu-toggle {
        display: flex; /* Show hamburger icon on mobile */
    }
}

@media (max-width: 768px) {
    .footer-container { flex-direction: column; text-align: center; }
    .footer-links { justify-content: center; }

}

 

/* Sidebar Close Header (Mobile Only) */
.menu-close-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 10px;
    background: #fff;
    color: 000;
    margin: -15px -15px 15px -15px; /* Aligns to edges of sidebar padding */
}

.close-btn {
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 5px;
}

/* Ensure Sidebar stays on top when open */
@media (max-width: 991px) {
    .sidebar {
        padding-top: 0 !important; /* Adjust for the new header */
        overflow-y: auto;
    }
}


/* Mobile Header Adjustment */
@media (max-width: 768px) {
    .topbar {
        height: auto !important; /* Allows header to expand for the search bar */
        padding-bottom: 10px;
        position: fixed;
        top: 0;
        width: 100%;
        z-index: 1000;
    }

    .topbar-inner {
        flex-wrap: wrap; /* Forces the search bar to the next line */
        height: auto !important;
    }

    /* Target the search form specifically */
    #search-form {
        width: 100%;
        margin: 10px 15px 5px 15px; /* Adds space around the search box */
        order: 10; /* Ensures it stays at the bottom of the header */
    }

    /* IMPORTANT: Push the main content down so it starts AFTER the taller header */
    .container-main {
        margin-top: 130px !important; /* Adjust this value until 'Popular Product' is fully visible */
    }

    /* Ensure the sidebar appears correctly over the content */
    .sidebar {
        top: 0;
        height: 100vh;
        z-index: 2000 !important;
    }
}

/* Ensure the sidebar overlay is the highest element when active */
#overlay {
    z-index: 1500 !important;
}

#mainSidebar.mobile-open {
    z-index: 1600 !important;
    box-shadow: 5px 0 15px rgba(0,0,0,0.2);
}

@media (max-width: 575px) {
    /* 1. Reset the Grid container */
    .product-grid, .scroll-row {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important; /* Force 3 columns */
        gap: 5px !important; /* Very small gap between cards */
        padding: 5px !important;
        margin: 0 !important;
    }

    /* 2. Fix the Product Card size and gaps */
    .product-card {
        width: 100% !important; /* Fill the 1/3 column exactly */
        margin: 0 !important;   /* Remove any side margins causing gaps */
        padding: 5px !important;
        min-width: 0 !important; /* Prevents card from pushing grid boundaries */
        flex: none !important;   /* Kill any flex behavior from scroll-row */
    }

    /* 3. Scale down images and text for the tight fit */
    .product-card .img-holder {
        height: 100px !important; /* Smaller height for 3-column view */
    }

    .product-card .product-name {
        font-size: 10px !important;
        line-height: 1.2;
        height: 2.4em; 
        margin-top: 5px !important;
    }

    .product-card .product-price {
        font-size: 11px !important;
        margin-bottom: 5px !important;
    }

    /* 4. Shrink the add-to-cart button */
    .round-btn {
        width: 40px !important;
        height: 40px !important;
        font-size: 12px !important;
        line-height: 40px !important;
    }
}

.footer-section h6 {
    font-size: 16px;
    color: #333;
}

.footer-section ul li {
    margin-bottom: 8px; /* Adds the vertical gap between links */
}

.footer-section ul li a {
    transition: color 0.2s;
}

.footer-section ul li a:hover {
    color: #673ab7 !important; /* Techly Brand Purple */
}

@media (max-width: 575px) {
    .footer-section h6 {
        font-size: 14px; /* Slightly smaller headers on mobile */
    }
    .footer-section ul li a {
        font-size: 12px;
    }
}

  
/* Container to align prices side-by-side */
.price-wrapper {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 5px;
}

/* The discounted (current) price */
.product.product-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: #e53e3e; /* A professional red/orange for "Sale" */
}

/* The original price with a strikethrough */
.original-price {
    font-size: 0.9rem;
    color: #718096; /* Muted gray */
    text-decoration: line-through;
}

/* Optional: Add a small badge if the discount is high */
.discount-badge {
    background-color: #38a169; /* Green */
    color: white;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
}
/* Gray out the entire card slightly */
.product-card.out-of-stock {
    opacity: 0.7;
    filter: grayscale(0.4);
    pointer-events: none; /* Disables all clicks on the card */
}

/* Position the "Out of Stock" text over the image */
.img-holder {
    position: relative;
}

.stock-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    z-index: 2;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Style the disabled button */
.round-btn.disabled {
    background: #cbd5e0 !important;
    color: #718096 !important;
    cursor: not-allowed;
    transform: none !important;
}


/* Sidebar Scrolling */
.sidebar {
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto; /* Enable scroll */
    padding-bottom: 100px; /* Space for bottom content */
    background: #fff;
    border-right: 1px solid #eee;
}

/* Custom Scrollbar for a cleaner look */
.sidebar::-webkit-scrollbar {
    width: 5px;
}
.sidebar::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 10px;
}

/* Category Item Styling */
.category-item {
    list-style: none;
    border-bottom: 1px solid #f9f9f9;
}

.cat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    transition: background 0.2s;
}

.cat-header:hover {
    background: #f4f0ff;
}

.cat-header a {
    text-decoration: none;
    color: #333;
    flex-grow: 1; /* Makes the text area clickable to trigger the div onclick */
}

/* Arrow Rotation */
.arrow {
    font-size: 10px;
    transition: transform 0.3s ease;
    color: #888;
}

.arrow.rotate {
    transform: rotate(90deg);
}

/* Subcategory List */
.subcategory-list {
    background: #fcfcfc;
    padding: 5px 0;
    margin: 0;
    list-style: none;
}

.subcategory-list li {
    padding: 8px 35px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
}

.subcategory-list li:hover {
    color: #673ab7;
    background: #f0ebff;
}

