/* Emporium site CSS - survives theme updates. Loaded by site-custom-code.php */

/* Category pages: subcategory link row (generated by categories/category_links.py).
   Colour = theme link colour (blue). */
.tax-product_cat .page-description p:has(> a[href^="/product-category/"]) {
  font-size: 19px;
  line-height: 1.9;
  margin-top: 0.9em;
}
.tax-product_cat .page-description a[href^="/product-category/"] {
  white-space: nowrap;
}
.tax-product_cat .page-description a[href^="/product-category/"]:hover {
  text-decoration: underline;
}
/* current category in the link row: maroon + underline, like the nav current item */
.tax-product_cat .page-description p:has(> a[href^="/product-category/"]) strong {
  color: #781414; text-decoration: underline 2px #781414; text-underline-offset: 5px; white-space: nowrap;
}

/* Product grid tiles: uniform 4:3 tiles, whole photo always visible.
   Blocksy: Product Archives > Card Options > Product Image > Image Ratio = Original
   (uncropped thumbnail files); this rule then forces the 4:3 tile shape.
   4:3 = median/most common main-image ratio (44%; 23% 16:9, 20% 3:4). */
ul.products li.product .ct-media-container img {
  aspect-ratio: 4 / 3 !important;
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* Header (desktop): logo as large as fits; Blocksy collapses the menu into "More"
   when menu width > container - logo - search, so logo steps down by width.
   Menu in normal case (theme uppercased it -> "HI-FI"). Tested 1024-1920px. */
#header [data-device="desktop"] [data-id="logo"] .site-logo-container { --logo-max-height: 64px !important; }
#header-menu-1 { --menu-items-spacing: 13px !important; }
#header-menu-1 .menu > li > .ct-menu-link { text-transform: none !important; letter-spacing: 0 !important; font-size: 14px !important; }
/* current item: maroon + underline bar (bold alone was invisible: menu already bold) */
#header-menu-1 .menu > li.current-menu-item > .ct-menu-link,
#header-menu-1 .menu > li.current-menu-ancestor > .ct-menu-link,
#header-menu-1 .menu > li.current-menu-parent > .ct-menu-link {
  color: #781414 !important; text-decoration: underline 3px #781414 !important; font-weight: 800 !important; text-underline-offset: 7px;
}
#header-menu-1 .menu > li > .ct-menu-link { font-weight: 600 !important; }
#header-menu-1 .sub-menu li.current-menu-item > .ct-menu-link { font-weight: 700 !important; }
@media (max-width: 1439px) {
  #header [data-device="desktop"] [data-id="logo"] .site-logo-container { --logo-max-height: 60px !important; }
  #header-menu-1 { --menu-items-spacing: 11px !important; }
}
@media (max-width: 1365px) {
  #header [data-device="desktop"] [data-id="logo"] .site-logo-container { --logo-max-height: 54px !important; }
  #header-menu-1 { --menu-items-spacing: 9px !important; }
  #header-menu-1 .menu > li > .ct-menu-link { font-size: 13px !important; }
}
@media (max-width: 1279px) {
  #header [data-device="desktop"] [data-id="logo"] .site-logo-container { --logo-max-height: 48px !important; }
  #header-menu-1 { --menu-items-spacing: 7px !important; }
}
@media (max-width: 1199px) {
  #header [data-device="desktop"] [data-id="logo"] .site-logo-container { --logo-max-height: 42px !important; }
  #header-menu-1 { --menu-items-spacing: 6px !important; }
  #header-menu-1 .menu > li > .ct-menu-link { font-size: 12px !important; }
}
@media (max-width: 1099px) {
  #header [data-device="desktop"] [data-id="logo"] .site-logo-container { --logo-max-height: 36px !important; }
  #header-menu-1 { --menu-items-spacing: 6px !important; }
}
/* Basket in header (added at switch-over 28 Nov): icon + count badge only, no "£0.00" text,
   so the whole menu still fits; logo one step smaller than before at each width. */
