/* ===== GLOBAL FONT OVERRIDE ===== */
:root {
  --primary-green: #2e8b57;
  --bg-page: #f9fafb;
}

html,
body {
  font-family: "IBM Plex Sans", sans-serif;
  background-color: var(--bg-page);
}

/* Force all common elements to inherit Poppins */
*,
*::before,
*::after {
  font-family: inherit;
}

/* Explicit overrides for form controls (important) */
input,
select,
textarea,
button,
option {
  font-family: "IBM Plex Sans", sans-serif;
}

header {
  background-color: #2e8b57; /* Updated to the green color */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  padding: 1rem 0;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: center; /* Center content horizontally */
  flex-wrap: wrap; /* Allow wrapping on smaller screens */
  padding: 0 1rem;
}

.header-top img {
  height: 52px;
  margin-right: 1rem;
}

.header-top h1 {
  font-size: 1.6rem;
  font-weight: 600;
  opacity: 0.95;
}

.header-top .logo-text {
  /* Changed from .logo to .logo-text to avoid conflict */
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 1.5rem; /* Adjust for responsiveness */
  color: #ffffff; /* Changed logo text color to white for contrast */
  text-align: center; /* Center text on smaller screens */
  font-weight: 600; /* Added font-weight */
}

.hero-logo {
  height: 56px; /* Bigger logo */
  flex-shrink: 0;
  max-width: 100%;
  cursor: pointer;
  transition: transform 0.25s ease;
}

.hero-logo:hover {
  transform: scale(1.05);
}

.hero-header {
  background-color: #2e8b57;
  padding: 1rem 0 1.25rem;
}

.hero-top {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;

  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.hero-top .search-container {
  margin: 0; /* kill margin: auto */
  width: 600px; /* controlled width */
  max-width: 100%;
  flex-shrink: 0;
}

.hero-top .search-container input {
  height: 44px;
  border-radius: 6px;
}

.hero-top .cart-container {
  flex-shrink: 0;
  margin-left: 0.5rem;
}

.hero-text {
  max-width: 1200px;
  margin: 1.5rem auto 0;
  padding: 0 1.5rem;
  text-align: center;
}

.hero-text h2 {
  color: #ffffff;
}

.hero-text p {
  color: rgba(255, 255, 255, 0.85);
}

/* For breaking the logo text into multiple lines on smaller screens */
.v-line {
  white-space: nowrap;
  font-family: "IBM Plex Sans", sans-serif;
}

#navbar ul {
  display: flex;
  justify-content: center;
  gap: 2rem;
  list-style: none;
  padding: 0;
  margin: 1rem 0 0 0;
  flex-direction: row; /* Always side-by-side */
  flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

#navbar .nav-link {
  color: #ffffff; /* Changed nav link color to white for contrast */
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
  text-decoration: none; /* Ensure no underline */
}

#navbar .nav-link:hover,
#navbar .nav-link.active {
  background-color: rgba(
    255,
    255,
    255,
    0.2
  ); /* Light white background on hover */
  color: #ffffff; /* Keep text white */
}

/* Cart Icon specific styles for the header-right section */
.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 1rem; /* Space below nav links */
}

.header-right .cart-icon-wrapper .cart-icon:hover {
  transform: scale(1.1);
}

/* Responsive adjustments for header */
@media (min-width: 768px) {
  .header-top {
    justify-content: center; /* Center content horizontally */
    text-align: center; /* Center text */
  }
  .header-top .logo-text {
    font-size: 2rem;
  }
  #navbar ul {
    gap: 2rem; /* Maintain gap */
    margin-top: 1rem; /* Space below header-top */
  }
}

@media (max-width: 767px) {
  .header-top {
    flex-direction: column;
    text-align: center;
  }
  .v-line {
    margin-left: 0 !important; /* reset spacing on desktop if needed */
  }
  .header-top img {
    margin-right: 0;
    margin-bottom: 0.5rem;
  }
  #navbar ul {
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap; /* Allow wrapping if space is tight */
  }
  #navbar .nav-link {
    width: auto; /* Allow links to size naturally */
    margin: 0; /* Remove auto margins that might center them individually */
  }
}
/* Menu toggle for mobile (hidden on desktop) */
#menu-toggle {
  display: none;
}

