/* ===== Iqraa Header — Utility Bar (Above Header) ===== */
/* Root-cause fix: Astra's inner ".ast-above-header-bar" ships a default
   white background that sits directly on top of ".ast-above-header-wrap"
   and was hiding our navy bar + white text. Target both. */
.ast-above-header-wrap,
.ast-above-header-bar {
  background-color: #082D59 !important;
}
.ast-above-header-bar {
  padding-top: 7px !important;
  padding-bottom: 7px !important;
  min-height: unset !important;
}
.iqraa-utility-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}
.iqraa-utility-left a {
  color: #FFFFFF;
  font-size: 12.5px;
  text-decoration: none;
  white-space: nowrap;
}
.iqraa-utility-left a:hover {
  color: #D9A62E;
}
.iqraa-sep {
  color: rgba(255,255,255,0.35);
  margin: 0 10px;
  font-size: 12px;
}
.iqraa-lang-switch {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.iqraa-lang-switch a {
  color: #F8F4EB;
  font-size: 12.5px;
  text-decoration: none;
  white-space: nowrap;
}
.iqraa-lang-switch a.iqraa-lang-active {
  color: #D9A62E;
  font-weight: 700;
}
.iqraa-lang-switch a:hover {
  color: #D9A62E;
}

/* ===== Iqraa Header — Main Header (Primary) — compact + vertically centered ===== */
.ast-primary-header-bar {
  background-color: #FFFFFF;
}
.site-primary-header-wrap {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding-top: 6px !important;
  padding-bottom: 6px !important;
}
.site-header-primary-section-left {
  flex: 0 0 auto !important;
}
.site-header-primary-section-center {
  flex: 1 1 auto !important;
  max-width: none !important;
  width: auto !important;
  padding: 0 28px !important;
}
.site-header-primary-section-right {
  flex: 0 0 auto !important;
}
/* Real fix: Astra's primary header positions left/center/right via a
   nested CSS Grid row (".ast-builder-grid-row-has-sides"), not the outer
   wrap. Override its column tracks so center absorbs all extra space —
   this is what actually makes the search bar dominant. */
.ast-primary-header-bar .ast-builder-grid-row-has-sides {
  grid-template-columns: auto 1fr auto !important;
  align-items: center !important;
  width: 100% !important;
  display: grid !important;
}
.ast-site-identity {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}
/* Logo size now controlled natively via Customizer > Logo Width (140px desktop). */

/* Prominent, dominant product search */
.header-widget-area {
  width: 100%;
}
.header-widget-area .wp-block-search {
  width: 100%;
  max-width: 100%;
  margin-inline: auto;
}
.header-widget-area .wp-block-search__inside-wrapper {
  border: 2px solid #154734;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}
.header-widget-area .wp-block-search__input {
  border: none;
  padding: 12px 16px 12px 38px;
  font-size: 15px;
  background: #F8F4EB;
  color: #082D59;
  width: 100%;
}
.header-widget-area .wp-block-search__input:focus {
  outline: none;
  background: #FFFFFF;
}
.header-widget-area .wp-block-search__inside-wrapper::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 50%;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
  background-color: #154734;
  opacity: 0.55;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M15.5 14h-.79l-.28-.27a6.5 6.5 0 1 0-.7.7l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0A4.5 4.5 0 1 1 14 9.5 4.5 4.5 0 0 1 9.5 14z'/></svg>") no-repeat center / contain;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M15.5 14h-.79l-.28-.27a6.5 6.5 0 1 0-.7.7l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0A4.5 4.5 0 1 1 14 9.5 4.5 4.5 0 0 1 9.5 14z'/></svg>") no-repeat center / contain;
  pointer-events: none;
}
.header-widget-area .wp-block-search__button {
  background-color: #154734 !important;
  color: #FFFFFF !important;
  border: none;
  padding: 12px 24px;
  font-weight: 600;
  white-space: nowrap;
  border-radius: 0;
  cursor: pointer;
}
.header-widget-area .wp-block-search__button:hover {
  background-color: #D9A62E !important;
  color: #082D59 !important;
}

/* Account & Cart — icon + text label, navy with restrained gold accents */
.ast-header-account-wrap,
.ast-site-header-cart {
  display: flex;
  align-items: center;
}
.ast-header-account-link {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
}
.ast-header-account-link svg,
.ast-header-account-link svg path {
  fill: #082D59 !important;
}
.ast-header-account-link::after {
  content: "Account";
  font-size: 13px;
  font-weight: 600;
  color: #082D59;
  white-space: nowrap;
}
.ast-header-account-link:hover svg,
.ast-header-account-link:hover svg path {
  fill: #D9A62E !important;
}
.ast-header-account-link:hover::after {
  color: #D9A62E;
}
.ast-site-header-cart .cart-container {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
}
.ast-site-header-cart .ast-addon-cart-wrap {
  position: relative;
  display: inline-flex;
}
.ast-site-header-cart svg,
.ast-site-header-cart svg path,
.ast-site-header-cart .astra-icon.ast-icon-shopping-bag,
.ast-site-header-cart .astra-icon.ast-icon-shopping-bag path {
  fill: #082D59 !important;
}
.ast-site-header-cart .cart-container::after {
  content: "Cart";
  font-size: 13px;
  font-weight: 600;
  color: #082D59;
  white-space: nowrap;
}
.ast-site-header-cart:hover svg,
.ast-site-header-cart:hover svg path {
  fill: #D9A62E !important;
}
.ast-site-header-cart:hover .cart-container::after {
  color: #D9A62E;
}
.ast-site-header-cart .count,
.ast-site-header-cart-li .count {
  background-color: #D9A62E !important;
  color: #082D59 !important;
}
.ast-site-header-cart .ast-addon-cart-wrap {
  border-color: #082D59 !important;
}

/* ===== Iqraa Header — Below Header: full-width green navigation ===== */
/* The row wrapper already spans the full browser width edge-to-edge;
   paint it green there so the bar is full-bleed, while the menu items
   stay inside the normal content container (unchanged mega-menu markup). */
.ast-below-header-wrap,
.ast-below-header-bar {
  background-color: #154734 !important;
}
.ast-below-header-bar {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}
.main-header-menu.ast-nav-menu > .menu-item > a {
  color: #FFFFFF;
}
.main-header-menu.ast-nav-menu > .menu-item > a:hover,
.main-header-menu.ast-nav-menu > .menu-item.current-menu-item > a {
  color: #D9A62E;
}

/* ===== RTL readiness for custom Iqraa header elements ===== */
[dir="rtl"] .iqraa-utility-left,
[dir="rtl"] .iqraa-lang-switch {
  flex-direction: row-reverse;
}
[dir="rtl"] .header-widget-area .wp-block-search__inside-wrapper {
  flex-direction: row-reverse;
}
[dir="rtl"] .header-widget-area .wp-block-search__input {
  text-align: right;
  padding: 12px 38px 12px 16px;
}
[dir="rtl"] .header-widget-area .wp-block-search__inside-wrapper::before {
  left: auto;
  right: 13px;
}
[dir="rtl"] .ast-header-account-link,
[dir="rtl"] .ast-site-header-cart .cart-container {
  flex-direction: row-reverse;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .header-widget-area .wp-block-search {
    max-width: 100%;
  }
  .iqraa-utility-left,
  .iqraa-lang-switch {
    justify-content: center;
    font-size: 12px;
  }
  .site-primary-header-wrap {
    flex-wrap: wrap;
  }
}


/* ===== Iqraa Global Palette — remaining default WP/WooCommerce blue cleanup ===== */
/* Back-to-top scroll button */
#ast-scroll-top {
  background-color: #154734 !important;
}
#ast-scroll-top:hover {
  background-color: #D9A62E !important;
}
/* Small on-card quick-action icon (hover overlay on product thumbnails) */
.ast-on-card-button {
  color: #154734 !important;
}
.ast-on-card-button:hover {
  color: #D9A62E !important;
}

