/* Zaha Surgical final enhancements
   Original blue/white color theme is preserved. This file only improves movement, search UI and sticky behavior. */

:root {
  --zaha-header-height: 0px;
}

html {
  scroll-behavior: smooth;
}

/* Product dropdown visibility fix */
#products-dropdown.dropdown-menu {
  display: none;
  position: fixed !important;
  z-index: 99999 !important;
  pointer-events: auto;
}

#products-dropdown.dropdown-menu.zaha-open {
  display: block !important;
}

#products-btn {
  position: relative;
  z-index: 100000;
}

/* Bottom menu dropdown fix */
#bottom-menu .group:hover > div,
#bottom-menu .group:focus-within > div {
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
  z-index: 99999 !important;
}

/* Professional product hover animation. Colors stay original. */
.product-card,
.zaha-search-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.32s cubic-bezier(.22,.61,.36,1), box-shadow 0.32s ease, border-color 0.32s ease !important;
  will-change: transform;
}

.product-card::before,
.zaha-search-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -85%;
  width: 55%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.42), transparent);
  transform: skewX(-18deg);
  transition: left 0.65s ease;
  pointer-events: none;
  z-index: 1;
}

.product-card:hover,
.zaha-search-card:hover {
  transform: translateY(-10px) scale(1.015) !important;
  box-shadow: 0 22px 45px rgba(15, 23, 42, 0.18) !important;
}

.product-card:hover::before,
.zaha-search-card:hover::before {
  left: 135%;
}

.product-card img,
.zaha-search-card img {
  transition: transform 0.34s ease, filter 0.34s ease !important;
  will-change: transform;
}

.product-card:hover img:not([alt*="Logo"]):not([alt*="Watermark"]):not(.pointer-events-none),
.zaha-search-card:hover img {
  transform: scale(1.06) !important;
  filter: drop-shadow(0 12px 18px rgba(15, 23, 42, 0.16));
}

.product-card a,
.product-card button,
.zaha-search-card a,
.zaha-search-card button {
  position: relative;
  z-index: 2;
}

/* Keep buttons tidy when Detail button is added */
.zaha-card-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  flex-wrap: wrap !important;
}

.zaha-detail-btn,
.zaha-whatsapp-btn,
.zaha-inquire-btn {
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.35rem !important;
  white-space: nowrap !important;
}

.zaha-detail-btn,
.zaha-inquire-btn,
.zaha-whatsapp-btn,
.add-to-cart-btn {
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease !important;
}

.zaha-detail-btn:hover,
.zaha-inquire-btn:hover,
.zaha-whatsapp-btn:hover,
.add-to-cart-btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.16) !important;
}

/* Search result page cards */
.zaha-search-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1rem;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

/* Small toast fallback */
.zaha-toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100000;
  background: #111827;
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  box-shadow: 0 12px 30px rgba(0,0,0,.25);
  font-size: 0.9rem;
}


/* Checkout page professional summary */
.zaha-checkout-summary-panel {
  background: linear-gradient(180deg, #ffffff, #f8fafc) !important;
  border: 1px solid #dbeafe !important;
  border-radius: 14px !important;
  box-shadow: 0 12px 28px rgba(30, 64, 175, 0.08) !important;
}

.zaha-summary-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.zaha-summary-stat {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px;
  background: #ffffff;
}

.zaha-summary-stat span {
  display: block;
  font-size: 11px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.zaha-summary-stat strong {
  display: block;
  margin-top: 2px;
  font-size: 20px;
  color: #1e40af;
  line-height: 1;
}

.zaha-summary-list {
  list-style: none !important;
  padding-left: 0 !important;
  margin: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.zaha-summary-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  border-radius: 12px;
  padding: 10px 12px;
}

.zaha-summary-name {
  color: #111827;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.35;
}

.zaha-summary-code {
  color: #64748b;
  font-size: 11px;
  margin-top: 3px;
}

.zaha-summary-qty {
  background: #1e40af;
  color: #ffffff;
  min-width: 36px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  flex: 0 0 auto;
}

.zaha-checkout-actions button {
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease !important;
}

.zaha-checkout-actions button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.15);
}

.zaha-update-enabled {
  cursor: pointer !important;
  opacity: 1 !important;
}

.zaha-update-enabled:active {
  transform: translateY(0) scale(0.98) !important;
}