/* Search and Cart Wrapper */
.search-wrapper {
  display: flex;
  flex-direction: row; /* Always side-by-side */
  align-items: center;
  justify-content: center; /* Center content horizontally */
  padding: 1.5rem 1rem;
  max-width: 800px; /* Reduced max-width for the wrapper */
  margin: 0 auto;
  gap: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
  border-radius: 1.25rem;
  background: #ffffff;
  border: 1px solid #e5e7eb;
}

.search-container {
  display: flex;
  align-items: center;
  position: relative;
  flex-grow: 1; /* Allow it to grow */
  max-width: 400px; /* Reduced max-width for the search input field */
  margin: 0 auto;
  position: relative;
  transition: transform 0.3s ease;
}

.search-container:focus-within {
  transform: scale(1.02);
}

#searchInput {
  height: 50px;
  padding-left: 1.5rem;
  padding-right: 3.5rem;
  border: 1px solid #e5e7eb;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

#searchInput:focus {
  border-color: var(--primary-green);
  box-shadow: 0 10px 15px -3px rgba(46, 139, 87, 0.1);
}

.search-container input {
  flex-grow: 1;
  padding: 0.75rem 1rem;
  padding-right: 3rem; /* Space for search icon */
  border-radius: 9999px; /* Fully rounded */
  border: 1px solid #e0e0e0;
  font-size: 1rem;
  background-color: #ffffff; /* Keep input background white */
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.search-container input:focus {
  border-color: #4caf50; /* Green focus border */
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1); /* Green shadow */
  outline: none;
}

.search-container button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
}

.search-container button .fas.fa-search {
  font-size: 1.25rem;
  color: #757575;
  transition: color 0.2s ease;
}

.search-container button:hover .fas.fa-search {
  color: #4caf50; /* Green hover */
}

.cart-container {
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cart-container .cart-icon {
  width: 32px;
  height: 35px;
  transition: transform 0.2s ease;
}

.cart-container .cart-icon:hover {
  transform: scale(1.1);
}

.cart-container .cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background-color: #ef4444;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 9999px;
  line-height: 1;
}

.cart-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background-color: red;
  color: white;
  border-radius: 50%;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 20px; /* Ensure it's a circle */
  text-align: center;
  line-height: 1;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  animation: pulse-green 2s infinite;
}

.trust-badges {
  background: white;
  padding: 1rem;
  border-radius: 100px;
  box-shadow: var(--shadow-sm);
  border: 1px solid #f3f4f6;
}

/* Products Container */
.products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  padding: 1rem;
  max-width: 1400px;
  margin: 0 auto 2rem;
  grid-auto-flow: dense;
}


/* Desktop: max 5 cards */
@media (min-width: 1200px) {
  .products {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    grid-auto-flow: dense;
  }
}

/* Laptop / small desktop */
@media (min-width: 992px) and (max-width: 1199px) {
  .products {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 991px) {
  .products {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Mobile: exactly 2 cards per row */
@media (max-width: 767px) {
  .products {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    padding: 0.5rem;
  }
}

.menu-item {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;

  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.98),
    rgba(249, 250, 251, 0.92)
  );

  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.04);

  height: auto;

  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);

  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;

  overflow: hidden;
  position: relative;

  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);

  gap: 1rem;
}

.menu-item:hover {
  transform: translateY(-10px);

  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

  border-color: rgba(46, 139, 87, 0.2);
}

.menu-item .product-image {
  width: 100%;
  height: 150px;
  object-fit: contain;
  margin-bottom: 0.4rem;
}

.menu-item img {
  border-radius: 12px;
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background-color: #f9fafb;
  margin-bottom: 0.75rem;
}

