/* Pile Head Super Theme - Complete Responsive CSS */

:root {
  --phst-bg: #f8f9fb;
  --phst-surface: #ffffff;
  --phst-border: #e4e7eb;
  --phst-muted: #6b7280;
  --phst-text: #111827;
  --phst-accent: #0aa572;
  --phst-radius: 12px;
  --phst-radius-sm: 8px;
  --phst-shadow: 0 6px 18px rgba(17, 24, 39, .08);
  --phst-shadow-hover: 0 10px 24px rgba(17, 24, 39, .12);
  --phst-header-bg: #fff;
  --phst-header-text: #111827;
}

/* ========== ACCESSIBILITY ========== */
.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ========== LAYOUT ========== */
.phst-section {
  margin: 28px 0;
}

.phst-section h2 {
  margin: 0 0 16px;
  font-size: 1.6rem;
  color: var(--phst-text);
  letter-spacing: .2px;
  position: relative;
}

.phst-section h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 56px;
  height: 3px;
  background: var(--phst-accent);
  border-radius: 999px;
}

/* Container */
.phst-container {
  max-width: var(--phst-container-max-w, 1200px);
  margin: 0 auto;
  padding: 0 16px;
}

.phst-container--narrow { --phst-container-max-w: 960px; }
.phst-container--medium { --phst-container-max-w: 1200px; }
.phst-container--wide { --phst-container-max-w: 1400px; }

/* ========== BUTTONS ========== */
.phst-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  background: var(--phst-accent);
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(10, 165, 114, .25);
  min-height: 44px;
  border: none;
  cursor: pointer;
}

/* ========== BANNER - FULLY RESPONSIVE ========== */
.phst-banner {
  background-size: cover;
  background-position: center;
  border-radius: var(--phst-radius);
  margin: 28px 0;
  overflow: hidden;
  position: relative;
  min-height: 300px;
}

.phst-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.1), rgba(0,0,0,.3));
  pointer-events: none;
}

.phst-banner-inner {
  padding: 40px 24px;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: inherit;
}

.phst-banner h2 {
  font-size: 2rem;
  margin: 0 0 16px;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,.3);
  max-width: 800px;
}

.phst-banner p {
  margin: 0 0 20px;
  color: #fff;
  font-size: 1.1rem;
  text-shadow: 0 1px 4px rgba(0,0,0,.3);
  max-width: 600px;
}

.phst-banner img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  max-height: 400px;
}

/* ========== SLIDER ========== */
.phst-slider {
  position: relative;
  height: var(--phst-slider-h, 480px);
  overflow: hidden;
  border-radius: var(--phst-radius);
  background: #000;
  max-width: var(--phst-slider-max-w, 1000px);
  margin: 0 auto;
}

.phst-slider::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.35), rgba(0,0,0,0) 60%);
  pointer-events: none;
}

.phst-slide {
  display: none;
  height: 100%;
}

.phst-slide.active {
  display: block;
}

.phst-slide-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.phst-slide-content {
  position: absolute;
  left: 24px;
  bottom: 24px;
  background: rgba(255,255,255,.88);
  color: var(--phst-text);
  padding: 14px 18px;
  border-radius: var(--phst-radius-sm);
  max-width: 70%;
  box-shadow: var(--phst-shadow);
  backdrop-filter: saturate(180%) blur(6px);
}

.phst-slide-content h3 {
  margin: 0 0 8px;
  font-size: 1.6rem;
}

.phst-slide-content p {
  margin: 0 0 12px;
  color: var(--phst-muted);
}

.phst-prev, .phst-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.95);
  border: 1px solid var(--phst-border);
  box-shadow: var(--phst-shadow);
  width: 40px;
  height: 40px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

  .phst-prev { left: 12px; }
  .phst-next { right: 12px; }

/* ========== MODULE HEADER + CAROUSEL CONTROLS (UNIFY WITH PLUGIN) ========== */
.phst-module-header-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.phst-module-header-container h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: var(--phst-text);
}

.phst-product-slider {
  position: relative;
}

