/* =========================================================
   GLOBAL BASE
========================================================= */

body {
  font-family: 'Roboto', Arial, sans-serif;
  font-weight: 400;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  overflow-x: hidden;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* =========================================================
   FOOTER
========================================================= */

header,
footer {
  width: 100%;
  background: #0b6b6a;
  color: #fff;
  text-align: center;
}

footer p {
  margin: 0;
  font-size: 0.9rem;
}

.s4l-footer {
  color: #fff;
  padding: 0;
  font-size: 14px;
}

.footer-columns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  width: 100%;
  height: auto;
  margin: 3rem auto;
  text-align: left;
  padding-left: 20px;
}

.footer-col h4 {
  margin-bottom: 10px;
  font-size: 16px;
}

.footer-col p {
  padding-top: 20px;
}

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

.footer-col ul li {
  margin-bottom: 8px;
  transition: 0.3s;
}

.footer-col ul li a {
  color: #d7e6e6;
  text-decoration: none;
  transition: color 0.3s;
}

.footer-col ul li a:hover {
  text-decoration: underline 0.8px #f18c28;
  margin: 3px;
  font-size: 18px;
  font-weight: 800;
}

.footer-top {
  width: 100%;
  background: #378188;
  color: #fff;
  text-align: center;
  padding: 15px 0;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease;
}

.back-to-top {
  color: #ccc;
  text-decoration: none;
}

.footer-top:hover {
  background: #086160;
}

.footer-logo {
  font-size: 18px;
  font-weight: bold;
  letter-spacing: 3px;
  text-decoration: none;
  display: inline-block;
  padding-top: 15px;
}

.logo-orange {
  color: #f28c28;
}
.logo-white {
  color: #fdf4e7;
}
.logo-blue {
  color: #00bfff;
}

@media (max-width: 1024px) {
  .footer-columns {
    grid-template-columns: repeat(2, 1fr);
    height: auto; /* free the height so wrapping works */
    padding-left: 20px;
  }
}

@media (max-width: 480px) {
  .footer-columns {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding-left: 20px;
  }
}

/* =========================================================
   HEADER BASE
========================================================= */

.site-notice {
  background: #fdf4e7;
  color: #2f2f2f;
  font-size: 14px; /* up from 13px */
  font-weight: 500; /* key change */
  text-align: center;
  letter-spacing: 0.3px;
  padding: 8px 12px; /* a bit more air */
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.s4l-header-desktop {
  width: 100%;
  display: flex;
  justify-content: center;
  color: #fff;
  padding: 0;
  margin: 0;
  position: relative;
  overflow: visible;
  z-index: 5000;
}

.header-container {
  width: 100%;
  display: flex;
  height: 150px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 0;
  z-index: 5000;
  position: relative;
  overflow: visible;
}

.desktop-header {
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding-bottom: 40px;
  position: relative;
  overflow: visible;
}

.header-logo {
  display: flex;
  align-items: left;
  font-size: 28px;
  font-weight: bold;
  letter-spacing: 3px;
  text-decoration: none;
  margin: 6px 0;
  padding-left: 20px;
}

.header-nav {
  margin: 10px 0;
}

.header-nav a {
  margin: 0 15px;
  color: #fdf4e7;
  text-decoration: none;
  font-weight: 500;
}

.header-nav a:hover {
  text-decoration: underline 0.8px #f18c28;
}

/* =========================================================
   SEARCH BAR
========================================================= */

.header-search {
  position: relative;
  display: flex;
  align-items: center;
  border-radius: 5px;
  z-index: 99999;
  overflow: visible;
}

#desktop-search-input {
  border: none;
  outline: none;
  width: 700px;
  height: 36px;
  padding: 0 10px;
  font-size: 15px;
  color: #094949;
  border-radius: 5px 0 0 5px;
}

.header-search button {
  background: #f18c28;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  width: 40px;
  border-radius: 0 5px 5px 0;
}

.header-search button img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

/* Base autocomplete styling (shared by desktop + mobile) */
.search-autocomplete,
.desktop-ac,
.mobile-ac {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  max-height: 260px;
  background: #ffffff;
  border-radius: 6px;
  border: 1px solid #ccc;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  overflow-y: auto;
  z-index: 50000;

  display: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease;
}

.search-autocomplete.show,
.desktop-ac.show,
.mobile-ac.show {
  display: block;
  opacity: 1;
  visibility: visible;
}

/* Autocomplete item */
.ac-item {
  display: flex;
  align-items: center;
  padding: 10px;
  cursor: pointer;
}

