/* Layout fixes for the static copies of the old Astra + WooCommerce sites.
   Copied to /legacy-fixes.css of every site by postprocess.py and linked last in <head>,
   so it wins over the theme without editing the theme's (minified, cached) CSS. */

:root { --lf-accent: #b42244; --lf-line: #e8e8e8; --lf-tile: #f6f6f6; }

/* --- product gallery ----------------------------------------------------------------- */
/* no border here: it makes the viewport 2px narrower than the slides flexslider sizes from
   the gallery width, and the next slide peeks in on the right */
.woocommerce div.product div.images .flex-viewport,
.woocommerce div.product div.images > .woocommerce-product-gallery__wrapper {
  border-radius: 10px;
  overflow: hidden;
  background: var(--lf-tile);
}
.woocommerce div.product div.images .woocommerce-product-gallery__image img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: var(--lf-tile);   /* = the product photos' own backdrop, so no letterbox bands */
}
/* WooCommerce keeps the gallery at opacity 0 until window "load" — i.e. until the chat
   widget, analytics and every other image are in — which reads as a blank box for seconds.
   Show it at once; before flexslider has built its viewport, show only the first slide. */
.woocommerce div.product div.images.woocommerce-product-gallery { opacity: 1 !important; }
.woocommerce div.product div.images:not(:has(.flex-viewport)) .woocommerce-product-gallery__image:nth-child(n+2) { display: none; }

/* thumbnails: one even row of squares instead of 4 + 2 of mixed shapes */
.woocommerce div.product div.images .flex-control-thumbs {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 8px;
  margin: 10px 0 0 !important;
  padding: 0;
}
.woocommerce div.product div.images .flex-control-thumbs li {
  width: auto !important;
  float: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
.woocommerce div.product div.images .flex-control-thumbs img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: var(--lf-tile);
  border: 2px solid transparent;
  border-radius: 6px;
  opacity: .6;
  cursor: pointer;
  transition: opacity .15s, border-color .15s;
}
.woocommerce div.product div.images .flex-control-thumbs img:hover,
.woocommerce div.product div.images .flex-control-thumbs img.flex-active {
  opacity: 1;
  border-color: var(--lf-accent);
}

/* --- product cards (shop, categories, related, up-sells, home tabs) ------------------- */
.woocommerce ul.products li.product .astra-shop-thumbnail-wrap,
.woocommerce-page ul.products li.product .astra-shop-thumbnail-wrap {
  border-radius: 10px;
  overflow: hidden;
  background: var(--lf-tile);
}
.woocommerce ul.products li.product a img,
.woocommerce-page ul.products li.product a img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  margin: 0 !important;
  background: var(--lf-tile);
  transition: transform .25s ease;
}
.woocommerce ul.products li.product:hover a img { transform: scale(1.04); }
.woocommerce ul.products li.product .woocommerce-loop-product__title {
  min-height: 2.6em;
  line-height: 1.3;
}
/* "0 out of 5" stars on products nobody has rated: noise, not information */
.woocommerce .star-rating:has(> span[style*="width:0%"]),
.woocommerce .star-rating:has(> span[style*="width: 0%"]) { display: none; }

/* --- header: keep the main menu on one line on laptop widths ------------------------- */
@media (min-width: 922px) and (max-width: 1280px) {
  .main-header-menu > .menu-item > .menu-link { padding-left: .7em !important; padding-right: .7em !important; }
  .main-header-menu .menu-link { font-size: .8125rem; letter-spacing: 0; }
}

/* --- sidebar: the "Uncategorized" bucket is a WordPress default, not a category --------- */
.widget_product_categories li.cat-item:has(> a[href*="/uncategorized/"]),
.widget_categories li.cat-item:has(> a[href*="/uncategorized/"]) { display: none; }

/* --- contact form that replaces the dead CF7 shortcode -------------------------------- */
.lf-contact { display: grid; gap: 14px; max-width: 520px; }
.lf-contact label { display: grid; gap: 6px; font-weight: 600; font-size: .95rem; }
.lf-contact input, .lf-contact textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #d6d6d6; border-radius: 6px;
  font: inherit; font-weight: 400; background: #fff;
}
.lf-contact input:focus, .lf-contact textarea:focus { outline: 2px solid var(--lf-accent); outline-offset: 1px; }
.lf-contact button {
  justify-self: start; padding: 12px 28px; border: 0; border-radius: 6px;
  background: var(--lf-accent); color: #fff; font-weight: 700; cursor: pointer;
}
.lf-contact button:hover { filter: brightness(1.1); }