.phst-carousel-prev,
.phst-carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: #fff;
  border: 1px solid var(--phst-border);
  border-radius: 999px;
  box-shadow: var(--phst-shadow);
  cursor: pointer;
  display: grid;
  place-items: center;
  line-height: 1;
}

.phst-carousel-prev { left: 8px; }
.phst-carousel-next { right: 8px; }

.phst-view-all-product-item {
  border: 1px solid var(--phst-border);
  border-radius: var(--phst-radius-sm);
  color: var(--phst-text);
}

/* ========== MINI CATEGORY + SQUARE GRID (PLUGIN SUPPORT) ========== */
.phst-mini-cat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--phst-border);
  border-radius: var(--phst-radius-sm);
  background: var(--phst-surface);
}

.phst-square-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.phst-square-item {
  border: 1px solid var(--phst-border);
  border-radius: var(--phst-radius);
  background: var(--phst-surface);
  overflow: hidden;
}

/* ========== PRODUCTS - BASE STYLES ========== */
.phst-product {
  border: 1px solid var(--phst-border);
  border-radius: var(--phst-radius-sm);
  overflow: hidden;
  background: var(--phst-surface);
  display: flex;
  flex-direction: column;
}

.phst-product-thumb {
  display: block;
  background: #f3f4f6;
}

.phst-product-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.phst-product-title {
  font-size: 1rem;
  padding: 12px 14px 6px;
  color: var(--phst-text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}

.phst-product-title a {
  text-decoration: none;
  color: inherit;
}

.phst-product-price {
  padding: 0 14px 14px;
  color: var(--phst-accent);
  font-weight: 700;
  margin-top: auto;
  display: grid;
  grid-auto-flow: row;
  gap: 2px;
}

.phst-product-price del {
  color: #6b7280;
  text-decoration: none;
}

.phst-product-price del .woocommerce-Price-amount bdi {
  text-decoration: line-through;
  text-decoration-color: #9ca3af;
  text-decoration-thickness: 1.5px;
}

.phst-product-price ins {
  color: #0aa572;
  text-decoration: none;
}

.phst-product-price .dirham-symbol img {
  height: 0.95em;
  vertical-align: -0.1em;
  margin-right: 4px;
}

/* Ensure Noon product card currency icon renders at text-size on all pages */
.noon-currency { display: inline-flex; align-items: center; }
/* Override broad global `img` rules (style.css) that set block/auto sizing */
.noon-currency img {
  height: 0.95em !important;
  width: auto !important;
  display: inline !important;
  vertical-align: -0.1em;
  margin-right: 4px;
}

/* ========== CATEGORIES ========== */
.phst-category {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--phst-text);
  background: transparent;
  border: none;
}

.phst-category .cat-thumb {
  width: 88px;
  height: 88px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #f9fafb, #eef2f7);
  border: 1px solid var(--phst-border);
  box-shadow: 0 2px 8px rgba(17,24,39,.06);
}

.phst-category-name {
  display: block;
  font-size: .95rem;
  color: var(--phst-text);
  font-weight: 600;
}

/* ========== SEARCH CHIPS ========== */
.phst-search-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.phst-chip {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  background: #f0f2f5;
  color: var(--phst-text);
  text-decoration: none;
  border: 1px solid var(--phst-border);
}

/* ========== BRANDS ========== */
.phst-brand {
  border: 1px solid var(--phst-border);
  border-radius: var(--phst-radius-sm);
  padding: 12px;
  background: var(--phst-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  color: var(--phst-text);
}

.phst-brand img {
  max-height: 48px;
  width: auto;
}

.phst-brand-name {
  font-size: .95rem;
  color: var(--phst-muted);
}

/* ========== CAROUSEL ARROWS ========== */
.phst-carousel-prev, .phst-carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.95);
  border: 1px solid var(--phst-border);
  box-shadow: var(--phst-shadow);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  cursor: pointer;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.phst-carousel-prev { left: -8px; }
.phst-carousel-next { right: -8px; }

/* ========== FULL-BLEED UTILITY ========== */
.phst-bleed {
  width: 100vw;
  margin-left: calc(50% - 50vw);
}

