/* ========================================================================== 
   PARVARESHI — UI COMPONENTS
   Version: 11.0.0
   Source of truth for:
   1) Desktop primary navigation + search
   2) Mobile/tablet hamburger drawer + search
   3) Home hero responsive image/slider shell
   4) Category carousel + navigation buttons

   IMPORTANT:
   This file is loaded AFTER style.css and intentionally owns these components.
   New changes to these components must be made here, not appended to style.css.
   ========================================================================== */

:root {
  --pv-blue: #1769aa;
  --pv-blue-dark: #10558e;
  --pv-text-blue: #254968;
  --pv-line: #dfe8ef;
  --pv-soft: #f5f8fa;
  --pv-menu-width: 360px;
  --pv-control-size: 38px;
  --pv-category-gap: 16px;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ========================================================================== 
   1) HEADER / DESKTOP NAVIGATION
   ========================================================================== */
/* Desktop header contract: logo wing on the right, navigation centered, search wing on the left.
   Logo/search use equal flex-basis so the primary menu stays visually centered. */
.site-header .header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.site-header .hero-brand__link {
  flex: 0 0 clamp(170px, 18vw, 220px);
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.desktop-primary-nav {
  min-width: 0;
  flex: 1 1 auto;
  margin: 0;
}

.desktop-primary-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.desktop-primary-menu a {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 9px 11px;
  border-radius: 12px;
  color: #405c76;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 700;
  white-space: nowrap;
  transition: color .18s ease, background .18s ease;
}

.desktop-primary-menu a:hover,
.desktop-primary-menu a:focus-visible {
  color: var(--pv-blue);
  background: #eef6fc;
}


.desktop-site-search {
  position: relative;
  flex: 0 0 clamp(170px, 18vw, 220px);
  width: clamp(170px, 18vw, 220px);
  height: 44px;
  display: flex;
  align-items: center;
  margin: 0;
}

.desktop-site-search input {
  width: 100%;
  height: 44px;
  padding: 0 15px 0 48px;
  border: 1px solid #d9e5ee;
  border-radius: 14px;
  outline: 0;
  color: #304f6d;
  background: #f7fafc;
  font: inherit;
  font-size: 12.5px;
  line-height: 1;
  font-weight: 550;
  text-align: right;
  box-shadow: 0 5px 18px rgba(31,63,88,.045);
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.desktop-site-search input::placeholder {
  color: #9aaab7;
  opacity: 1;
}

.desktop-site-search input:focus {
  border-color: #b7d3e6;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(23,105,170,.065), 0 7px 20px rgba(31,63,88,.055);
}

.desktop-site-search button {
  position: absolute;
  left: 5px;
  top: 5px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  color: var(--pv-blue);
  background: #eaf4fb;
  cursor: pointer;
  transition: color .18s ease, background .18s ease, transform .18s ease;
}

.desktop-site-search button:hover,
.desktop-site-search button:focus-visible {
  color: var(--pv-blue-dark);
  background: #dceefa;
  transform: translateY(-1px);
}

.desktop-site-search svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mobile-menu-toggle,
.mobile-menu-panel,
.mobile-menu-backdrop-v10 {
  display: none;
}

/* ========================================================================== 
   2) HERO — RESPONSIVE ART DIRECTION
   Desktop = wide image. Mobile/tablet = square image.
   HTML uses <picture>; WordPress will provide independent desktop/mobile media.
   ========================================================================== */
.home-slider {
  aspect-ratio: 1224 / 424 !important;
}

.home-slide__picture {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.home-slide__picture .home-slide__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* ========================================================================== 
   3) CATEGORY TOOLBAR / CAROUSEL
   Desktop: 5 cards visible.
   Mobile/tablet: 2 cards visible.
   Buttons are ALWAYS visible; boundary button is dimmed/disabled, never hidden.
   ========================================================================== */
.quick-access {
  overflow: hidden;
}

.categories-toolbar {
  width: 100%;
  min-height: 46px;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 15px;
  direction: rtl;
}

.categories-toolbar h2 {
  margin: 0;
  color: var(--pv-text-blue);
  font-size: 20px;
  line-height: 1.5;
  font-weight: 800;
  text-align: right;
  flex: 0 0 auto;
}

.category-scroll-controls,
.category-scroll-controls.is-visible {
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  flex: 0 0 auto;
  direction: ltr;
  position: static !important;
  inset: auto !important;
  margin: 0;
}

.category-scroll-btn {
  width: var(--pv-control-size) !important;
  height: var(--pv-control-size) !important;
  min-width: var(--pv-control-size);
  display: grid !important;
  place-items: center;
  padding: 0 !important;
  border: 1px solid #d9e5ee !important;
  border-radius: 11px !important;
  color: var(--pv-blue) !important;
  background: #fff !important;
  box-shadow: 0 5px 15px rgba(23,105,170,.055) !important;
  cursor: pointer;
  opacity: 1;
  visibility: visible !important;
  transition: background .18s ease, border-color .18s ease, color .18s ease,
    opacity .18s ease, transform .18s ease, box-shadow .18s ease;
}

.category-scroll-btn svg {
  width: 17px !important;
  height: 17px !important;
  stroke-width: 2 !important;
}

.category-scroll-btn:hover:not(:disabled),
.category-scroll-btn:focus-visible:not(:disabled) {
  border-color: #bad4e7 !important;
  color: #0d5d9c !important;
  background: #eef7fc !important;
  transform: translateY(-1px);
}

.category-scroll-btn:disabled {
  opacity: .28 !important;
  cursor: default !important;
  pointer-events: none;
  box-shadow: none !important;
  transform: none !important;
}

.category-scroller {
  display: grid !important;
  grid-auto-flow: column !important;
  grid-auto-columns: calc((100% - (var(--pv-category-gap) * 4)) / 5) !important;
  gap: var(--pv-category-gap) !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 2px 0 12px !important;
  overflow-x: hidden !important;
  overflow-y: hidden !important;
  direction: rtl;
  scroll-behavior: smooth;
  scroll-snap-type: none !important;
  scroll-padding: 0 !important;
  overscroll-behavior-inline: contain;
  touch-action: pan-y;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.category-scroller::-webkit-scrollbar {
  display: none;
}

.category-card,
.category-card:last-child {
  width: auto !important;
  min-width: 0 !important;
  min-height: 236px !important;
  height: auto !important;
  aspect-ratio: auto !important;
  grid-column: auto !important;
  justify-self: stretch !important;
  position: relative;
  display: flex !important;
  flex-direction: column;
  align-items: center !important;
  justify-content: flex-start !important;
  padding: 27px 17px 23px !important;
  border: 1px solid rgba(224,230,236,.75) !important;
  border-radius: 22px !important;
  background: #f4f6f8 !important;
  box-shadow: none !important;
  text-align: center;
  overflow: hidden;
  scroll-snap-align: none !important;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease !important;
}

/* Remove the old radial/fade overlay permanently. */
.category-card::before {
  content: none !important;
  display: none !important;
  opacity: 0 !important;
  background: none !important;
}

.category-card:hover,
.category-card:focus-visible {
  transform: translateY(-3px) !important;
  border-color: #cddde9 !important;
  background: #f4f6f8 !important;
  box-shadow: 0 12px 28px rgba(38,74,105,.075) !important;
}

@media (min-width: 901px) and (max-width: 1080px) {
  .site-header .header-inner {
    gap: 10px;
  }

  .site-header .hero-brand__link,
  .desktop-site-search {
    flex-basis: 170px;
  }

  .desktop-site-search {
    width: 170px;
  }

  .desktop-primary-menu {
    gap: 0;
  }

  .desktop-primary-menu a {
    padding-inline: 7px;
    font-size: 11.5px;
  }
}

/* ========================================================================== 
   4) MOBILE + TABLET (<= 900px)
   ========================================================================== */
@media (max-width: 900px) {
  body {
    padding-bottom: calc(94px + env(safe-area-inset-bottom, 0px));
  }

  body.mobile-menu-open {
    overflow: hidden !important;
    touch-action: none;
  }

  .site-header {
    position: sticky;
    top: 0;
    z-index: 900;
  }

  .desktop-primary-nav,
  .desktop-site-search {
    display: none !important;
  }

  .site-header .hero-brand__link {
    flex: 0 0 auto;
  }

  .mobile-menu-toggle {
    position: relative;
    z-index: 901;
    width: 42px !important;
    height: 42px !important;
    min-width: 42px;
    display: grid !important;
    place-items: center;
    align-content: center;
    gap: 5px;
    padding: 0 !important;
    border: 1px solid #dbe7ef !important;
    border-radius: 13px !important;
    color: var(--pv-blue) !important;
    background: #fff !important;
    box-shadow: 0 5px 16px rgba(31,63,88,.07) !important;
    cursor: pointer;
  }

  .mobile-menu-toggle span {
    width: 19px;
    height: 2px;
    display: block;
    border-radius: 10px;
    background: currentColor;
    transform: none !important;
    opacity: 1 !important;
  }

  /* Backdrop is a body-level fixed element, not a header descendant. */
  .mobile-menu-backdrop-v10 {
    position: fixed;
    z-index: 9998;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    display: block;
    padding: 0;
    border: 0;
    background: rgba(17,33,45,.42);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .24s ease, visibility .24s ease;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }

  body.mobile-menu-open .mobile-menu-backdrop-v10 {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .mobile-menu-panel {
    position: fixed;
    z-index: 9999;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(var(--pv-menu-width), 88vw);
    height: 100dvh;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: calc(18px + env(safe-area-inset-top, 0px)) 14px calc(18px + env(safe-area-inset-bottom, 0px));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    direction: rtl;
    text-align: right;
    border-left: 1px solid #dce6ed;
    border-radius: 24px 0 0 24px;
    background: #fff;
    box-shadow: -22px 0 58px rgba(18,42,60,.22);
    transform: translateX(105%);
    visibility: hidden;
    pointer-events: none;
    transition: transform .28s cubic-bezier(.22,.7,.28,1), visibility .28s ease;
  }

  body.mobile-menu-open .mobile-menu-panel {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  .mobile-menu-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 1px 13px;
    border-bottom: 1px solid #edf1f4;
  }

  .mobile-menu-panel__brand {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .mobile-menu-panel__brand > img {
    width: 46px;
    height: 46px;
    max-width: 46px;
    flex: 0 0 46px;
    object-fit: contain;
    border-radius: 12px;
  }

  .mobile-menu-panel__brand > div {
    min-width: 0;
    display: grid;
    gap: 0;
  }

  .mobile-menu-panel__brand strong {
    color: #244b6c;
    font-size: 16px;
    line-height: 1.55;
    font-weight: 800;
  }

  .mobile-menu-panel__brand span {
    color: #8b9aa7;
    font-size: 10.5px;
    line-height: 1.65;
    font-weight: 500;
  }

  .mobile-menu-panel__close {
    width: 40px;
    height: 40px;
    min-width: 40px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid #dce7ef;
    border-radius: 12px;
    color: var(--pv-blue);
    background: #f5f9fc;
    cursor: pointer;
  }

  .mobile-menu-panel__close svg {
    width: 18px;
    height: 18px;
  }

  .mobile-menu-search {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 7px;
  }

  .mobile-menu-search input {
    width: 100%;
    height: 46px;
    padding: 0 13px 0 48px;
    border: 1px solid #dce7ef;
    border-radius: 13px;
    outline: 0;
    color: #304f6d;
    background: #f8fafc;
    font: inherit;
    font-size: 12.5px;
    text-align: right;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
  }

  .mobile-menu-search input:focus {
    border-color: #b9d4e7;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(23,105,170,.07);
  }

  .mobile-menu-search button {
    position: absolute;
    left: 5px;
    top: 5px;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 10px;
    color: var(--pv-blue);
    background: #eef6fc;
    cursor: pointer;
  }

  .mobile-menu-search button svg {
    width: 17px;
    height: 17px;
  }

  .mobile-menu-list {
    display: grid;
    gap: 7px;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .mobile-menu-list li {
    margin: 0;
    padding: 0;
  }

  .mobile-menu-list a {
    width: 100%;
    min-height: 61px;
    display: grid;
    grid-template-columns: 40px minmax(0,1fr) 18px;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border: 1px solid #e5ecf1;
    border-radius: 14px;
    color: #304f6d;
    background: #fff;
    font-size: 13px;
    line-height: 1.6;
    font-weight: 750;
    text-align: right;
    transition: border-color .18s ease, background .18s ease, color .18s ease;
  }

  .mobile-menu-list a:hover,
  .mobile-menu-list a:focus-visible {
    border-color: #d2e3ee;
    color: var(--pv-blue);
    background: #f7fafc;
  }

  .mobile-menu-list__icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 11px;
    background: #f1f6fa;
  }

  .mobile-menu-list__icon img {
    width: 40px;
    height: 40px;
    object-fit: cover;
  }

  .mobile-menu-list__chevron {
    width: 16px;
    height: 16px;
    color: #98aaba;
  }

  .mobile-menu-panel__foot {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: auto;
    padding-top: 13px;
    border-top: 1px solid #edf1f4;
    color: #93a1ad;
    font-size: 10px;
  }

  .mobile-menu-panel__foot > span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #59b8c6;
  }

  /* Mobile/tablet slider is square. With a dedicated mobile source there is no crop. */
  .home-slider {
    aspect-ratio: 1 / 1 !important;
    width: 100% !important;
    height: auto !important;
    border-radius: 20px !important;
  }

  .home-slide,
  .home-slides,
  .home-slide__picture {
    width: 100% !important;
    height: 100% !important;
  }

  .home-slider__dots {
    top: 13px !important;
    right: 14px !important;
  }

  .home-slider__nav {
    left: 13px !important;
    bottom: 13px !important;
  }

  .categories-instruction {
    margin-bottom: 12px !important;
    padding-inline: 4px;
    font-size: 13px !important;
    line-height: 1.9;
  }

  .categories-toolbar {
    min-height: 40px;
    margin-bottom: 12px;
  }

  .categories-toolbar h2 {
    font-size: 18px;
  }

  .category-scroll-btn {
    width: 35px !important;
    height: 35px !important;
    min-width: 35px;
    border-radius: 10px !important;
  }

  .category-scroll-btn svg {
    width: 15px !important;
    height: 15px !important;
  }

  .category-scroller {
    --pv-category-gap: 12px;
    grid-auto-columns: calc((100% - var(--pv-category-gap)) / 2) !important;
    gap: var(--pv-category-gap) !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 1px 0 10px !important;
  }

  .category-card,
  .category-card:last-child {
    min-height: 0 !important;
    aspect-ratio: 1 / 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 14px 10px !important;
    border-radius: 19px !important;
  }

  .category-icon {
    width: 52px !important;
    height: 52px !important;
    min-width: 52px !important;
    flex-basis: 52px !important;
    margin: 0 0 11px !important;
  }

  .category-icon img {
    width: 52px !important;
    height: 52px !important;
  }

  .category-card > strong {
    font-size: clamp(11.5px, 3.5vw, 14px) !important;
    line-height: 1.65 !important;
  }

  .category-description {
    display: -webkit-box !important;
    max-width: 100%;
    margin: 8px 0 0 !important;
    overflow: hidden;
    font-size: clamp(9.3px, 2.7vw, 11px) !important;
    line-height: 1.75 !important;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
  }

  /* Hover-only behavior is irrelevant on touch; avoid sticky hover shifts. */
  @media (hover: none) {
    .category-card:hover {
      transform: none !important;
      border-color: rgba(224,230,236,.75) !important;
      box-shadow: none !important;
    }
  }
}

@media (max-width: 390px) {
  .container {
    width: min(calc(100% - 28px), var(--container));
  }

  .mobile-menu-panel {
    width: min(360px, 92vw);
  }

  .category-scroller {
    --pv-category-gap: 10px;
  }

  .category-card,
  .category-card:last-child {
    padding: 11px 8px !important;
    border-radius: 17px !important;
  }

  .category-description {
    -webkit-line-clamp: 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-menu-panel,
  .mobile-menu-backdrop-v10,
  .category-scroll-btn,
  .category-card {
    transition-duration: .01ms !important;
  }
}