/* ===== Shop / Catalog page polish (product archive grid, cards, empty states) ===== */
.woocommerce ul.products {
	  display: grid !important;
	  grid-template-columns: repeat(4, 1fr);
	  gap: 26px;
}
.woocommerce ul.products li.product {
	  float: none !important;
	  width: auto !important;
	  margin: 0 !important;
	  padding: 0 !important;
	  display: flex;
	  flex-direction: column;
	  background: #fff;
	  border: 1px solid #E4DFD1;
	  border-radius: 12px;
	  overflow: hidden;
	  transition: box-shadow .2s ease, transform .2s ease;
}
.woocommerce ul.products li.product:hover {
	  box-shadow: 0 10px 24px rgba(11,34,58,.10);
	  transform: translateY(-3px);
}
.woocommerce ul.products li.product .astra-shop-thumbnail-wrap {
	  display: block;
	  position: relative;
	  aspect-ratio: 1 / 1;
	  background: #F5F4EF;
	  overflow: hidden;
}
.woocommerce ul.products li.product .astra-shop-thumbnail-wrap img {
	  width: 100%;
	  height: 100%;
	  object-fit: contain;
	  padding: 18px;
}
.woocommerce ul.products li.product .astra-shop-summary-wrap {
	  display: flex;
	  flex-direction: column;
	  flex: 1;
	  padding: 18px 20px 20px;
}
.woocommerce ul.products li.product .ast-woo-product-category {
	  font-size: 11px;
	  letter-spacing: .06em;
	  text-transform: uppercase;
	  font-weight: 700;
	  margin-bottom: 6px;
}
.woocommerce ul.products li.product .ast-loop-product__link {
	  font-size: 16px;
	  line-height: 1.4;
	  font-weight: 700;
	  color: #0B223A;
	  margin-bottom: 10px;
	  display: block;
	  min-height: 44px;
}
.woocommerce ul.products li.product .price {
	  color: #154734;
	  font-weight: 700;
	  margin: 0 0 12px;
	  order: 2;
}
.woocommerce ul.products li.product > .astra-shop-summary-wrap > a.button,
.woocommerce ul.products li.product .astra-shop-summary-wrap .added_to_cart {
	  margin-top: auto;
	  align-self: flex-start;
	  background: #154734 !important;
	  color: #fff !important;
	  border-radius: 8px;
	  padding: 10px 18px;
	  font-weight: 600;
	  border: none;
}
.woocommerce ul.products li.product > .astra-shop-summary-wrap > a.button:hover {
	  background: #0F3526 !important;
}
/* Generic WooCommerce notices (no products found, search results, filters) */
.woocommerce-info,
.woocommerce-message,
.woocommerce > p.woocommerce-info {
	  background: #F6F4EE;
	  border: 1px solid #E4DFD1;
	  border-top: 3px solid #154734;
	  color: #0B223A;
	  border-radius: 10px;
	  padding: 20px 22px;
	  font-size: 15px;
	  list-style: none;
}
.woocommerce-info::before {
	  color: #154734;
}
/* On-brand empty-category / empty-search CTA (term description + JS-revealed shop panel) */
.term-description,
.iqraa-empty-cta {
	  background: #F6F4EE;
	  border: 1px solid #E4DFD1;
	  border-radius: 10px;
	  padding: 18px 22px;
	  color: #3B4450;
	  margin: 4px 0 22px;
	  font-size: 15px;
	  line-height: 1.6;
}
.term-description a,
.iqraa-empty-cta a {
	  color: #154734;
	  font-weight: 700;
	  text-decoration: underline;
	  text-underline-offset: 3px;
}
.term-description a:hover,
.iqraa-empty-cta a:hover {
	  color: #8F6714;
}
@media (max-width: 900px) {
	.woocommerce ul.products {
		    grid-template-columns: repeat(3, 1fr) !important;
	}
}
@media (max-width: 600px) {
	.woocommerce ul.products {
		    grid-template-columns: repeat(2, 1fr) !important;
		    gap: 16px;
	}
	.woocommerce ul.products li.product .astra-shop-summary-wrap {
		    padding: 14px 14px 16px;
	}
}