.phst-bleed--50 { width: 50vw; margin-left: calc(50% - 25vw); }
.phst-bleed--60 { width: 60vw; margin-left: calc(50% - 30vw); }
.phst-bleed--70 { width: 70vw; margin-left: calc(50% - 35vw); }
.phst-bleed--80 { width: 80vw; margin-left: calc(50% - 40vw); }
.phst-bleed--90 { width: 90vw; margin-left: calc(50% - 45vw); }
.phst-bleed--100 { width: 100vw; margin-left: calc(50% - 50vw); }

.phst-bleed .phst-products,
.phst-bleed .phst-categories,
.phst-bleed .phst-brands,
.phst-bleed .phst-slider,
.phst-bleed .phst-search-chips {
  padding-left: 16px;
  padding-right: 16px;
}

.phst-bleed .phst-carousel-prev { left: 8px; }
.phst-bleed .phst-carousel-next { right: 8px; }
.phst-bleed .phst-slider {
  max-width: 100%;
  width: 100%;
  border-radius: 0;
}

/* ========== HEADER (MYNTRA-STYLE) ========== */
.phst-site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--phst-header-bg, #fff);
  color: var(--phst-header-text, #111827);
  border-bottom: 1px solid #e5e7eb;
}

.phst-header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 12px 16px;
}

.phst-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.phst-header-center {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 18px;
}

.phst-header-nav .phst-menu {
  list-style: none;
  display: flex;
  gap: 18px;
  margin: 0;
  padding: 0;
}

.phst-header-nav .phst-menu a {
  text-decoration: none;
  color: var(--phst-text);
  font-weight: 600;
}

.phst-header-search {
  flex: 1;
  max-width: 520px;
}

.phst-header-search input[type="search"] {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--phst-border);
  border-radius: 999px;
  background: #f7f9fc;
  color: var(--phst-text);
  outline: none;
}

.phst-header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.phst-utility-item {
  text-decoration: none;
  color: var(--phst-text);
  font-weight: 600;
}

/* ========== FOOTER ========== */
.phst-site-footer {
  background: #111827;
  color: #f9fafb;
  padding: 40px 0;
}

.phst-footer-inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.phst-footer-col h4 {
  margin: 0 0 12px;
  font-size: 16px;
}

.phst-footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.phst-footer-col a {
  color: #e5e7eb;
  text-decoration: none;
}

/* ========== PRODUCT GRID ========== */
.phst-product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.phst-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
}

.phst-card-media {
  position: relative;
}

.phst-card-img {
  aspect-ratio: 1 / 1;
  background: #f3f4f6;
}

.phst-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.phst-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
}