#header [data-id="cart"] .ct-label { display: none !important; }
#header [data-device="desktop"] [data-id="cart"] { margin-inline-start: 4px !important; }
#header [data-device="desktop"] [data-id="logo"] .site-logo-container { --logo-max-height: 54px !important; }
@media (max-width: 1439px) { #header [data-device="desktop"] [data-id="logo"] .site-logo-container { --logo-max-height: 48px !important; } }
@media (max-width: 1365px) { #header [data-device="desktop"] [data-id="logo"] .site-logo-container { --logo-max-height: 44px !important; } }
@media (max-width: 1279px) { #header [data-device="desktop"] [data-id="logo"] .site-logo-container { --logo-max-height: 40px !important; } }
@media (max-width: 1199px) { #header [data-device="desktop"] [data-id="logo"] .site-logo-container { --logo-max-height: 36px !important; } }
@media (max-width: 1099px) { #header [data-device="desktop"] [data-id="logo"] .site-logo-container { --logo-max-height: 32px !important; } }
/* "My Account" menu item (class ehf-account, menu 2): person icon in the desktop header, text in the mobile drawer */
#header-menu-1 .menu > li.ehf-account > .ct-menu-link { font-size: 0 !important; text-decoration: none !important; padding-inline: 6px 2px; }
#header-menu-1 .menu > li.ehf-account > .ct-menu-link::before {
  /* Blocksy uses a:before as its hover underline (absolute, 2px, opacity 0) - undo that here */
  position: static !important; opacity: 1 !important; height: 16px !important; margin: 0 !important; transition: none !important;
  content: ""; display: inline-block; width: 16px; background: currentColor !important;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8' r='4.2'/%3E%3Cpath d='M3.5 21.5c.8-4.6 4.2-7 8.5-7s7.7 2.4 8.5 7'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8' r='4.2'/%3E%3Cpath d='M3.5 21.5c.8-4.6 4.2-7 8.5-7s7.7 2.4 8.5 7'/%3E%3C/svg%3E") center/contain no-repeat;
}
#header-menu-1 .menu > li.ehf-account > .ct-menu-link:hover::before { background: #781414 !important; }
/* close the gap person icon -> search to match search -> basket */
#header [data-device="desktop"] [data-id="search"] { margin-inline-start: 0 !important; }
@media (max-width: 1099px) {
  #header-menu-1 { --menu-items-spacing: 4px !important; }
  #header-menu-1 .menu > li > .ct-menu-link { font-size: 11.5px !important; }
}
/* Mobile: logo smaller so it doesn't run under the basket icon */
@media (max-width: 479px) { #header [data-device="mobile"] [data-id="logo"] .site-logo-container { --logo-max-height: 30px !important; } }
@media (min-width: 480px) and (max-width: 689px) { #header [data-device="mobile"] [data-id="logo"] .site-logo-container { --logo-max-height: 36px !important; } }

/* Sell Your Hi-fi page (built by ~/ebay-sync-deploy/sell_page/build_sell_page.py) */
.ehf-lead { font-size: 1.15em; }
.ehf-contact {
  background: #fbf7ef;
  border-left: 4px solid #781414;
  border-radius: 4px;
  padding: 1em 1.4em;
  margin: 1.5em 0;
}
.ehf-contact p { margin: .3em 0; }
.ehf-cta {
  text-align: center;
  font-size: 1.1em;
  padding: 1em;
  border-top: 1px solid rgba(43, 35, 32, .15);
}
.ehf-brands {
  list-style: none;
  padding: 0;
  margin: 1em 0 2em;
  columns: 5 140px;
  column-gap: 1.5em;
  font-size: .95em;
  line-height: 1.7;
}
.ehf-brands li { break-inside: avoid; margin: 0; }

/* Nav dropdown: match header (white, slate text, maroon accent) instead of theme navy */
#header [data-id="menu"] .sub-menu {
  --dropdown-background-color: #fff; background-color: #fff !important;
  --dropdown-divider: 1px solid rgba(43, 35, 32, .08);
  border-top: 3px solid #781414;
  --theme-box-shadow: 0 10px 24px rgba(43, 35, 32, .14);
  --dropdown-width: 250px; width: 250px !important;
}
#header [data-id="menu"] .sub-menu .ct-menu-link {
  --theme-link-initial-color: #3a4f66; --theme-link-hover-color: #781414;
  font-size: 14px !important; font-weight: 500 !important;
}
#header [data-id="menu"] .sub-menu .ct-menu-link:hover { background: #fbf7ef; }
#header [data-id="menu"] .sub-menu li.current-menu-item > .ct-menu-link {
  --theme-link-initial-color: #781414; font-weight: 700 !important; background: #fbf7ef;
}

/* Footer: compact. Addresses side by side, Shipping & Returns + socials (FB, Instagram;
   set via site_edits/footer/socials.php) as a thin strip below, empty copyright row hidden. */
#footer { display: flex; flex-direction: column; }
#footer [data-row="middle"] { order: 1; }
#footer [data-row="top"] { order: 2; }
#footer [data-row="bottom"], #footer [data-column="ghost"] { display: none !important; }
#footer [data-row="middle"] > div { --container-spacing: 28px !important; --grid-template-columns: repeat(2, max-content) !important; column-gap: 48px !important; }
#footer [data-row="middle"] p { margin: 0; line-height: 1.6; }
#footer [data-row="top"] > div { --container-spacing: 12px !important; border-top: 1px solid rgba(43, 35, 32, .1); }
@media (max-width: 999px) {
  #footer [data-row="middle"] > div { --grid-template-columns: 1fr !important; row-gap: 20px; }
}
#footer [data-row="top"] [data-column="socials"] { --horizontal-alignment: flex-end; justify-content: flex-end; }
@media (max-width: 999px) { #footer [data-row="top"] > div { display: flex !important; justify-content: space-between; align-items: center; } }
/* footer strip: same scale as the addresses */
#footer [data-id="menu"] .ct-menu-link { font-size: 16px !important; text-transform: none !important; font-weight: 600 !important; letter-spacing: 0 !important; }
#footer [data-id="socials"] { --theme-icon-size: 22px !important; }
#footer [data-id="socials"] .ct-social-box { gap: 16px; }

/* Category pages on phones: compress header so products appear sooner (2026-11-14) */
@media (max-width: 689px) {
  body.tax-product_cat [data-prefix="woo_categories"] .hero-section[data-type="type-2"],
  body.tax-product_cat .hero-section[data-type="type-2"] { --container-padding: 16px 0 12px !important; }
  body.tax-product_cat .hero-section .entry-header .page-title { --theme-font-size: 24px !important; margin-bottom: 8px; }
  body.tax-product_cat .site-main > .ct-container,
  body.tax-product_cat .site-main > .ct-container-full { padding-top: 14px !important; }
  body.tax-product_cat [data-products] .product figure { --product-element-spacing: 14px; }
  .tax-product_cat .page-description p { font-size: 14px; line-height: 1.5; margin-bottom: 0; }
  .tax-product_cat .page-description p:has(> a[href^="/product-category/"]) { font-size: 15px; line-height: 1.75; margin-top: .6em; }
  body.tax-product_cat { --theme-content-vertical-spacing: 14px; }
  .tax-product_cat .woo-listing-top { margin-bottom: 12px; }
}

/* Site-wide: buttons + radio/checkbox/focus in brand maroon (links stay theme blue) (2026-11-14) */
:root {
  --theme-button-background-initial-color: #781414 !important;
  --theme-button-background-hover-color: #5a0e0e !important;
  --theme-form-selection-field-active-color: #781414 !important;
  --theme-form-field-border-focus-color: #781414 !important;
}

/* Checkout address autocomplete dropdown (custom.js) */
.ehf-ac-wrap { position: relative; display: block; }
.ehf-ac { position: absolute; left: 0; right: 0; top: 100%; z-index: 60; margin: 2px 0 0; padding: 0; list-style: none;
  background: #fff; border: 1px solid var(--theme-border-color); border-top: 3px solid #781414; box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.ehf-ac li { margin: 0; padding: 9px 12px; cursor: pointer; line-height: 1.35; font-size: 15px; color: #2b2320; }
.ehf-ac li small { display: block; color: #6b6058; font-size: 13px; }
.ehf-ac li.on, .ehf-ac li:hover { background: #fbf7ef; }
.ehf-ac li.ehf-ac-attr { cursor: default; padding: 3px 10px 5px; font-size: 11px; color: #6b6058; text-align: right; background: none; }

/* Category photo strip (categories/category_collage.py, 2026-11-15): the category image is a
   6:1 strip of whole product photos shown ABOVE the title instead of behind it (theme default).
   Hidden on phones so products stay near the top. */
.tax-product_cat .hero-section[data-type="type-2"] > figure {
  position: relative; inset: auto; aspect-ratio: 6 / 1; max-height: 320px; width: 100%;
}
.tax-product_cat .hero-section[data-type="type-2"] > figure .ct-media-container { display: block; }
.tax-product_cat .hero-section[data-type="type-2"] > figure .ct-media-container:after { display: none; }
.tax-product_cat .hero-section[data-type="type-2"] > figure img { width: 100%; height: 100%; object-fit: cover; }
.tax-product_cat .hero-section[data-type="type-2"]:has(> figure) > [class*=ct-container] { --container-padding: 32px 0 24px; --min-height: 0; }
@media (max-width: 689px) {
  .tax-product_cat .hero-section[data-type="type-2"] > figure { display: none; }
}