.menu-item h3 {
  font-size: 0.9rem;
  line-height: 1.2;
  margin-top: 0.25rem 0;
  margin-bottom: 0.25rem;
}

.menu-item p {
  font-size: 0.75rem;
  margin: 0.15rem 0;
  color: #666;
}

.menu-item .price {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0.25rem 0;
}

.menu-item .add-to-cart-btn {
  margin-top: auto;
}

.menu-item-info h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 0.5rem;
}

.menu-item-info .price {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary-green);
}

/* Cart Badge Pulse */
@keyframes pulse-green {
  0% {
    box-shadow: 0 0 0 0 rgba(46, 139, 87, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(46, 139, 87, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(46, 139, 87, 0);
  }
}

.menu-item::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at top,
    rgba(76, 175, 80, 0.08),
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.menu-item:hover::before {
  opacity: 1;
}

.menu-item:hover .product-image {
  transform: scale(1.04);
}

.product-image {
  transition: transform 0.35s ease;
}

.menu-item:hover .price {
  color: #15803d;
  transform: scale(1.05);
  transition: all 0.3s ease;
}

.product-image {
  width: 160px; /*from 100% */
  margin: 0 auto 0.75rem;
  max-width: 200px; /* Constrain image size */
  height: auto;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  object-fit: contain; /* Ensure image fits without distortion */
  aspect-ratio: 1 / 1;
}

.menu-item h3 {
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 1.25rem;
  color: #333;
  margin-bottom: 0.35rem;
  margin-top: 0.75rem;
  font-weight: 600;

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.menu-item p {
  color: #666;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.menu-item hr {
  width: 100%;
  border: none;
  border-top: 1px solid #eee;
  margin: 0.75rem 0;
}

.base-price-display {
  font-size: 0.8rem;
  color: #888;
  /* Removed text-decoration: line-through; */
  margin-bottom: 0.5rem;
  opacity: 0.7;
}

.price {
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #4caf50;
  margin-bottom: 0.4rem;
  margin: 0.5rem 0 0.75rem;
  letter-spacing: -0.5px;
}

.product-options {
  width: 100%;
  margin-bottom: 0.4rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* Align labels to the left */
  margin-top: 0.75rem;
  gap: 0.4rem;
}

.product-options label {
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.hp-select,
.quantity-input {
  width: 100%;
  padding: 0 0.4rem;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 0.8rem;
  background-color: #f9f9f9;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23666%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-6.5%200-12.3%203.2-16.1%208.1-3.9%204.9-4.7%2011.5-2.1%2017.9l139%20140.1a17.6%2017.6%200%200%200%2025.2%200l139-140.1c2.6-6.5%201.8-13.2-2.1-17.9z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  background-size: 12px;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  height: 32px;
}

.hp-select:focus,
.quantity-input:focus {
  border-color: #4caf50;
  box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
  outline: none;
}

.quantity-section {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
}

.quantity-wrapper,
.product-stock-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 0.5rem;
  gap: 0.5rem;
}

.quantity-wrapper label,
.product-stock-wrapper label {
  flex-basis: 80px;
  flex-shrink: 0;
  text-align: left;
}

.quantity-input {
  flex-grow: 1;
  max-width: 80px;
  text-align: center;
}

.product-stock {
  font-size: 0.75rem;
  color: #555;
  margin-bottom: 0.4rem;
  flex-grow: 1;
  text-align: center;
  max-width: 80px;
}

.stock-value {
  font-weight: 600;
  color: #16a34a;
}

.stock-value.low {
  color: #dc2626;
}

.add-to-cart-btn {
  background-color: #4caf50;
  margin-top: auto; 
  color: white;
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(76, 175, 80, 0.3);
  width: 100%;
  margin-top: 1.25rem;
  letter-spacing: 0.02px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
}

.add-to-cart-btn:hover {
  background-color: #388e3c;
  box-shadow: 0 6px 15px rgba(76, 175, 80, 0.4);
  transform: translateY(-1px);
}

#messageBoxClose {
  background-color: #4caf50;
}

#messageBoxClose:hover {
  background-color: #388e3c;
}

@media (min-width: 768px) {
  .search-wrapper {
    padding: 1.5rem 2.5rem;
  }

  .header-top {
    justify-content: center; /* Center content horizontally */
    text-align: center; /* Center text */
  }

  .header-top .logo {
    font-size: 2rem;
  }

  #navbar ul {
    gap: 2rem; /* Maintain gap */
    margin-top: 1rem; /* Space below header-top */
  }
}