.ac-item:hover {
  background: #f5f5f5;
}

.ac-thumb {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  margin-right: 10px;
  object-fit: cover;
}

.ac-details {
  display: flex;
  flex-direction: column;
}

.ac-name {
  font-weight: 600;
  color: #222;
}

.ac-cat {
  font-size: 13px;
  color: #777;
}

/* =========================================================
   SIGN IN
========================================================= */

.header-icons {
  width: 150px;
  display: flex;
  margin-right: 20px;
  align-items: center;
  gap: 20px;
}

.account-menu {
  position: relative;
  margin-bottom: 10px;
}

#accountBtnDesktop,
#accountBtnMobile {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.account-dropdown .auth {
  text-decoration: none;
}

.account-dropdown {
  position: absolute;
  right: 0;
  top: 110%;
  background: #167c7c;
  border-radius: 8px;
  min-width: 160px;
  padding: 6px 0;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  display: none;
  z-index: 99999;
}

.account-dropdown.open {
  display: block;
}

.account-dropdown a,
.account-dropdown button {
  display: block;
  width: 100%;
  padding: 8px 14px;
  background: none;
  border: none;
  color: #fff;
  text-align: left;
  font-size: 14px;
  cursor: pointer;
}

.account-dropdown a:hover,
.account-dropdown button:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* === Basket Base === */
.basket-wrapper {
  align-items: center;
  justify-content: center;
  margin-top: 15px;
  border: none;
  position: relative;
  display: inline-flex;
  width: auto !important;
  height: auto !important;
  padding: 0;
  margin: 0;
  overflow: visible;
}

.basket-shell {
  position: relative;
  width: 28px;
  height: 17px;
  border: 1px solid #fff !important;
  border-radius: 0 0 7px 7px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 0;
  cursor: pointer;
}

.basket-handle {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  width: 15px;
  height: 18px;
  border: 1px solid #fff !important;
  border-radius: 12px 12px 0 0;
  border-bottom: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* === Quantity Badge === */
.basket-qty {
  position: absolute;
  top: 2px;
  right: -6px;
  min-width: 10px;
  height: 10px;
  padding: 0 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font:
    600 12px/1 system-ui,
    sans-serif;
  background: #ff7a00;
  color: white;
  border-radius: 999px;
  pointer-events: none;
}

.basket-qty.hide {
  display: none;
}

.basket-qty.bump {
  animation: s4l-bump 220ms ease;
}

@keyframes s4l-bump {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
  100% {
    transform: scale(1);
  }
}

.basket-wrapper::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 35px; /* invisible hover bridge*/
  background: transparent;
}

/* =============================================
   PERFECTLY MATCHED FADE FOR BOTH BASKET PARTS
   (Shell & Handle fade equally)
============================================= */

/* First: no full opacity fade */
.basket-wrapper.empty .basket-shell,
.basket-wrapper.empty .basket-handle {
  opacity: 1; /* full opacity, don't fade the element itself */
}

/* Fade the border colour instead */
.basket-wrapper.empty .basket-shell,
.basket-wrapper.empty .basket-handle {
  border-color: rgba(255, 255, 255, 0.45) !important;
  transition: border-color 0.25s ease;
}

/* Badge fades slightly */
.basket-wrapper.empty .basket-qty {
  opacity: 0.65;
}

/* When items exist, restore strong borders */
.basket-wrapper:not(.empty) .basket-shell,
.basket-wrapper:not(.empty) .basket-handle {
  border-color: rgba(255, 255, 255, 1) !important;
}

/* =========================================================
   MINI CART
========================================================= */

/* Only open mini-cart when hovering the BASKET SHELL or the mini-cart itself */
/* Hide by default */
.basket-wrapper .mini-cart {
  display: none;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}

/* Only show minicart if basket has items */
.basket-wrapper.has-items:hover .mini-cart,
.basket-wrapper.has-items .mini-cart:hover {
  display: block;
  opacity: 1;
  visibility: visible;
}

.basket-wrapper.open .mini-cart {
  display: block;
  opacity: 1;
  visibility: visible;
}

.basket-wrapper.empty {
  cursor: default;
}

.mini-cart {
  position: absolute;
  top: 50px;
  right: -100px;
  width: 380px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  padding: 16px;
  display: none;
  opacity: 0;
  /* Start closed */
  opacity: 0;
  transform: translateY(-10px);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    visibility 0.25s ease;
  visibility: hidden;
  transition:
    opacity 0.25s ease,
    visibility 0.25s ease;
  z-index: 99999;
}