/* ===== STABLE HEADER BEHAVIOR — old-video matched, no shaking =====
   At page top the full header stays normal. When user scrolls down and the
   blue category bar reaches the top, ONLY that blue bar becomes fixed.
   Logo/search/cart are not animated or forced upward; they simply scroll away.
   This removes the shake/jump issue caused by transform + IntersectionObserver. */
:root { --menu-h: 48px; }

html { scroll-behavior: smooth; }

#header-wrap {
  position: relative !important;
  z-index: 50 !important;
  width: 100% !important;
  padding-top: 0 !important;
}

#top-bar,
#middle-section {
  transform: none !important;
  transition: none !important;
  will-change: auto !important;
}

body.menu-fixed #top-bar,
body.menu-fixed #middle-section {
  transform: none !important;
}

#menu-sentinel,
body.menu-fixed #menu-sentinel {
  display: block !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
}

#bottom-menu {
  position: relative !important;
  z-index: 1000 !important;
  width: 100% !important;
  transform: none !important;
  transition: box-shadow 0.20s ease !important;
  will-change: auto !important;
  animation: none !important;
}

body.menu-fixed #bottom-menu {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 10000 !important;
  transform: none !important;
  animation: none !important;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16) !important;
}

/* Preserve the blue menu's space after it becomes fixed, without moving sentinel.
   This prevents content jump while also preventing sticky observer loop/shake. */
body.menu-fixed #header-wrap {
  padding-top: 0 !important;
  padding-bottom: var(--menu-h) !important;
}

/* Disable the older full-header sticky class from previous builds, if any script adds it. */
body.zaha-fixed-header { padding-top: 0 !important; }
body.zaha-fixed-header #header-wrap {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  transform: none !important;
  animation: none !important;
  box-shadow: none !important;
}
body.zaha-fixed-header #top-bar,
body.zaha-fixed-header #middle-section,
body.zaha-fixed-header #menu-sentinel { display: block !important; }
body.zaha-fixed-header #bottom-menu {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  transform: none !important;
  animation: none !important;
}
body.menu-fixed.zaha-fixed-header #bottom-menu {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 10000 !important;
}

/* Dropdowns remain visible over sticky nav. */
#bottom-menu .absolute,
#bottom-menu #dropdown-menu,
#products-dropdown { z-index: 20000 !important; }

#bottom-menu .group:hover > .absolute,
#bottom-menu .group:hover #dropdown-menu,
#bottom-menu .group:focus-within > .absolute,
#bottom-menu .group:focus-within #dropdown-menu {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
}

@media (max-width: 900px) {
  body.menu-fixed #bottom-menu {
    overflow-x: auto !important;
    white-space: nowrap !important;
  }
}

/* ===== CATEGORY PAGE HEADER POLISH =====
   Keeps the original blue/white color identity, but makes each category
   title + sorting area look more professional and balanced. */

/* Breadcrumb above category header */
p[style*="margin-left: 14px"][style*="font-size: 14px"] {
  margin: 18px 14px 10px !important;
  padding: 7px 13px !important;
  width: max-content !important;
  max-width: calc(100% - 28px) !important;
  color: #1e40af !important;
  background: #eef2ff !important;
  border: 1px solid #dbeafe !important;
  border-radius: 999px !important;
  font-size: 12px !important;
  letter-spacing: 0.35px !important;
  text-transform: uppercase !important;
  box-shadow: 0 6px 18px rgba(30, 64, 175, 0.08) !important;
}

/* Main category title/filter strip */
.filter-bar {
  margin: 0 14px 24px !important;
  padding: 17px 18px !important;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
  border: 1px solid #e5e7eb !important;
  border-left: 5px solid #1e40af !important;
  border-radius: 14px !important;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08) !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 18px !important;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease !important;
}

.filter-bar:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.11) !important;
  border-color: #dbeafe !important;
  border-left-color: #1e40af !important;
}

.filter-bar > .w-full {
  width: auto !important;
  flex: 1 1 auto !important;
  min-width: 220px !important;
  gap: 14px !important;
}

.filter-bar img {
  width: 78px !important;
  height: 78px !important;
  min-width: 78px !important;
  object-fit: cover !important;
  border-radius: 13px !important;
  padding: 6px !important;
  background: #ffffff !important;
  border: 1px solid #dbeafe !important;
  box-shadow: 0 10px 22px rgba(30, 64, 175, 0.16) !important;
}