@media (max-width: 767px) {
  .header-top {
    flex-direction: column;
    text-align: center;
  }

  .v-line {
    margin-left: 0 !important;
  }

  .header-top img {
    margin-right: 0;
    margin-bottom: 0.5rem;
  }

  #navbar ul {
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
  }

  #navbar .nav-link {
    width: auto;
    margin: 0;
  }

  /* Compact 2-Column Grid */
  .products {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.4rem;
    padding: 0.4rem;
  }

  /* Boxed and Shorter Card Layout */
  .menu-item {
    max-width: none;
    margin: 0;
    padding: 0.4rem;
    border-radius: 4px;
    gap: 0.2rem;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  .menu-item:hover {
    transform: none;
  }

  .product-image {
    width: 100%;
    max-width: 100%;
    margin-bottom: 0.2rem;
    border-radius: 2px;
  }

  .menu-item h3 {
    font-size: 0.85rem;
    margin: 0.1rem 0;
    line-height: 1.1;
    text-align: left;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 1.8em;
  }

  .menu-item p {
    font-size: 0.7rem;
    margin-bottom: 0.1rem;
    text-align: left;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #666;
  }

  .price {
    font-size: 0.95rem;
    margin: 0.1rem 0;
    text-align: left;
    font-weight: 700;
  }

  .base-price-display {
    font-size: 0.6rem;
    margin-bottom: 0.2rem;
    text-align: left;
    opacity: 0.8;
  }

  .product-options {
    margin-bottom: 0.2rem;
    gap: 0.1rem;
    flex-grow: 1;
  }

  .product-options label {
    font-size: 0.65rem;
    margin-bottom: 1px;
  }

  /* Compact dropdowns and inputs */
  .hp-select,
  .quantity-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
  }

  .hp-select {
    height: 32px;
    font-size: 0.8rem;
    line-height: 1.2;

    padding-left: 0.5rem;
    padding-right: 1.8rem;   

    background-position: right 0.6rem center;
    background-size: 0.65rem;

    text-align: left;
  }

  .quantity-wrapper, .product-stock-wrapper {
    gap: 0.2rem;
    margin-top: 0.1rem;
  }

  .quantity-wrapper label, .product-stock-wrapper label {
    font-size: 0.65rem;
  }

  .quantity-input {
    height: 32px;                 /* match select */
    font-size: 0.8rem;

    width: 44px;                  /* fixed width */
    max-width: 44px;

    padding: 0;
    text-align: center;  
  }

  /* Anchored Add to Cart Button */
  .add-to-cart-btn {
    padding: 0.4rem;
    font-size: 0.8rem;
    margin-top: auto;
    border-radius: 3px;
    width: 100%;
  }

  input[type="number"]::-webkit-inner-spin-button,
  input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }

  input[type="number"] {
    -moz-appearance: textfield;
  }
}

@media (max-width: 767px) {
  .menu-item {
    border-radius: 8px;                 
    padding: 0.5rem;                    
  }

  .product-image {
    height: 110px;                      
    object-fit: contain;
    background: #f9fafb;
    border-radius: 6px;
  }

  /* Title breathing room */
  .menu-item h3 {
    margin-top: 0.15rem;
    margin-bottom: 0.15rem;
  }

  .price {
    font-size: 1.05rem;                 
    color: #16a34a;
  }

  .product-options {
    flex-grow: 0;                       
  }

  .add-to-cart-btn {
    padding: 0.5rem;
    border-radius: 6px;
  }
}