/* One row = 3 columns: [thumb] [title + price×qty] [subtotal] */
.mini-cart-item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #e6e6e6;
}

/* Main items scroll box */
.mini-cart-items {
  max-height: 260px; /* <<< controls scroll length */
  overflow-y: auto; /* <<< enables scroll */
  padding: 0;
  margin: 0 0 10px 0;
  list-style: none;
}

/* Hide scrollbar (optional) */
.mini-cart-items::-webkit-scrollbar {
  width: 6px;
}

.mini-cart-thumb {
  width: 50px;
  height: 50px;
  border-radius: 6px;
  object-fit: cover;
  background: #f3f3f3;
}

/* Middle column: title + price × qty */
.mini-cart-info {
  min-width: 0; /* prevents title from pushing subtotal off-screen */
}

.mini-cart-title {
  font-size: 15px;
  font-weight: 600;
  color: #094949;
  margin-bottom: 4px;
}

.mini-cart-meta {
  font-size: 13px;
  color: #666;
  margin-top: 8px;
}

/* PRICE COLUMN — FIXED WIDTH, RIGHT SIDE */
.mini-cart-price {
  width: 70px;
  font-weight: 600;
  text-align: right;
  color: #094949;
}

.mini-cart-name {
  font-weight: 600;
  color: #094949;
  font-size: 15px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-cart-details {
  font-size: 13px;
  color: #666;
}

/* Right column: subtotal pinned right */
.mini-cart-sub {
  font-weight: 700;
  color: #094949;
  white-space: nowrap;
  text-align: right;
  margin-top: 24px;
}

.mini-cart-qty {
  opacity: 0;
}

/* TOTAL */
.mini-cart-total {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #ddd;
  font-size: 16px;
  font-weight: 700;
  color: #094949;
}

.mini-cart-total-value {
  color: #ff8a2a;
}

.view-cart-btn {
  display: block;
  text-align: center;
  margin-top: 12px;
  padding: 8px 0;
  background: #0b6b6a;
  color: #fff;
  border-radius: 4px;
  text-decoration: none;
}

.view-cart-btn:hover {
  background: #095754;
}

/* =========================================================
   GLOBAL SAFETY FOR SLIDERS
========================================================= */

.s4l-hero-slider,
#featured-list,
#subcategory-cards,
#category-product-grid {
  overflow-x: hidden !important;
}

/* Default: Desktop ON, Mobile OFF */
.s4l-header-mobile {
  display: none;
}
.s4l-header-desktop {
  display: flex;
}

/* =========================================================
   MOBILE + TABLET HEADER
   (Triggers below 1280px)
========================================================= */

