/* ============================================================
   SAFQA — Amazon-Style Header & Footer  v6
   Minimal, surgical overrides only on header/footer zones.
   NO broad .tygh-header a/span rules — target only the
   specific elements that need Amazon colors.
   ============================================================ */

:root {
  --amazon-dark:   #131921;
  --amazon-nav:    #232f3e;
  --amazon-mid:    #37475a;
  --amazon-yellow: #febd69;
  --amazon-hover:  #f3a847;
}

/* ── TRUST BAR ──────────────────────────────────────────────── */
.safqa-trust-bar {
  background: var(--amazon-nav) !important;
  color: #ccc;
  font-size: 13px;
  text-align: center;
  padding: 6px 16px;
  border-bottom: 1px solid var(--amazon-mid);
}
.safqa-trust-bar__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 24px;
}
.safqa-trust-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #ccc;
  white-space: nowrap;
}
.safqa-trust-item__icon { font-size: 14px; }

/* ── TOP PANEL ─────────────────────────────────────────────── */
.tygh-top-panel {
  background: var(--amazon-dark) !important;
  border-bottom: none !important;
}
/* Only text-link elements directly in top panel — not dropdowns */
.tygh-top-panel > [class*=container] .ty-text-links__a,
.tygh-top-panel > [class*=container] .ty-geo-maps__geolocation__opener,
.tygh-top-panel > [class*=container] .ty-geo-maps__geolocation__opener-text {
  color: #ccc !important;
}
.tygh-top-panel > [class*=container] .ty-text-links__a:hover { color: #fff !important; }

/* ── HEADER BACKGROUND ONLY ─────────────────────────────────── */
/* Sets background without touching any text/links */
.tygh-header,
#tygh_main_container .tygh-header,
body.floating-header #tygh_main_container .tygh-header,
body.fixed-header   #tygh_main_container .tygh-header {
  background: var(--amazon-dark) !important;
  border-bottom: none !important;
  box-shadow: none !important;
}

/* Row 1 (logo + search) */
.tygh-header > [class*=container] > div:nth-child(1) {
  background: var(--amazon-dark) !important;
}
/* Row 2 (nav bar) — Safqa_Amazon.less already compiles this correctly */
body #tygh_main_container .tygh-header > [class*=container] > div:nth-child(2) {
  background: var(--amazon-nav) !important;
}

/* ── SPECIFIC HEADER ELEMENTS (no broad a/span rules) ───────── */
/* Logo area */
.tygh-header .ty-logo-container a { color: inherit !important; }