/* --- readability: body copy was 14px #7a7a7a (contrast 4.29, below WCAG AA 4.5) -------- */
body,
.entry-content,
.elementor-widget-text-editor,
.woocommerce-product-details__short-description,
.woocommerce-Tabs-panel { color: #474747; }
.entry-content p, .entry-content li,
.elementor-widget-text-editor p,
.woocommerce-product-details__short-description,
.woocommerce-Tabs-panel p, .woocommerce-Tabs-panel li { font-size: 16px; line-height: 1.65; }

/* --- registration hint above the buy button (was a shouting all-caps line) ------------- */
.lf-note {
  margin: 1em 0 1.2em;
  padding: 12px 14px 12px 42px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--lf-accent) 6%, #fff) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23b5193f'%3E%3Cpath d='M12 2a10 10 0 100 20 10 10 0 000-20zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z'/%3E%3C/svg%3E") no-repeat 13px 50% / 20px;
  color: #6b1027;
  font-size: 15px !important;
  line-height: 1.45;
}

/* --- phones: the buy button sits below the first screen, so keep one at hand ---------- */
.lf-buy { display: none; }
@media (max-width: 921px) {
  .lf-buy {
    display: block;
    position: fixed;
    left: 12px;
    right: 84px;                       /* the chat button lives in the bottom-right corner */
    bottom: 12px;
    z-index: 999;
    padding: 14px 16px;
    border-radius: 10px;
    background: var(--lf-accent);
    color: #fff !important;
    font-weight: 700;
    font-size: 15px;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
  }
  body:has(.lf-buy) { padding-bottom: 76px; }
  .ast-sticky-add-to-cart { display: none !important; }   /* the theme's own bar, top of screen */
  /* (the mobile top bar stays: the theme's header overlays the page and Elementor sections
     are offset by its full height, so hiding it leaves a blank band above the hero) */
}

/* --- tap targets on phones (breadcrumbs, category links were 12-15px tall) ------------- */
@media (max-width: 921px) {
  .woocommerce-breadcrumb a, .product_meta a, .posted_in a, .ast-terms-link a {
    display: inline-block;
    padding: 6px 0;
  }
}