.filter-bar h2 {
  color: #0f172a !important;
  font-size: clamp(22px, 2.15vw, 32px) !important;
  line-height: 1.15 !important;
  letter-spacing: 0.4px !important;
  font-weight: 800 !important;
  margin: 0 !important;
  position: relative !important;
  padding-bottom: 8px !important;
}

.filter-bar h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 64px;
  height: 3px;
  border-radius: 999px;
  background: #1e40af;
}

.filter-options {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 10px !important;
  flex-wrap: wrap !important;
  background: #ffffff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 12px !important;
  padding: 10px 12px !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 8px 20px rgba(15, 23, 42, 0.06) !important;
  white-space: nowrap !important;
}

.filter-options label {
  color: #0f172a !important;
  font-weight: 800 !important;
  font-size: 13px !important;
  line-height: 1.1 !important;
}

.filter-options select {
  min-height: 42px !important;
  padding: 8px 36px 8px 12px !important;
  font-size: 14px !important;
  color: #0f172a !important;
  background-color: #ffffff !important;
  border: 1px solid #d1d5db !important;
  border-radius: 8px !important;
  outline: none !important;
  cursor: pointer !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.filter-options select:hover,
.filter-options select:focus {
  border-color: #1e40af !important;
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.12) !important;
}

h1:empty {
  display: none !important;
}

@media (max-width: 900px) {
  .filter-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 15px !important;
  }

  .filter-bar > .w-full {
    width: 100% !important;
  }

  .filter-options {
    width: 100% !important;
    justify-content: space-between !important;
  }

  .filter-options select {
    flex: 1 1 145px !important;
  }
}

@media (max-width: 520px) {
  .filter-bar {
    margin-left: 10px !important;
    margin-right: 10px !important;
  }

  .filter-bar img {
    width: 64px !important;
    height: 64px !important;
    min-width: 64px !important;
  }

  .filter-bar h2 {
    font-size: 21px !important;
  }

  .filter-options {
    gap: 8px !important;
  }

  .filter-options label,
  .filter-options select {
    width: 100% !important;
  }
}

/* =========================================================
   MOBILE RESPONSIVE FINAL PATCH
   Fixes homepage product sliders, hero banner cropping,
   checkout/cart table, mobile header spacing and text overflow.
   ========================================================= */

/* General mobile text safety */
.product-card,
.product-card p,
.zaha-search-card,
#product-grid,
#results,
.checkout-shell {
  overflow-wrap: anywhere !important;
  word-break: normal !important;
}

/* Homepage featured product sliders: desktop keeps 5 cards; smaller screens get wider cards. */
[id^="productSlider"] {
  align-items: stretch !important;
}

[id^="productSlider"] .slide {
  flex: 0 0 20% !important;
  max-width: 20% !important;
  width: 20% !important;
}

[id^="productSlider"] .product-card {
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  min-width: 0 !important;
}

[id^="productSlider"] .product-card a {
  min-width: 0 !important;
}

[id^="productSlider"] .product-card p {
  line-height: 1.35 !important;
}

@media (max-width: 1024px) {
  [id^="productSlider"] .slide {
    flex-basis: 33.333333% !important;
    max-width: 33.333333% !important;
    width: 33.333333% !important;
  }
}

@media (max-width: 768px) {
  [id^="productSlider"] .slide {
    flex-basis: 50% !important;
    max-width: 50% !important;
    width: 50% !important;
    padding-left: 0.4rem !important;
    padding-right: 0.4rem !important;
  }

  [id^="productSlider"] .product-card {
    padding: 0.85rem !important;
  }

  [id^="productSlider"] .relative.w-full.h-48 {
    height: 9.5rem !important;
  }
}