@media (min-width: 1024px) {
  .products {
    margin-top: 1.5rem;
  }
}

.order-hero {
  text-align: center;
  padding: 4rem 1rem 3rem;
  background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
}

.order-hero .search-wrapper {
  margin-top: 2.5rem;
}

.order-hero h2 {
  font-size: clamp(2rem, 3vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.02em; /* Apple-style */
  color: #111827; /* near-black */
}

.order-hero p {
  max-width: 520px;
  margin: 0.6rem auto 0;
  font-size: 1rem;
  color: #6b7280; /* neutral gray */
  line-height: 1.6;
}

.flex.justify-center span {
  color: #6b7280;
  font-weight: 500;
}

.flex.justify-center i {
  color: #16a34a;
  font-size: 0.95rem;
}

@media (max-width: 480px) {
  .search-wrapper {
    padding: 1rem 0.75rem; /* less padding so it doesn't hit edges */
    margin: 1.5rem auto;
    max-width: calc(100% - 1rem); /* keeps space from screen edges */
  }

  .search-container {
    max-width: 100%;
  }

  #searchInput {
    height: 46px;
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .flex.justify-center {
    padding: 0 1rem;
    gap: 1rem;
    flex-wrap: wrap;
  }

  .flex.justify-center span {
    font-size: 0.85rem;
    justify-content: center;
    white-space: nowrap;
  }

  .flex.justify-center i {
    font-size: 0.9rem;
  }
}

.hero-top {
  justify-content: flex-start;
}

.hero-top .logo-link {
  margin-right: 1.25rem;
}

.category-btn {
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  background: #f3f4f6;
  transition: all 0.25s ease;
}

.category-btn:hover {
  background: #dcfce7;
  color: #15803d;
}

.category-btn.active {
  background: #16a34a;
  color: white;
}

@media (max-width: 640px) {
  .cart-container {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 50;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 42px;
    height: 42px;
    border-radius: 50%;

    background: transparent;
    backdrop-filter: none;
    box-shadow: none;
  }

  .cart-container .cart-icon {
    width: 26px;
    height: 26px;
    object-fit: contain;
    transition: transform 0.2s ease;
  }

  .cart-container:hover .cart-icon {
    transform: scale(1.1);
  }

  .cart-container .cart-badge {
    top: -6px;
    right: -6px;

    font-size: 0.65rem;
    min-width: 16px;
    height: 16px;
    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 9999px;
    line-height: 1;
  }

  .cart-icon-wrapper {
    position: relative;
    width: 28px;
    height: 28px;
  }

  .cart-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
  }

  .hamburger-menu {
    margin-left: -3px;
  }

  .search-container {
    margin-left: 8px;
  }
}

/* =========================
   HAMBURGER MENU
   ========================= */
.hamburger-menu {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hamburger-menu span {
  width: 22px;
  height: 2px;
  background: white;
  border-radius: 2px;
  transition: 
    transform 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.25s ease,
    background-color 0.3s ease;
  transform-origin: center;
}

/* Active state → morph into X */
.hamburger-menu.active span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.hamburger-menu.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.hamburger-menu.active span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* =========================
   MOBILE NAV DRAWER (SMOOTH)
   ========================= */

.mobile-nav {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);

  opacity: 0;
  pointer-events: none;

  transition: opacity 0.4s ease;
  z-index: 99999;
}