@media (max-width: 1280px) {
  .s4l-header-desktop {
    display: none;
  }
  .s4l-header-mobile {
    display: flex;
  }

  /* Base container */
  .s4l-header-mobile {
    width: 100%;
    background: #0b6b6a;
    padding: 10px 0 14px 0;
    position: relative;
    z-index: 9999;
  }

  .mobile-header-container {
    width: 100%;
    padding: 0 12px;
  }

  .mobile-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  /* =========================================================
   ROW 1 — LOGO LEFT | BASKET + SIGN-IN RIGHT
========================================================= */

  .mobile-top-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  /* Logo */
  .mobile-logo {
    display: flex;
    align-items: center;
    font-size: 28px;
    font-weight: bold;
    text-decoration: none;
    letter-spacing: 2px;
  }

  /* Right-side icons */
  .mobile-right-icons {
    display: flex;
    align-items: center;
    gap: 18px;
  }

  /* Basket */

  .mobile-basket {
    margin-top: 25px;
  }

  .mobile-basket .basket-shell {
    position: relative;
    width: 28px;
    height: 17px;
    border: 1px solid #fff !important;
    border-radius: 0 0 7px 7px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    cursor: pointer;
  }

  .mobile-basket .basket-handle {
    position: absolute;
    top: -13px;
    left: 50%;
    transform: translateX(-50%);
    width: 15px;
    height: 18px;
    border: 1px solid #fff !important;
    border-radius: 12px 12px 0 0;
    border-bottom: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-basket .basket-qty {
    position: absolute;
    bottom: -4px;
    right: -6px;
    background: #f28c28;
    color: white;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 10px;
  }

  /* Sign in */
  .mobile-right-icons .sign-in-link {
    font-size: 14px;
    color: #fdf4e7;
    text-decoration: none;
  }

  /* =========================================================
   ROW 2 — MENU + SEARCH
========================================================= */

  .mobile-menu-col {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 14px;
  }

  /* NAV MENU */
  .mobile-nav {
    display: flex;
    justify-content: center;
    gap: 26px;
  }

  .mobile-nav a {
    font-size: 16px;
    color: #fdf4e7;
    text-decoration: none;
    font-weight: 600;
  }

  /* =========================================================
   MOBILE SEARCH BAR
========================================================= */

  .mobile-search {
    position: relative;
    width: 100%;
    display: flex;
    background: white;
    border-radius: 6px;
    overflow: visible;
  }

  .mobile-search input {
    width: 100%;
    border: none;
    outline: none;
    padding: 10px;
    font-size: 15px;
    color: #094949;
    border-radius: 5px 0 0 5px;
  }

  .mobile-search button {
    width: 40px;
    background: #f18c28;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0 5px 5px 0;
  }

  .mobile-search button img {
    width: 22px;
    height: 22px;
  }

  /* =========================================================
   AUTOCOMPLETE (mobile box)
========================================================= */

  .mobile-ac {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 240px;
    background: #ffffff;
    border-radius: 6px;
    border: 1px solid #ccc;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
    z-index: 20001;
    display: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease;
  }

  .mobile-ac.show {
    display: block;
    opacity: 1;
    visibility: visible;
  }

  /* Items */
  .mobile-ac .ac-item {
    display: flex;
    align-items: center;
    padding: 10px;
    cursor: pointer;
  }

  .mobile-ac .ac-item:hover {
    background: #f5f5f5;
  }

  .mobile-ac .ac-thumb {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    margin-right: 10px;
    object-fit: cover;
  }

  .mobile-ac .ac-details {
    display: flex;
    flex-direction: column;
  }

  .mobile-ac .ac-name {
    font-size: 18px;
    font-weight: 600;
    color: #222;
  }

  .mobile-ac .ac-cat {
    color: #777;
    font-size: 13px;
  }

  /* ============================
   MOBILE ATTRACTIVE QTY DRAWER
============================ */

  .qty-wrapper {
    width: 100%;
    border: 1px solid #dfecec;
    border-radius: 10px;
    padding: 10px 14px;
    background: #eef7f7;
    margin-top: 6px;
    cursor: pointer;
  }

  .qty-collapsed {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    color: #0b6b6a;
    font-size: 17px;
  }

  .qty-collapsed .arrow {
    font-size: 18px;
    opacity: 0.7;
  }

  /* Hidden by default */
  .qty-expanded {
    display: none;
    margin-top: 12px;
    gap: 18px;
    align-items: center;
    justify-content: center;
  }

  /* When opened */
  .qty-wrapper.opened .qty-expanded {
    display: flex;
  }

  .qty-wrapper.opened .qty-collapsed {
    display: none;
  }

  /* Buttons inside expanded drawer */
  .qty-expanded button {
    width: 55px;
    height: 40px;
    border-radius: 10px;
    font-size: 22px;
  }

  .qty-expanded .remove-item {
    background: #ffe1e1;
    border: 1px solid #ff9a9a;
  }

  .s4l-header-mobile .account-menu {
    position: relative;
    top: 10px;
  }
}

/* ===== REMOVE ALL BLUE TOUCH FLASHES (CHROME / ANDROID / TABLET / HYBRID LAPTOPS) ===== */

* {
  -webkit-tap-highlight-color: transparent !important;
}

*:focus,
*:focus-visible,
*:focus-within {
  outline: none !important;
  box-shadow: none !important;
}

button,
button:focus,
button:active {
  outline: none !important;
  box-shadow: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

a,
a:focus,
a:active {
  outline: none !important;
  box-shadow: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

img {
  -webkit-tap-highlight-color: transparent !important;
  user-select: none;
}

#s4l-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(40px);
  background: #0b6b6a;
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  z-index: 999999; /* override EVERYTHING */
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

#s4l-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* FINAL OVERRIDE FOR TOAST */
#s4l-toast {
  border: 1px solid #ffffff !important;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.35) !important;
}

#toast {
  position: fixed;
  bottom: 68%;
  left: 50%;
  transform: translateX(-50%) translateY(40px);
  background: #0b6b6a;
  color: #fff;
  max-width: 90%;
  width: max-content;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  z-index: 999999; /* override EVERYTHING */
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 480px) {
  #toast {
    max-width: 95%;
    font-size: 14px;
    padding: 10px 14px;
  }
}

/* Mobile portrait only — real phones */
@media (max-width: 480px) {
  .mobile-nav {
    pointer-events: none;
  }

  .mobile-nav a {
    opacity: 0;
  }
}