/* Cart icon count badge */
.ty-minicart-count {
  background: var(--amazon-yellow) !important;
  color: var(--amazon-dark) !important;
}
/* Cart/account icon text — only the label spans, not dropdowns */
.tygh-header .ty-minicart-title { color: #fff !important; }
.tygh-header .ut2-top-my-account > a > span,
.tygh-header .ut2-top-compared-products > a > span,
.tygh-header .ut2-top-wishlist-count > a > span { color: #fff !important; }

/* ── SEARCH ─────────────────────────────────────────────────── */
.tygh-header .ty-search-block__input {
  background: #fff !important;
  color: #0f1111 !important;
  border: 2px solid var(--amazon-yellow) !important;
}
.tygh-header .ty-search-magnifier,
.tygh-header .ut2-btn-search {
  background: var(--amazon-yellow) !important;
  color: var(--amazon-dark) !important;
  border: 2px solid var(--amazon-yellow) !important;
}
.tygh-header .ty-search-magnifier:hover,
.tygh-header .ut2-btn-search:hover {
  background: var(--amazon-hover) !important;
}

/* ── NAV BAR — scoped to row 2 div only (never matches sidebar) ── */
/* div:nth-child(2) is the nav bar row; sidebar is in .ut2-sw-w outside this div */
.tygh-header > [class*=container] > div:nth-child(2) .ut2-fm > .ut2-fmw > .ut2-lfl > p > a,
.tygh-header > [class*=container] > div:nth-child(2) .ut2-fm > .ut2-fmw > .ut2-lfl > p > a > span {
  color: #fff !important;
}
/* Nav item hover — Amazon mid-tone pill, row 2 only */
.tygh-header > [class*=container] > div:nth-child(2) .ut2-fm > .ut2-fmw > .ut2-lfl:hover > p,
.tygh-header > [class*=container] > div:nth-child(2) .ut2-fm > .ut2-fmw > .ut2-lfl.open > p {
  background: var(--amazon-mid) !important;
  border-radius: 3px;
}

/* Flyout dropdown panel — white background */
.tygh-header .ut2-lfl > div {
  background-color: #fff !important;
  box-shadow: 0 6px 20px rgba(0,0,0,0.18) !important;
}

/* Flyout panel text — dark on white (UT2's --color-link is teal, override it) */
/* Column header links — dark bold, like Amazon's mega-menu headings */
.tygh-header .ut2-lfl > div .ut2-lsl > p > a,
.tygh-header .ut2-lfl > div .ut2-lsl > p > span {
  color: #0f1111 !important;
  font-weight: 700 !important;
}
/* Sub-item links inside flyout columns */
.tygh-header .ut2-lfl > div .ut2-lsl li > a,
.tygh-header .ut2-lfl > div .ut2-lsl ul > li > a {
  color: #0f1111 !important;
  font-weight: normal !important;
}
/* Hover — Amazon orange-brown */
.tygh-header .ut2-lfl > div .ut2-lsl a:hover {
  color: #c7511f !important;
  text-decoration: underline !important;
}
/* "See more" / المزيد — Amazon teal for secondary action links */
.tygh-header .ut2-lfl > div .ut2-see-more,
.tygh-header .ut2-lfl > div .ut2-see-more a,
.tygh-header .ut2-lfl > div p > a[href*="categories"],
.tygh-header .ut2-lfl > div .ut2-lsl > p + a {
  color: #007185 !important;
  font-weight: normal !important;
}

/* ── FOOTER ─────────────────────────────────────────────────── */
.ty-footer-grid,
.container-fluid.ty-footer-grid {
  background: var(--amazon-nav) !important;
}
.ty-footer-grid h3,
.ty-footer-grid h4,
.ty-footer-grid .ty-footer-general__header { color: #fff !important; }
.ty-footer-grid a,
.ty-footer-menu a { color: #ddd !important; }
.ty-footer-grid a:hover,
.ty-footer-menu a:hover { color: #fff !important; }

/* ── FOOTER FULL-WIDTH FIX ──────────────────────────────────── */
/* Remove container padding so footer zones are truly edge-to-edge */
.ty-footer-grid.container-fluid {
  padding-left: 0 !important;
  padding-right: 0 !important;
  max-width: none !important;
}

/* ── BACK TO TOP ─────────────────────────────────────────────── */
.amazon-back-to-top,
.amazon-back-to-top .row-fluid,
.amazon-back-to-top .span16,
.amazon-back-to-top .ty-wysiwyg-content {
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
  display: block !important;
  background: var(--amazon-mid) !important;
}
.amazon-back-to-top a {
  display: block !important;
  background: var(--amazon-mid) !important;
  color: #fff !important;
  text-align: center !important;
  padding: 14px 0 !important;
  font-size: 13px !important;
  text-decoration: none !important;
  cursor: pointer !important;
  width: 100% !important;
}
.amazon-back-to-top a:hover { background: #485769 !important; }

/* ── FOOTER COLUMNS ─────────────────────────────────────────── */
.ty-footer-menu.b-top,
.ty-footer-menu.b-top .row-fluid,
.ty-footer-menu.b-top > .row-fluid > .span16 {
  background: var(--amazon-nav) !important;
  width: 100% !important;
  margin: 0 !important;
  float: none !important;
  display: block !important;
  box-sizing: border-box !important;
}
/* Footer columns — Amazon-style: max 1200px centered, 4 tight columns */
.ty-footer-menu.b-top > .row-fluid > .span16 > .row-fluid {
  display: flex !important;
  justify-content: flex-start !important;
  flex-wrap: nowrap !important;
  gap: 0 !important;
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: 36px 20px 28px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}
.ty-footer-menu.b-top .span4 {
  width: 25% !important;
  flex: 0 0 25% !important;
  float: none !important;
  box-sizing: border-box !important;
  padding-inline-end: 20px !important;
}
.ty-footer-menu.b-top .span4 .ty-float-left {
  float: none !important;
  width: 100% !important;
}
.ty-footer-menu.b-top h3,
.ty-footer-menu.b-top h4 {
  color: #fff !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  margin: 0 0 10px !important;
}
.ty-footer-menu.b-top ul {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
.ty-footer-menu.b-top li a,
.ty-footer-menu.b-top a {
  color: #ccc !important;
  font-size: 13px !important;
  line-height: 2 !important;
  display: block !important;
  text-decoration: none !important;
}
.ty-footer-menu.b-top li a:hover,
.ty-footer-menu.b-top a:hover { color: #fff !important; }

/* Language/currency mid bar — centered, max 1200px */
.amazon-footer-mid .ty-wysiwyg-content > div {
  text-align: center !important;
  max-width: 1200px !important;
  margin: 0 auto !important;
}

/* Back to top — center text, full-width */
.amazon-back-to-top .ty-wysiwyg-content a,
.amazon-back-to-top a[onclick] {
  text-align: center !important;
  display: block !important;
  width: 100% !important;
}

/* ── FOOTER MID (language/currency) ─────────────────────────── */
.amazon-footer-mid,
.amazon-footer-mid .row-fluid,
.amazon-footer-mid .span16,
.amazon-footer-mid .ty-wysiwyg-content {
  background: var(--amazon-nav) !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
  display: block !important;
}

/* ── COPYRIGHT BAR ───────────────────────────────────────────── */
.footer-copyright,
.ty-footer-grid__full-width.footer-copyright,
.ty-footer-grid .container-fluid-row:last-child,
.ty-footer-grid .container-fluid-row:last-child .row-fluid,
.footer-copyright .row-fluid,
.footer-copyright .span16,
.footer-copyright .span24,
.footer-copyright .ty-float-left,
.footer-copyright .ty-wysiwyg-content,
.footer-copyright .ty-wysiwyg-content > div {
  background: var(--amazon-dark) !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
  display: block !important;
  box-sizing: border-box !important;
  max-width: none !important;
}
.footer-copyright .ty-wysiwyg-content > div {
  padding: 15px 20px !important;
  text-align: center !important;
  border-top: 1px solid #3a4553 !important;
  max-width: 1200px !important;
  margin: 0 auto !important;
  box-sizing: border-box !important;
}
.footer-copyright,
.footer-copyright a,
.footer-copyright span,
.footer-copyright p { color: #999 !important; }
.footer-copyright a { font-size: 12px !important; text-decoration: none !important; margin: 0 8px !important; }
.footer-copyright a:hover { color: #fff !important; }

/* Float fix for footer-mid and copyright inner divs */
.amazon-footer-mid .ty-float-left,
.amazon-footer-mid .span16,
.footer-copyright .ty-float-left,
.footer-copyright .span16,
.footer-copyright .span24 {
  float: none !important;
  display: block !important;
  width: 100% !important;
  text-align: center !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Override max-width constraint inside footer full-width rows */
.ty-footer-grid .container-fluid-row-full-width > .row-fluid,
.ty-footer-grid .container-fluid-row > .row-fluid,
.amazon-back-to-top > .row-fluid,
.ty-footer-menu.b-top > .row-fluid,
.amazon-footer-mid > .row-fluid,
.footer-copyright > .row-fluid {
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
}

body { font-family: "Inter", "Amazon Ember", Arial, sans-serif !important; }


/* -- FIX: SPACING BELOW HEADER ------------------------------- */
.tygh-header { margin-bottom: 0 !important; }
.tygh-content { padding-top: 0 !important; }
.ty-breadcrumbs { margin-top: 0 !important; padding-top: 15px !important; margin-bottom: 5px !important; }

/* -- FIX: GRID BLEED IN CATEGORY PAGES ------------------------------- */
.grid-list .ut2-gl__item { height: auto !important; min-height: 100% !important; }
.grid-list .ut2-gl__body { height: 100% !important; min-height: 100% !important; background: #fff !important; }


.tygh-content { background-color: #fff !important; }
.cat-content-grid { padding-top: 0 !important; }

/* ── Hide empty sticky filter bar ─────────────────────────────────────────
   :empty doesn't work because the container has hidden children.
   Instead: zero out height + background so it takes no visual space.
   The real fix is to also hide when it contains ONLY .hidden-desktop items.   */
.top-sticky-panel__filters:empty { display: none !important; }

/* Case 1: panel has no horizontal filters (PDP, pages without filters) —
   it contains only .ut2-categories.hidden-desktop which is display:none.
   The span16 wrapper is empty-looking → collapse the whole panel height.    */
.top-sticky-panel__filters:not(:has(.ty-horizontal-product-filters)):not(:has(.ut2-hz-filters)) {
    height: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    overflow: hidden !important;
    background: transparent !important;
}
/* Case 2: The span16 inside is visually empty (only hidden children) */
.top-sticky-panel__filters .span16:not(:has(.ty-horizontal-product-filters)):not(:has(.ut2-hz-filters)) {
    display: none !important;
}
/* Make the panel transparent + zero-height when inner span is hidden */
.top-sticky-panel__filters:has(.span16:empty),
.top-sticky-panel__filters:has(.span16 > .hidden-desktop:only-child) {
    height: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    overflow: hidden !important;
}