.phst-card-title {
  font-size: 16px;
  line-height: 1.35;
  font-weight: 600;
  color: #2a2a2a;
  min-height: 2.7em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.phst-card-price {
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
}

.phst-card-cta {
  margin-top: auto;
}

/* Preview card CTA button styling to match demo */
.phst-card-cta .single_add_to_cart_button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--phst-primary, #0d6efd);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
}
.phst-card-cta .add_to_cart_button,
.phst-card-cta .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--phst-primary, #0d6efd);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
}
.phst-card-cta .single_add_to_cart_button:hover {
  background: color-mix(in srgb, var(--phst-primary, #0d6efd) 90%, #000);
}
.phst-card-cta .add_to_cart_button:hover,
.phst-card-cta .button:hover {
  background: color-mix(in srgb, var(--phst-primary, #0d6efd) 90%, #000);
}
.phst-card-cta .quantity input.qty {
  width: 72px;
  border-radius: 8px;
}

/* Single product CTA wrapper styling to match preview card button */
.phst-product-cta .single_add_to_cart_button,
.phst-product-cta .add_to_cart_button,
.phst-product-cta .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--phst-primary, #0d6efd);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
}
.phst-product-cta .single_add_to_cart_button:hover,
.phst-product-cta .add_to_cart_button:hover,
.phst-product-cta .button:hover {
  background: color-mix(in srgb, var(--phst-primary, #0d6efd) 90%, #000);
}

.phst-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #16a34a;
  color: #fff;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 9999px;
}

/* ========== BLOCK HEADER ========== */
.block-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.block-header h2 {
  margin: 0;
  font-size: 14px;
  color: #111827;
}

.block-header__divider {
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}

.block-header__arrows-list {
  display: flex;
  align-items: center;
  gap: 8px;
}

.block-header__arrow {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(17,24,39,.08);
}

.block-header--no-scroll .block-header__arrows-list {
  display: none;
}

/* ========== RESPONSIVE PRODUCT LAYOUTS ========== */

/* Desktop (1024px and above) - 6 products in grid */
@media (min-width: 1024px) {
  .phst-products:not(.phst-horizontal-products),
  .phst-product-grid,
  .noon-products-wrapper,
  .woocommerce-page ul.products,
  ul.products {
    display: grid !important;
    grid-template-columns: repeat(6, 1fr) !important;
    grid-auto-flow: row !important;
    gap: 16px !important;
    padding: 0 !important;
    overflow-x: visible !important;
  }

  .phst-products:not(.phst-horizontal-products) > *,
  .phst-product-grid > *,
  ul.products > * {
    scroll-snap-align: unset;
  }

  /* Hide arrows on desktop for regular grids (not horizontal scroll) */
  .phst-section:not(:has(.phst-horizontal-products)) .block-header__arrows-list,
  .phst-carousel-prev:not(.phst-scroll-btn),
  .phst-carousel-next:not(.phst-scroll-btn) {
    display: none !important;
  }
}

/* Tablet (641px to 1023px) - 4 products in grid */
@media (min-width: 641px) and (max-width: 1023px) {
  .phst-products:not(.phst-horizontal-products),
  .phst-product-grid,
  .noon-products-wrapper,
  .woocommerce-page ul.products,
  ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    grid-auto-flow: row !important;
    gap: 14px !important;
    padding: 0 !important;
    overflow-x: visible !important;
  }

  .phst-header-search {
    display: none;
  }

  .phst-footer-inner {
    grid-template-columns: 1fr 1fr;
  }

  .block-header h2 {
    font-size: 16px;
  }

  .phst-section:not(:has(.phst-horizontal-products)) .block-header__arrows-list {
    display: none !important;
  }

  /* Banner tablet */
  .phst-banner {
    min-height: 220px;
    margin: 20px 0;
  }

  .phst-banner-inner {
    padding: 28px 20px;
  }

  .phst-banner h2 {
    font-size: 1.5rem;
    margin: 0 0 12px;
  }

  .phst-banner p {
    font-size: 1rem;
    margin: 0 0 16px;
  }
}

/* Mobile (640px and below) */
@media (max-width: 640px) {
  /* Horizontal carousel: keep for curated sections only */
  .phst-products:not(.phst-horizontal-products),
  .phst-categories,
  .phst-brands,
  .noon-products-wrapper {
    display: grid !important;
    grid-auto-flow: column !important;
    grid-auto-columns: calc((100% - 10px) / 2) !important;
    grid-template-columns: none !important;
    gap: 10px !important;
    padding: 0 12px 16px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    position: relative;
  }

  /* WooCommerce product listings: enforce 2-column vertical grid */
  .woocommerce ul.products,
  .woocommerce-page ul.products,
  ul.products {
    display: grid !important;
    grid-auto-flow: row !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    padding: 0 !important;
    overflow-x: hidden !important;
  }

  /* Hide scrollbar */
  .phst-products::-webkit-scrollbar,
  .phst-categories::-webkit-scrollbar,
  .phst-brands::-webkit-scrollbar,
  ul.products::-webkit-scrollbar {
    display: none !important;
  }

  .phst-products > *,
  .phst-categories > *,
  .phst-brands > * {
    scroll-snap-align: start !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  .woocommerce ul.products > *,
  .woocommerce-page ul.products > *,
  ul.products > * {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  .phst-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .phst-footer-inner {
    grid-template-columns: 1fr;
  }

  /* Mobile bleed fixes */
  .phst-bleed,
  .phst-bleed--50,
  .phst-bleed--60,
  .phst-bleed--70,
  .phst-bleed--80,
  .phst-bleed--90,
  .phst-bleed--100 {
    width: 100vw !important;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding-left: 16px;
    padding-right: 16px;
  }

  .phst-container,
  .phst-section > .phst-container {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 16px;
    padding-right: 16px;
  }

  .phst-section {
    overflow: hidden;
  }

  /* Mobile banner */
  .phst-banner {
    background-size: cover;
    background-position: center;
    min-height: 160px;
    margin: 16px 0;
    border-radius: 8px;
  }

  .phst-banner-inner {
    padding: 16px 12px;
    text-align: center;
  }

  .phst-banner h2 {
    font-size: 18px;
    line-height: 1.2;
    overflow-wrap: anywhere;
    word-break: break-word;
    margin: 0 0 8px;
  }

  .phst-banner p {
    font-size: 13px;
    line-height: 1.4;
    overflow-wrap: anywhere;
    word-break: break-word;
    margin: 0 0 12px;
  }

  .phst-banner .phst-btn {
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
  }

  .phst-banner img {
    max-height: 200px;
  }

  /* Mobile slider */
  .phst-slider {
    height: 300px;
  }

  .phst-slide-content {
    left: 12px;
    bottom: 12px;
    padding: 10px 14px;
    max-width: 85%;
  }

  .phst-slide-content h3 {
    font-size: 1.2rem;
  }

  /* Mobile header */
  .phst-header-inner {
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    padding: 10px 12px;
  }

  .phst-header-search {
    display: none;
  }
}

/* Ultra-small devices (480px and below) */
@media (max-width: 480px) {
  .phst-banner {
    min-height: 140px;
  }

  .phst-banner h2 {
    font-size: 16px;
  }

  .phst-banner p {
    font-size: 12px;
  }

  .phst-section h2 {
    font-size: 1.3rem;
  }

  .phst-card-title {
    font-size: 14px;
  }
}

/* ========== PRINT STYLES ========== */
@media print {
  .phst-site-header,
  .phst-site-footer,
  .phst-carousel-prev,
  .phst-carousel-next,
  .block-header__arrows-list {
    display: none !important;
  }

  .phst-banner,
  .phst-product,
  .phst-card {
    break-inside: avoid;
  }
}

/* ========== PERFORMANCE OPTIMIZATIONS ========== */
.phst-banner img,
.phst-product-thumb img,
.phst-card-img img {
  content-visibility: auto;
  contain-intrinsic-size: 300px;
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ========== HORIZONTAL PRODUCTS SECTION ========== */
.phst-horizontal-title {
  font-size: 20px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 20px 0;
  padding: 0;
  letter-spacing: -0.01em;
}

@media (max-width: 767px) {
  .phst-horizontal-title {
    font-size: 18px;
    margin: 0 0 16px 0;
  }
}

/* ========== TOP CATEGORIES WITH ARROWS ========== */
.phst-categories-wrapper {
  position: relative;
  padding: 0 50px;
}

.phst-categories {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 20px;
  padding: 0 10px 20px 10px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  cursor: grab;
}

.phst-categories::-webkit-scrollbar {
  display: none;
}

.phst-category {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-decoration: none;
  color: var(--phst-text);
  flex-shrink: 0;
  width: 110px;
}

.phst-category img {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: linear-gradient(180deg, #f9fafb, #eef2f7);
  border: 3px solid #f0f0f0;
  box-shadow: 0 4px 12px rgba(17,24,39,.1);
}

.phst-category-name {
  display: block;
  margin-top: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--phst-text);
  text-align: center;
  line-height: 1.3;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phst-cat-arrow {
  position: absolute;
  top: 40px;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  color: #333;
}

.phst-cat-arrow--left {
  left: 0;
}

.phst-cat-arrow--right {
  right: 0;
}

@media (min-width: 1024px) {
  .phst-categories {
    gap: 24px;
  }
  
  .phst-category {
    width: 120px;
  }
  
  .phst-category img {
    width: 120px;
    height: 120px;
  }
  
  .phst-category-name {
    font-size: 15px;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .phst-categories-wrapper {
    padding: 0 45px;
  }
  
  .phst-categories {
    gap: 18px;
  }
  
  .phst-category {
    width: 100px;
  }
  
  .phst-category img {
    width: 100px;
    height: 100px;
  }
  
  .phst-category-name {
    font-size: 13px;
  }
  
  .phst-cat-arrow {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 767px) {
  .phst-categories-wrapper {
    padding: 0;
  }
  
  .phst-categories {
    gap: 16px;
    padding: 0 10px 16px 10px;
  }
  
  .phst-category {
    width: 90px;
  }
  
  .phst-category img {
    width: 90px;
    height: 90px;
  }
  
  .phst-category-name {
    font-size: 12px;
    margin-top: 8px;
  }
  
  .phst-cat-arrow {
    display: none;
  }
}

/* ========== SMOOTH SCROLLING OPTIMIZATIONS ========== */
.phst-horizontal-products,
.phst-categories {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  will-change: scroll-position;
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}

.phst-horizontal-products.is-dragging,
.phst-categories.is-dragging {
  scroll-behavior: auto;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  cursor: grabbing;
}

.phst-horizontal-products.is-dragging *,
.phst-categories.is-dragging * {
  pointer-events: auto;
}

.phst-product-item,
.phst-category {
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.phst-horizontal-products::-webkit-scrollbar,
.phst-categories::-webkit-scrollbar {
  height: 8px;
}


.phst-horizontal-products::-webkit-scrollbar-track,
.phst-categories::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.05);
  border-radius: 4px;
}

.phst-horizontal-products::-webkit-scrollbar-thumb,
.phst-categories::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.2);
  border-radius: 4px;
}

@supports (-webkit-backdrop-filter: blur(1px)) {
  .phst-horizontal-products,
  .phst-categories {
    -webkit-transform: translate3d(0,0,0);
  }
}

/* ========== REMOVE HOVER EFFECTS (SELECTIVE) ========== */
.phst-product,
.phst-card,
.phst-category,
.phst-brand,
.phst-product-item,
.woocommerce ul.products li.product {
  transition: none !important;
}

.phst-product:hover,
.phst-card:hover,
.phst-category:hover,
.phst-brand:hover,
.phst-product-item:hover,
.woocommerce ul.products li.product:hover {
  transform: none !important;
  box-shadow: inherit !important;
}

.phst-category:hover img {
  transform: none !important;
  border-color: #f0f0f0 !important;
  box-shadow: 0 4px 12px rgba(17,24,39,.1) !important;
}

.phst-category:hover .phst-category-name {
  color: var(--phst-text) !important;
}
/* ========== PILEHEAD HEADER - E-COMMERCE STYLE ========== */

.pilehead-header-desktop {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.pilehead-site-width-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 16px;
}

.pilehead-header-inner-ctr {
  display: flex !important;
  align-items: center !important;
  gap: 20px !important;
  height: 68px !important;
  flex-wrap: nowrap !important;
}

/* Logo */
.pilehead-logo-link {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.pilehead-logo {
  height: 32px;
  width: auto;
  display: block;
}

/* Location Selector */
.pilehead-locale-settings {
  flex-shrink: 0;
}

.pilehead-delivery-location-selector {
  position: relative;
}

.pilehead-location-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 6px;
}

.pilehead-flag-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

.pilehead-address-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.pilehead-label {
  font-size: 11px;
  color: #6b7280;
  line-height: 1;
  margin-bottom: 4px;
}

.pilehead-default-address {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pilehead-long-text {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
}

.pilehead-chevron-down {
  width: 12px;
  height: 12px;
  color: #6b7280;
}

/* Search Bar */
.pilehead-desktop-search-wrapper {
  flex: 1;
  max-width: 680px;
}

.pilehead-search-input-wrapper {
  position: relative;
}

.pilehead-search-input-wrapper form {
  position: relative;
  width: 100%;
}

.pilehead-search-input {
  width: 100%;
  height: 44px;
  padding: 0 48px 0 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  color: #111827;
  background: #f7f9fc;
  outline: none;
}

.pilehead-search-input:focus {
  border-color: #0aa572;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(10,165,114,0.1);
}

.pilehead-search-input::placeholder {
  color: #9ca3af;
}

.pilehead-search-icon-wrapper {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #6b7280;
  pointer-events: none;
}

/* Language Selector */
.pilehead-show-for-desktop {
  flex-shrink: 0;
}

.pilehead-language-selector-ctr {
  display: flex;
}

.pilehead-language-option {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  border-radius: 6px;
}

/* Separator */
.pilehead-header-separator {
  width: 1px;
  height: 32px;
  background: #e5e7eb;
  flex-shrink: 0;
}

/* User Menu */
.pilehead-user-menu-container {
  flex-shrink: 0;
}

.pilehead-user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
}

.pilehead-user-text {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
}

.pilehead-user-menu-trigger svg {
  width: 20px;
  height: 20px;
  color: #111827;
  flex-shrink: 0;
}

/* Wishlist & Cart */
.pilehead-wishlist-link,
.pilehead-cart-link {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #111827;
  padding: 8px;
  border-radius: 6px;
  position: relative;
  flex-shrink: 0;
}

.pilehead-icon-container,
.pilehead-cart-icon-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pilehead-cart-icon-container svg,
.pilehead-icon-container svg {
  width: 24px;
  height: 24px;
  color: #111827;
}

.pilehead-cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #0aa572;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  line-height: 1;
}

/* Mobile Responsiveness */
@media (max-width: 1023px) {
  .pilehead-header-inner-ctr {
    gap: 12px !important;
    height: 60px !important;
  }
  
  .pilehead-desktop-search-wrapper {
    display: none;
  }
  
  .pilehead-locale-settings {
    display: none;
  }
  
  .pilehead-show-for-desktop {
    display: none;
  }
  
  .pilehead-header-separator {
    display: none;
  }
  
  .pilehead-logo {
    height: 28px;
  }
  
  .pilehead-user-text {
    display: none;
  }
}

@media (max-width: 640px) {
  .pilehead-site-width-container {
    padding: 0 12px;
  }
  
  .pilehead-header-inner-ctr {
    gap: 8px !important;
    height: 56px !important;
  }
  
  .pilehead-logo {
    height: 24px;
  }
}
/* ========== LIVE SEARCH RESULTS ========== */
.pilehead-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  margin-top: 8px;
  z-index: 1000;
  max-height: 500px;
  overflow-y: auto;
}

.pilehead-search-loading,
.pilehead-no-results {
  padding: 20px;
  text-align: center;
  color: #6b7280;
  font-size: 14px;
}

.pilehead-search-result-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid #f3f4f6;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s;
}

.pilehead-search-result-item:hover {
  background: #f9fafb;
}

.pilehead-result-image {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
}

.pilehead-result-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

.pilehead-result-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pilehead-result-title {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pilehead-result-price {
  font-size: 14px;
  font-weight: 700;
  color: #0aa572;
}

.pilehead-view-all {
  display: block;
  padding: 12px;
  text-align: center;
  color: #0aa572;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  border-top: 1px solid #f3f4f6;
}

.pilehead-view-all:hover {
  background: #f9fafb;
}

/* Wishlist Badge */
.pilehead-wishlist-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  line-height: 1;
}
/* Noon card CTA unification: match preview accent and sizing */
.noon-cart-overlay .noon-add-to-cart-btn,
.noon-add-to-cart-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  min-height: 44px;
  width: 100%;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  background: var(--phst-primary, #0d6efd) !important;
  color: #fff !important;
  box-shadow: 0 4px 10px rgba(13, 110, 253, .25);
  cursor: pointer;
}
.noon-add-to-cart-btn:hover {
  background: color-mix(in srgb, var(--phst-primary, #0d6efd) 90%, #000) !important;
}
.noon-quick-atc:hover {
  background: var(--phst-primary, #0d6efd) !important;
  border-color: var(--phst-primary, #0d6efd) !important;
}