/* ===== Iqraa Mobile Fix -- TranslatePress Floating Language Switcher (Item 5) =====
   Root cause: nav.trp-language-switcher.trp-floating-switcher is position:fixed
   bottom-right. Its closed-state button (flag + "English" text label) is
   about 117px wide, which is fine on desktop but overlaps the last lines of
   product description text on narrow/mobile viewports, since the widget
   stays fixed on screen while the page scrolls beneath it.
   Fix (mobile widths only): shrink the CLOSED button to a small icon-only
   circle by hiding the text label and centering the flag -- this removes
   the overlap footprint by roughly 60%. When the visitor taps it open, the
   :has() rules below restore the normal padded/labeled layout so the
   language dropdown list still renders at full, readable size -- tap
   behavior and the language links themselves are completely unchanged.
   Desktop is untouched; this only applies at <=782px (WP's own mobile
   breakpoint), matching where the report's overlap was observed. */
@media (max-width: 782px) {
  nav.trp-language-switcher.trp-floating-switcher {
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
  }
  nav.trp-language-switcher.trp-floating-switcher .trp-language-switcher-inner {
    height: 100%;
  }
  nav.trp-language-switcher.trp-floating-switcher .trp-language-item__current {
    display: flex !important;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 0 !important;
  }
  nav.trp-language-switcher.trp-floating-switcher .trp-language-item__current .trp-language-item-name {
    display: none;
  }
  /* Dropdown open: let the widget grow back to its normal size so the
     language list is fully visible and tappable, instead of being
     squeezed into the 44px closed-state circle. */
  nav.trp-language-switcher.trp-floating-switcher:has(.trp-language-item__current[aria-expanded="true"]) {
    width: var(--switcher-width, auto) !important;
    height: auto !important;
    border-radius: 8px 8px 0 0 !important;
  }
  nav.trp-language-switcher.trp-floating-switcher:has(.trp-language-item__current[aria-expanded="true"]) .trp-language-switcher-inner {
    height: auto;
  }
  nav.trp-language-switcher.trp-floating-switcher:has(.trp-language-item__current[aria-expanded="true"]) .trp-language-item__current {
    height: auto;
    padding: var(--switcher-padding, 10px) !important;
  }
  nav.trp-language-switcher.trp-floating-switcher:has(.trp-language-item__current[aria-expanded="true"]) .trp-language-item__current .trp-language-item-name {
    display: inline;
  }
}