.mobile-nav.active {
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav-content {
  background: white;
  width: 75%;
  max-width: 260px;
  height: 100%;
  padding: 1.5rem;

  transform: translateX(-100%);
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);

  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Slide in */
.mobile-nav.active .mobile-nav-content {
  transform: translateX(0);
}

/* =========================
   MOBILE HEADER LAYOUT
   ========================= */
@media (max-width: 640px) {
  .hamburger-menu {
    display: flex;
  }

  .hero-top {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
  }

  .search-container {
    flex: 1 1 160px;
    max-width: 180px;
  }

  .logo-link {
    display: none;
  }

  .cart-container {
    position: relative;
    top: auto;
    right: 14px;
  }
}

/* =========================
   SORT BAR (SHOPEE STYLE)
   ========================= */

.sort-bar {
  display: flex;
  align-items: center;
  justify-content: center;   /* 🔥 centers the whole bar */
  gap: 0.75rem;

  max-width: 1200px;
  margin: 1.25rem auto 1rem; /* center horizontally */
  padding: 0 1rem;
  flex-wrap: wrap;           /* safe on smaller screens */
}

.sort-label {
  font-size: 0.9rem;
  color: #666;
}

.sort-btn {
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  font-size: 0.85rem;
  font-weight: 500;
}

.sort-btn.active {
  background: #22c55e;
  color: #fff;
  border-color: #22c55e;
}

.sort-select {
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  font-size: 0.85rem;
}

/* =========================
   MOBILE HERO ALIGNMENT TWEAK
   ========================= */
@media (max-width: 640px) {
  .hero-top {
    padding-left: 0.75rem;   /* keep hamburger comfy */
    padding-right: 0.5rem;   /* tighter right edge */
  }
  .hero-top .search-container {
    margin-left: 6px;   /* 👈 main tweak */
  }
  .hero-top .cart-container {
    margin-left: 6px;
  }
  .hero-top .search-container input {
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
  }
}

/* =========================
   MOBILE HEADER — FINAL ALIGNMENT FIX
   ========================= */
@media (max-width: 640px) {

  .hero-top {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;

    padding: 0.75rem;
    gap: 0.5rem;
  }

  /* Hamburger (left) */
  .hamburger-menu {
    justify-self: start;
    margin: 0;
  }

  /* Search (perfect center) */
  .hero-top .search-container {
    justify-self: center;
    width: 100%;
    max-width: 330px; /* sweet spot for phones */
    margin: 0;
  }

  .hero-top .search-container input {
    width: 100%;
    height: 42px;
    border-radius: 9999px;
  }

  /* Cart (right) */
  .hero-top .cart-container {
    justify-self: end;
    margin: 0;
    right: 0;
    top: auto;
    position: relative;
  }

  .cart-container .cart-icon {
    width: 26px;
    height: 26px;
  }
}

.category-filters {
  display: flex;
  gap: 0.75rem;
  padding: 0 1rem;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .category-filters {
    justify-content: center;
    overflow: visible;
  }
}

@media (max-width: 767px) {
  .category-filters {
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  /* Hide scrollbar but keep scroll */
  .category-filters::-webkit-scrollbar {
    display: none;
  }
}


/* Hide scrollbar (still scrollable) */
.category-filters::-webkit-scrollbar {
  display: none;
}

/* =========================
   REMOVE ALL SHADOW GUTTERS (MOBILE)
   ========================= */
@media (max-width: 768px) {

  /* Header */
  header,
  .hero-header,
  .site-header {
    box-shadow: none !important;
  }

  /* Containers */
  .search-wrapper,
  main,
  section,
  .container {
    box-shadow: none !important;
  }

  /* Cards */
  .menu-item {
    box-shadow: none !important;
  }

  /* Kill fake elevation edges */
  body {
    background: #f9fafb;
  }
}

.mobile-nav-content a {
  display: flex;
  align-items: center;
  gap: 0.75rem;

  font-size: 0.95rem;
  font-weight: 500;
  color: #111827;
  text-decoration: none;
}

.mobile-nav-content img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.mobile-nav-content a:hover {
  color: #16a34a;
}

.mobile-nav-content a:hover img {
  transform: scale(1.1);
  transition: transform 0.2s ease;
}

.mobile-nav-close {
  position: absolute;
  top: 1rem;
  right: 1rem;

  width: 36px;
  height: 36px;

  background: none;
  border: none;
  padding: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;
  border-radius: 50%;

  transition: background-color 0.2s ease;
}

.mobile-nav-close img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.mobile-nav-close:hover {
  background-color: rgba(22, 163, 74, 0.1);
}