/* --- 404 ------------------------------------------------------------------------------- */
.lf-404 { max-width: 640px; margin: 60px auto 80px; padding: 0 20px; text-align: center; }
.lf-404 h1 { font-size: 2.2rem; margin-bottom: .5em; }
.lf-404 p { font-size: 17px; color: #474747; }
.lf-404-links { display: flex; gap: 18px; justify-content: center; align-items: center; margin-top: 1.6em; }
.lf-404-btn {
  padding: 12px 28px; border-radius: 8px; background: var(--lf-accent);
  color: #fff !important; font-weight: 700; text-decoration: none;
}
.lf-hide { display: none !important; }

/* --- one heading scale (px: the theme's root size is smaller than 16px) in product descriptions and posts (the copy had links, <strong>
       and inline font sizes inside headings, so every heading looked different) -------- */
.woocommerce div.product .woocommerce-tabs .panel h2, .single-post .entry-content h2 { font-size: 26px; line-height: 1.3; margin: 1.6em 0 .6em; color: #2b2b2b; }
.woocommerce div.product .woocommerce-tabs .panel h3, .single-post .entry-content h3 { font-size: 21px; line-height: 1.35; margin: 1.4em 0 .5em; color: #2b2b2b; }
.woocommerce div.product .woocommerce-tabs .panel :is(h4, h5, h6),
.single-post .entry-content h4 { font-size: 18px; line-height: 1.4; margin: 1.2em 0 .4em; color: #2b2b2b; }
.woocommerce div.product .woocommerce-tabs .panel h2:first-child { margin-top: 0; }
@media (max-width: 544px) {
  .woocommerce div.product .woocommerce-tabs .panel h2, .single-post .entry-content h2 { font-size: 22px; }
  .woocommerce div.product .woocommerce-tabs .panel h3, .single-post .entry-content h3 { font-size: 19px; }
}
/* long words / tables in the copy must not push the page wider than the phone */
.woocommerce-Tabs-panel, .entry-content { overflow-wrap: anywhere; }
.woocommerce-Tabs-panel table, .entry-content table { display: block; max-width: 100%; overflow-x: auto; }

/* =====================================================================================
   Conversion blocks (convert.py)
   ===================================================================================== */
.lf-btn {
  display: inline-block; padding: 15px 26px; border-radius: 12px;
  background: var(--lf-accent); color: #fff !important; font-weight: 700; font-size: 16px;
  text-decoration: none !important; line-height: 1.2;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--lf-accent) 28%, transparent); transition: transform .15s, box-shadow .15s;
}
.lf-btn:hover { transform: translateY(-1px); box-shadow: 0 12px 26px color-mix(in srgb, var(--lf-accent) 34%, transparent); }
.lf-cta-note { margin: 10px 0 0 !important; font-size: 13.5px !important; color: #6b6b6b; line-height: 1.5; }
.lf-steps {
  margin: 18px 0 20px; padding: 16px 18px; border-radius: 14px;
  background: color-mix(in srgb, var(--lf-accent) 6%, #fff); border: 1px solid color-mix(in srgb, var(--lf-accent) 18%, #fff);
}
.lf-steps-title { margin: 0 0 8px !important; font-weight: 700; color: color-mix(in srgb, var(--lf-accent) 75%, #000); font-size: 15px !important; }
.lf-steps ol { margin: 0 0 0 0; padding: 0; list-style: none; counter-reset: lf; }
.lf-steps li {
  counter-increment: lf; position: relative; padding: 5px 0 5px 34px; font-size: 14.5px; line-height: 1.45; color: #3d3d3d;
}
.lf-steps li::before {
  content: counter(lf); position: absolute; left: 0; top: 4px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--lf-accent); color: #fff; font-size: 13px; font-weight: 700; text-align: center; line-height: 24px;
}
.lf-cta-inline { text-align: center; margin: 1.6em 0 !important; }
.lf-cta-block {
  margin: 2.4em 0 1em; padding: 28px 24px; border-radius: 18px; text-align: center;
  background: linear-gradient(135deg, #fff 0%, color-mix(in srgb, var(--lf-accent) 7%, #fff) 100%); border: 1px solid color-mix(in srgb, var(--lf-accent) 15%, #fff);
}
.lf-cta-block-title { font-size: 22px !important; font-weight: 800; color: #1f2430; margin: 0 0 6px !important; }
.lf-cta-block p { margin: 0 0 16px; }
.lf-faq { margin: 2.4em 0 0; }
.lf-faq details { border-bottom: 1px solid var(--lf-line); padding: 14px 0; }
.lf-faq summary { cursor: pointer; font-weight: 700; font-size: 16.5px; color: #1f2430; list-style: none; position: relative; padding-right: 28px; }
.lf-faq summary::-webkit-details-marker { display: none; }
.lf-faq summary::after { content: "+"; position: absolute; right: 4px; top: -2px; font-size: 22px; color: var(--lf-accent); }
.lf-faq details[open] summary::after { content: "–"; }
.lf-faq details p { margin: 10px 0 0; }
.lf-card-btn {
  display: inline-block; margin-top: 8px; font-size: 14px; font-weight: 700;
  color: var(--lf-accent) !important; text-decoration: none !important;
}
.lf-card-btn:hover { text-decoration: underline !important; }
.lf-exit { position: fixed; inset: 0; z-index: 100000; background: rgba(15, 18, 25, .55); display: flex; align-items: center; justify-content: center; padding: 20px; }
.lf-exit[hidden] { display: none; }
.lf-exit-box { position: relative; max-width: 460px; width: 100%; background: #fff; border-radius: 20px; padding: 34px 30px 26px; text-align: center; box-shadow: 0 30px 80px rgba(0,0,0,.3); }
.lf-exit-title { font-size: 24px; font-weight: 800; color: #1f2430; margin: 0 0 10px; line-height: 1.25; }
.lf-exit-box p { color: #474747; }
.lf-exit-x { position: absolute; top: 10px; right: 14px; border: 0; background: none; font-size: 28px; line-height: 1; color: #999; cursor: pointer; }
.lf-exit-later { display: block; margin: 14px auto 0; border: 0; background: none; color: #888; font-size: 14px; cursor: pointer; text-decoration: underline; }

/* =====================================================================================
   Modern look: system fonts, calmer header, rounded cards and buttons, dark footer.
   One stylesheet on top of the old theme, so it stays reversible.
   ===================================================================================== */
:root { --lf-ink: #1f2430; --lf-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
body, button, input, select, textarea,
.elementor-widget-text-editor, .elementor-heading-title, .elementor-button, .elementor-tab-title,
h1, h2, h3, h4, h5, h6, .entry-title, .product_title, .woocommerce-loop-product__title,
.main-header-menu .menu-link, .site-footer { font-family: var(--lf-font) !important; }
/* colour only where the theme had dark text anyway: Elementor headings sit on photos too */
.product_title, .entry-title, .woocommerce-products-header__title { color: var(--lf-ink); }
h1, h2, h3, .elementor-heading-title { letter-spacing: -0.01em; }
.woocommerce div.product .product_title { font-size: 34px; font-weight: 800; line-height: 1.15; }
@media (max-width: 544px) { .woocommerce div.product .product_title { font-size: 27px; } }

/* header: white, hairline, sentence-case menu, brand accent instead of mint */
.ast-primary-header-bar, .main-header-bar { border-bottom: 1px solid #eee !important; }
.ast-above-header-bar { border-bottom: 0 !important; background: color-mix(in srgb, var(--lf-accent) 5%, #fff) !important; }
.main-header-menu > .menu-item > .menu-link { text-transform: none !important; font-weight: 600 !important; font-size: 15px !important; color: var(--lf-ink) !important; letter-spacing: 0 !important; }
.main-header-menu .menu-link:hover, .main-header-menu .current-menu-item > .menu-link { color: var(--lf-accent) !important; }
.ast-mobile-menu-trigger-fill, .menu-toggle.main-header-menu-toggle { background: var(--lf-accent) !important; border-radius: 10px !important; }

/* buttons: one accent, rounded, no shouting */
.elementor-button, .woocommerce a.button, .woocommerce button.button, .woocommerce .single_add_to_cart_button,
.ast-button, .search-submit, .woocommerce-product-search button {
  border-radius: 12px !important; letter-spacing: 0 !important; text-transform: none !important; font-weight: 700 !important;
}
.woocommerce .single_add_to_cart_button { font-size: 17px !important; padding: 18px 28px !important; box-shadow: 0 10px 24px color-mix(in srgb, var(--lf-accent) 28%, transparent); }
.search-submit, .woocommerce-product-search button { background: var(--lf-accent) !important; }
.elementor-tab-title { letter-spacing: .02em !important; }

/* product cards */
.woocommerce ul.products li.product {
  background: #fff; border-radius: 16px; padding: 10px 10px 16px !important;
  transition: box-shadow .2s, transform .2s;
}
.woocommerce ul.products li.product:hover { box-shadow: 0 14px 34px rgba(31, 36, 48, .10); transform: translateY(-2px); }
.woocommerce ul.products li.product .woocommerce-loop-product__title { font-weight: 700 !important; font-size: 15.5px !important; color: var(--lf-ink); }
.woocommerce ul.products li.product .ast-woo-product-category { font-size: 12.5px; color: #8a8a8a; }

/* product page rhythm */
.woocommerce div.product .woocommerce-product-details__short-description { font-size: 16px; }
.woocommerce div.product .woocommerce-tabs ul.tabs { border-bottom: 1px solid var(--lf-line) !important; }
.woocommerce-breadcrumb { font-size: 13px !important; color: #8a8a8a !important; }

/* footer: dark, readable */
.site-footer, .site-above-footer-wrap, .site-primary-footer-wrap, .site-below-footer-wrap { background: #171b24 !important; color: #c9ccd3 !important; }
.site-footer .widget, .site-footer .footer-widget-area-inner, .site-footer li, .site-footer span { color: #c9ccd3 !important; }
.site-footer a, .site-footer .widget-title, .site-footer h2, .site-footer h3, .site-footer p { color: #e7e9ee !important; }
.site-footer a:hover { color: #fff !important; text-decoration: underline; }
.site-footer img { filter: brightness(0) invert(1); }   /* the only footer image is the dark logo */

/* --- focus: no dotted box after a mouse click, a clear ring for keyboard users ------------ */
a:focus:not(:focus-visible), button:focus:not(:focus-visible), input:focus:not(:focus-visible),
.elementor-tab-title:focus:not(:focus-visible), summary:focus:not(:focus-visible) { outline: none !important; }
a:focus-visible, button:focus-visible, summary:focus-visible, .elementor-tab-title:focus-visible {
  outline: 2px solid var(--lf-accent) !important; outline-offset: 3px; border-radius: 4px;
}

/* --- layout shift (CLS): chat widget fixed from the first frame; room for the gallery
       thumbnails before the slider has built them (multi-image galleries only) -------- */
#chat-widget-container { position: fixed !important; }
.woocommerce div.product div.images:has(.woocommerce-product-gallery__image:nth-child(2)):not(:has(.flex-control-thumbs)) {
  padding-bottom: 84px;
}
@media (max-width: 544px) {
  .woocommerce div.product div.images:has(.woocommerce-product-gallery__image:nth-child(2)):not(:has(.flex-control-thumbs)) { padding-bottom: 80px; }
}

/* --- exit popup with a picture ----------------------------------------------------------- */
.lf-exit-box { padding: 0 !important; overflow: hidden; }
.lf-exit-media { position: relative; aspect-ratio: 800 / 420; overflow: hidden; background: #2e8b57; }
.lf-exit-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lf-exit-badge {
  position: absolute; left: 18px; bottom: 16px; padding: 8px 14px; border-radius: 999px;
  background: var(--lf-accent); color: #fff; font-weight: 800; font-size: 22px; letter-spacing: -.01em;
  box-shadow: 0 8px 20px rgba(0,0,0,.25);
}
.lf-exit-body { padding: 24px 30px 24px; }
.lf-exit-x { color: #fff !important; text-shadow: 0 1px 6px rgba(0,0,0,.5); z-index: 2; }

/* --- customer quotes as cards ---------------------------------------------------------------- */
.lf-reviews { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 1.2em 0 1.8em; }
.lf-review {
  margin: 0; padding: 18px 18px 16px; border-radius: 14px; background: #fff;
  border: 1px solid var(--lf-line); box-shadow: 0 4px 14px rgba(31, 36, 48, .05); display: flex; flex-direction: column;
}
.lf-review blockquote { margin: 0 0 12px; padding: 0; border: 0; font-size: 15px; line-height: 1.55; color: #3d3d3d; font-style: normal; }
.lf-review blockquote::before { content: "“"; display: block; font-size: 38px; line-height: .8; color: var(--lf-accent); margin-bottom: 6px; font-family: Georgia, serif; }
.lf-review figcaption { margin-top: auto; font-weight: 700; font-size: 14px; color: var(--lf-ink); }
.lf-review figcaption::before { content: "★★★★★ "; color: #f2b01e; letter-spacing: 1px; }
/* the chat widget resizes itself while it boots: keep it invisible until it has settled,
   so it appears in place instead of moving (an appearing element is not a layout shift) */
html:not(.lf-widgets-ready) #chat-widget-container { visibility: hidden !important; }

/* --- accessibility (PageSpeed): grey labels had contrast 3.5:1, links in the copy were told
       apart by colour alone --------------------------------------------------------------- */
.woocommerce ul.products li.product .ast-woo-product-category, .woocommerce-breadcrumb, .woocommerce-breadcrumb a,
.lf-cta-note, .posted_in, .product_meta { color: #5f5f5f !important; }
.woocommerce-Tabs-panel p a, .woocommerce-Tabs-panel li a, .single-post .entry-content p a,
.woocommerce-product-details__short-description a { text-decoration: underline !important; text-underline-offset: 2px; }

/* --- publisher line and post author ---------------------------------------------------------- */
.lf-imprint { background: #10131a; color: #9aa0ab; font-size: 13px; padding: 14px 0; text-align: center; }
.lf-imprint .ast-container { display: block; }
.lf-imprint a { color: #d6d9df !important; }
.lf-author { display: flex; gap: 16px; align-items: flex-start; margin: 2.4em 0 1em; padding: 20px; border-radius: 16px; background: color-mix(in srgb, var(--lf-accent) 5%, #fff); border: 1px solid color-mix(in srgb, var(--lf-accent) 12%, #fff); }
.lf-author-avatar { flex: 0 0 56px; width: 56px; height: 56px; border-radius: 50%; background: var(--lf-accent); color: #fff; font-weight: 800; font-size: 20px; display: flex; align-items: center; justify-content: center; }
.lf-author-name { margin: 0 0 4px !important; font-weight: 800; color: var(--lf-ink); }
.lf-author-bio { margin: 0 !important; font-size: 15px !important; color: #474747; }
.lf-byline { font-weight: 600; }

/* WordPress [gallery] blocks ignored the phone width (16px horizontal scroll) */
.gallery { max-width: 100%; overflow: hidden; }
.gallery .gallery-item { max-width: 100%; box-sizing: border-box; }
.gallery img { max-width: 100%; height: auto; }
.lf-sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* the few block styles the copies need once block-library.css is dropped */
.wp-block-image { margin: 0 0 1em; }
.wp-block-image img { max-width: 100%; height: auto; vertical-align: bottom; }
.wp-block-image .aligncenter, .wp-block-image.aligncenter { display: table; margin-left: auto; margin-right: auto; }
.wp-block-image figcaption { font-size: 13px; color: #5f5f5f; text-align: center; margin: .5em 0 0; }