/* ===== Iqraa Fix -- Additional ISBN field placement (Item 6) =====
   Root cause: .summary.entry-summary is a column flexbox where every child
   has an explicit CSS "order" (breadcrumb=1, category=2, title=3,
   identity=4, quick-facts=5, price=6, sold-by=7, product_meta=10, ...)
   EXCEPT .iqraa-additional-isbn, which has no order rule and so falls back
   to the flexbox default (order:0). Order:0 sorts before order:1+, so the
   ISBN line renders grouped with the other order:0 items (Add to Cart form,
   Apple/Google/Link Pay buttons) at the very top of the column -- above the
   breadcrumb and title -- on BOTH mobile and desktop (checked live at
   500px and 1440px: the bug is identical on both, not mobile-only).
   Fix: give it order:6, tying it with .price so it renders immediately
   after Price (source-order tiebreak) -- next to Publisher/Language/
   Resource Type and price, i.e. the product-information area, and before
   "Sold by". No display:none is needed for the empty case -- the template
   already omits this div entirely when there's no Additional ISBN value
   (confirmed: absent from the DOM on products without the field). */
.summary.entry-summary > .iqraa-additional-isbn {
  order: 6;
}


/* =====================================================================
 * RTL/bidi fix - Arabic and mixed Arabic/English product titles
 * Site base direction is LTR, but many product titles are pure Arabic
 * or mixed Arabic/English. unicode-bidi: plaintext makes each title's
 * alignment/direction follow its own first-strong character, without
 * changing the site-wide ltr base direction or any markup.
 * Presentational only - no template, query, or business-logic change.
 * ===================================================================== */
h1.product_title.entry-title,
.woocommerce-loop-product__title,
.products .woocommerce-loop-product__title,
.single-product .product_title {
	unicode-bidi: plaintext !important;
}


/* =====================================================================
 * Mobile header overflow fix
 * Root cause: on narrow phone viewports, the header row (logo + cart +
 * account + hamburger) has no responsive shrinking, so combined content
 * width exceeds the device viewport and forces real horizontal page
 * scroll/overflow on mobile. Confirmed via device-width diagnostics
 * (layout viewport ~469px vs 375px device width on Shop, etc.).
 * Fix: shrink the logo and trim icon-row padding only at <=480px,
 * which brings total header content back within the viewport.
 * Desktop/tablet header is untouched (rule is scoped to <=480px).
 * ===================================================================== */
@media (max-width: 480px) {
	.ast-primary-header-bar { padding-left: 8px !important; padding-right: 8px !important; }
	.site-header-primary-section-center { padding-left: 2px !important; padding-right: 2px !important; }
	.site-header-primary-section-left img.custom-logo { max-width: 86px !important; width: 86px !important; height: auto !important; }
}