@media (max-width: 520px) {
  [id^="productSlider"] .slide {
    flex-basis: 100% !important;
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 2.2rem !important;
    padding-right: 2.2rem !important;
  }

  [id^="productSlider"] .product-card {
    border-radius: 1rem !important;
    min-height: 360px !important;
  }

  [id^="productSlider"] .relative.w-full.h-48 {
    height: 11.5rem !important;
  }

  [id^="productSlider"] .product-card p.text-blue-600 {
    font-size: 1rem !important;
  }

  [id^="productSlider"] button[id^="prevBtn"],
  [id^="productSlider"] ~ button[id^="nextBtn"],
  button[id^="prevBtn"],
  button[id^="nextBtn"] {
    width: 2.35rem !important;
    height: 2.35rem !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
}

/* Hero Swiper: prevent mobile banner from being cut too much. */
@media (max-width: 768px) {
  .swiper {
    height: 285px !important;
  }

  .swiper-slide {
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center center !important;
    background-color: #0f172a !important;
  }

  .swiper-button-prev {
    left: 10px !important;
  }

  .swiper-button-next {
    right: 10px !important;
  }

  .swiper-button-next::after,
  .swiper-button-prev::after {
    font-size: 28px !important;
  }

  .swiper-slide a.absolute.bottom-6.right-6 {
    bottom: 12px !important;
    right: 12px !important;
    padding: 0.45rem 0.85rem !important;
    font-size: 0.82rem !important;
  }
}

@media (max-width: 420px) {
  .swiper {
    height: 245px !important;
  }
}

/* Category/product grid cards: clean single-column mobile layout with readable buttons. */
@media (max-width: 640px) {
  #product-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  #product-grid .product-card,
  #results .product-card {
    width: 100% !important;
    max-width: 100% !important;
    padding: 1rem !important;
    border-radius: 1rem !important;
  }

  .zaha-card-actions,
  .product-card .flex.justify-center.mt-3 {
    width: 100% !important;
    gap: 0.55rem !important;
  }

  .zaha-card-actions > *,
  .product-card .flex.justify-center.mt-3 > * {
    flex: 1 1 auto !important;
    min-width: 120px !important;
    text-align: center !important;
  }
}

/* Checkout/cart: turn the wide table into stacked mobile cards. */
@media (max-width: 640px) {
  main.flex-grow.py-10,
  main.checkout-page,
  .checkout-page main {
    padding-left: 0.65rem !important;
    padding-right: 0.65rem !important;
  }

  .checkout-shell {
    padding: 0.9rem !important;
    border-radius: 1rem !important;
    width: 100% !important;
  }

  .checkout-shell .overflow-x-auto {
    overflow-x: visible !important;
  }

  .checkout-table {
    min-width: 0 !important;
    width: 100% !important;
    border: 0 !important;
  }

  .checkout-table thead {
    display: none !important;
  }

  .checkout-table,
  .checkout-table tbody,
  .checkout-table tr,
  .checkout-table td {
    display: block !important;
    width: 100% !important;
  }

  .checkout-table tr {
    background: #ffffff !important;
    border: 1px solid #dbeafe !important;
    border-radius: 1rem !important;
    padding: 0.85rem !important;
    margin-bottom: 1rem !important;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08) !important;
  }

  .checkout-table td {
    border: 0 !important;
    padding: 0.45rem 0 !important;
    text-align: left !important;
  }

  .checkout-table td:nth-child(1) {
    display: flex !important;
    justify-content: center !important;
    padding-top: 0 !important;
  }

  .checkout-table td:nth-child(1) img {
    width: 8rem !important;
    height: 8rem !important;
    max-width: 100% !important;
  }

  .checkout-table td:nth-child(2) h3 {
    font-size: 1.05rem !important;
    line-height: 1.35 !important;
  }

  .checkout-table td:nth-child(3)::before {
    content: "Code: ";
    font-weight: 800;
    color: #0f172a;
  }

  .checkout-table td:nth-child(4) {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
  }

  .checkout-table td:nth-child(4)::before {
    content: "Quantity";
    font-weight: 800;
    color: #0f172a;
  }

  .checkout-table td:nth-child(5) {
    text-align: right !important;
  }

  .zaha-summary-stats {
    grid-template-columns: 1fr 1fr !important;
  }

  .zaha-summary-item {
    align-items: flex-start !important;
  }
}

/* Header/menu small-screen polish. */
@media (max-width: 640px) {
  #top-bar .container {
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
  }

  #top-bar a,
  #top-bar span {
    font-size: 0.88rem !important;
  }

  #middle-section a img,
  #middle-section img[alt="Logo"] {
    max-height: 4.2rem !important;
    object-fit: contain !important;
  }

  #bottom-menu .container {
    justify-content: flex-start !important;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
    scroll-padding-left: 0.5rem !important;
  }

  #bottom-menu a,
  #bottom-menu button {
    font-size: 0.78rem !important;
  }
}
