/*
Theme Name: Ashworth
Theme URI: https://example.invalid/ashworth
Author: Ashworth
Description: Healthcare product catalogue. Products are published from WooCommerce.
Version: 3.0.0
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 8.0
Text Domain: ashworth
*/

:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --ink: #031833;
  --muted: #1a3d66;
  --line: #c5d4e6;
  --navy: #02142b;
  --accent: #06284d;
  --accent-dark: #02142b;
  --soft: #f3f6fb;
  --danger: #8d3030;
  --sans: "Manrope", "Segoe UI", sans-serif;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(20, 32, 43, 0.06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
}
img { max-width: 100%; height: auto; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 80; background: white; padding: 0.7rem 1rem; }
.skip-link:focus { top: 1rem; }
.sr-only, .hp {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.wrap { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
h1, h2, h3 { font-family: var(--sans); font-weight: 650; letter-spacing: -0.03em; line-height: 1.15; color: var(--ink); }
h1 { margin: 0; font-size: clamp(2rem, 4vw, 3rem); }
h2 { margin: 0; font-size: clamp(1.4rem, 2vw, 1.8rem); }
.kicker { margin: 0 0 0.4rem; font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.lede, .muted { color: var(--muted); }
.banner { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 0.9rem 1rem; }
.banner.error { border-color: #e7c4c4; background: #fdf6f6; color: var(--danger); }
.lbl { display: block; margin: 0.8rem 0 0.35rem; font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.field, .woocommerce form .form-row input.input-text, .woocommerce form .form-row textarea, .woocommerce form .form-row select, .variations select {
  width: 100%; min-height: 46px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 0.65rem 0.85rem; color: var(--ink);
}
.btn, .woocommerce a.button, .woocommerce button.button, .woocommerce input.button, .woocommerce a.button.alt, .woocommerce button.button.alt, .added_to_cart {
  display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 0.95rem; border-radius: 999px;
  border: 1px solid var(--navy); background: #fff; color: var(--navy); text-decoration: none; cursor: pointer; font-weight: 700;
  transition: background 160ms ease, color 160ms ease;
}
.btn:hover, .woocommerce a.button:hover, .woocommerce button.button:hover, .added_to_cart:hover { background: var(--soft); color: var(--navy); }

.site-header { position: sticky; top: 0; z-index: 40; background: #fff; border-bottom: 1px solid var(--line); }
.header-main { display: none; }
.logo { text-decoration: none; line-height: 1; }
.logo strong { display: block; font-size: 1.35rem; font-weight: 700; color: var(--navy); }
.logo span { display: block; margin-top: 0.2rem; font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.search-form { position: relative; }
.search-form .field { padding-right: 6.2rem; background: var(--bg); }
.search-form .btn { position: absolute; right: 4px; top: 4px; min-height: 38px; }
.header-tools { display: flex; align-items: center; gap: 0.8rem; }
.tool-link, .basket-link { text-decoration: none; color: var(--ink); font-weight: 600; }
.basket-link { display: inline-flex; align-items: center; gap: 0.4rem; }
.basket-count { min-width: 1.5rem; height: 1.5rem; display: inline-grid; place-items: center; border-radius: 999px; background: var(--accent); color: #fff; font-size: 0.75rem; }
.cat-bar { border-top: 1px solid var(--line); }
.cat-scroll { display: flex; gap: 0.35rem; overflow-x: auto; padding: 0.55rem 0; scrollbar-width: none; }
.cat-scroll::-webkit-scrollbar { display: none; }
.cat-scroll a { flex: 0 0 auto; text-decoration: none; color: var(--muted); font-size: 0.84rem; font-weight: 600; padding: 0.35rem 0.7rem; border-radius: 999px; transition: background 160ms ease, color 160ms ease; }
.cat-scroll a:hover { background: var(--soft); color: var(--navy); }
.nav-panel { display: none; border-top: 1px solid var(--line); background: var(--surface); }
.nav-panel.is-open { display: block; }
.nav-inner { padding: 0.8rem 0 1rem; }
.nav-list { list-style: none; margin: 0.8rem 0 0; padding: 0; }
.nav-list a { display: block; padding: 0.7rem 0; text-decoration: none; font-weight: 650; border-bottom: 1px solid var(--line); }
.menu-toggle { display: none; }
.nav-panel .search-form { display: none; }

.store-hero { position: relative; isolation: isolate; min-height: 72vh; overflow: hidden; color: var(--navy); }
.store-hero-media { position: absolute; inset: 0; }
.store-hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: right center; display: block; }
.store-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(245, 247, 248, 0.78) 0%, rgba(245, 247, 248, 0.42) 34%, rgba(245, 247, 248, 0) 58%);
  pointer-events: none;
}
.store-hero-copy { position: relative; z-index: 1; width: min(1180px, calc(100% - 48px)); max-width: none; margin-inline: auto; min-height: 72vh; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; padding: 6rem 0 3.2rem; }
.store-hero h1, .store-hero .lede, .store-hero .kicker { max-width: 26rem; }
.store-hero .lede { color: #3d4e5c; }
.store-hero .btn { margin-top: 1.2rem; }
.section { padding: 1.6rem 0; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1rem; }
.section-head a { color: var(--accent); font-weight: 700; text-decoration: none; }
.category-tiles { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 0; padding: 0; }
.category-tiles a { position: relative; display: flex; align-items: flex-end; min-height: 11.5rem; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius); padding: 1rem; text-decoration: none; color: #fff; background: var(--navy); transition: transform 160ms ease, box-shadow 160ms ease; }
.category-tiles a:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.tile-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile-shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(10, 22, 34, 0.62), rgba(10, 22, 34, 0.05) 46%); }
.tile-copy { position: relative; z-index: 1; min-width: 0; }
.tile-name { display: block; font-size: 1.15rem; font-weight: 700; line-height: 1.25; color: #fff; }
.tile-count { display: block; margin-top: 0.25rem; color: rgba(255, 255, 255, 0.82); font-size: 0.82rem; }
.tone-pain-relief { background: #1b6480; }
.tone-cold-and-flu { background: #3e6d62; }
.tone-allergy { background: #5d7084; }
.tone-digestive-health { background: #7a5b4c; }
.tone-non-prescription-medicines { background: #2c4d6e; }
.tone-vitamins { background: #3f735c; }
.tone-general-wellness { background: #5b717c; }
.tone-sleep-and-relaxation { background: #3d5080; }
.tone-personal-care { background: #746478; }
.tone-skin { background: #a06b58; }
.tone-first-aid { background: #8a4550; }
.tone-medical-equipment { background: #2e5870; }
.tone-healthcare-accessories { background: #5e7380; }
.tone-everyday-care { background: #3e6a62; }
.tone-childrens-health { background: #617898; }
.tone-anxiety-solutions { background: #3a5670; }

.product-grid, ul.products { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; list-style: none; margin: 0; padding: 0; }
ul.products::before, ul.products::after { display: none; }
ul.products li.product, .product-card { width: auto !important; margin: 0 !important; float: none !important; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.75rem; transition: transform 160ms ease, box-shadow 160ms ease; }
.product-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.card-media { position: relative; display: block; overflow: hidden; border-radius: 8px; background: var(--bg); aspect-ratio: 1; }
.card-media img, .card-media .pack-fallback { width: 100%; height: 100%; object-fit: contain; }
.pack-fallback { display: flex; flex-direction: column; justify-content: flex-end; gap: 0.35rem; padding: 0.9rem; color: #f7fbfd; }
.pack-fallback span { letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.68rem; }
.pack-fallback strong { font-size: 1.15rem; font-weight: 700; line-height: 1.2; }
.single-pack { min-height: 22rem; border-radius: var(--radius); width: 100%; }
.tone-forest { background: #1d4e63; } .tone-clay { background: #8d4b3a; } .tone-navy { background: #17324d; }
.tone-sand { background: #8d7348; } .tone-rose { background: #7d4b5a; } .tone-slate { background: #3e4c59; }
.availability { position: absolute; left: 0.55rem; top: 0.55rem; border-radius: 999px; padding: 0.2rem 0.55rem; font-size: 0.72rem; font-weight: 700; background: #e7f6ee; color: #17663c; }
.availability.low { background: #f8f1df; color: #8a5a12; }
.availability.out { background: #f8e8e8; color: var(--danger); }
.trend { margin: 0.7rem 0 0; color: var(--accent); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700; }
.card-title { margin: 0.25rem 0 0; font-size: 1rem; font-weight: 700; letter-spacing: 0; line-height: 1.35; min-height: 2.7em; }
.card-title a { text-decoration: none; }
.card-meta { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.86rem; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-top: auto; padding-top: 0.8rem; }
.price, .woocommerce ul.products li.product .price, .woocommerce div.product p.price { color: var(--navy); font-size: 1rem; font-weight: 700; margin: 0; }
.price-line { display: inline-flex; align-items: baseline; gap: 0.3rem; }
.currency { margin-left: 0.2rem; font-size: 0.68rem; letter-spacing: 0.08em; color: var(--muted); }
.card-foot .button, .card-foot .added_to_cart { min-height: 36px; padding: 0 0.7rem; font-size: 0.82rem; }

.shop-layout { display: grid; grid-template-columns: 230px 1fr; gap: 1.5rem; padding: 1.5rem 0 3rem; }
.shop-catalog { display: block; }
.filter-block h2 { margin: 0 0 0.6rem; font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.filter-block ul { list-style: none; margin: 0; padding: 0; }
.filter-block a { text-decoration: none; }
.filter-block .child { margin-left: 0.7rem; }
.shop-search { display: flex; gap: 0.5rem; margin-top: 1rem; }
.shop-copy h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); }
.woocommerce-ordering select, .woocommerce-pagination a, .woocommerce-pagination span { border-radius: 10px; }
.woocommerce-pagination ul { display: flex; gap: 0.35rem; list-style: none; padding: 0; }
.woocommerce-pagination a, .woocommerce-pagination span { display: inline-flex; min-width: 2.2rem; min-height: 2.2rem; align-items: center; justify-content: center; text-decoration: none; box-shadow: inset 0 0 0 1px var(--line); }

.product-detail { padding: 1.5rem 0 3rem; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; }
.gallery-main img { width: 100%; border-radius: var(--radius); background: var(--bg); }
.gallery-thumbs { display: flex; gap: 0.5rem; list-style: none; margin: 0.7rem 0 0; padding: 0; }
.gallery-thumbs button { width: 4.2rem; height: 4.2rem; padding: 0; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; overflow: hidden; }
.gallery-thumbs button[aria-current="true"] { border-color: var(--navy); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.crumb { color: var(--accent); text-decoration: none; font-size: 0.78rem; font-weight: 700; }
.product-summary h1 { font-size: clamp(1.8rem, 3vw, 2.5rem); }
.product-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin: 1rem 0; }
.product-facts div, .product-facts > dt { border-top: 1px solid var(--line); padding-top: 0.45rem; }
.product-facts dt { color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }
.product-facts dd { margin: 0.15rem 0 0; font-weight: 650; }
.variations { width: 100%; margin: 0 0 1rem; }
.variations td { display: block; padding: 0.35rem 0; }
.supply-note { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 0.9rem 1rem; }
.detail-copy { max-width: 46rem; }

.basket-page { padding: 1.5rem 0 3rem; }
.basket-layout, .checkout-grid { display: grid; grid-template-columns: 1.4fr 0.8fr; gap: 1.2rem; align-items: start; }
.basket-lines { list-style: none; margin: 0 0 1rem; padding: 0; }
.basket-lines li { display: grid; grid-template-columns: 84px 1fr auto; gap: 0.8rem; align-items: center; padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
.basket-lines img { width: 84px; height: 84px; object-fit: contain; background: var(--bg); border-radius: 8px; }
.basket-lines .pack-fallback { width: 84px; height: 84px; border-radius: 8px; padding: 0.45rem; }
.basket-lines .pack-fallback strong { font-size: 0.72rem; }
.basket-lines h2 { margin: 0; font-size: 1.05rem; }
.basket-lines h2 a { text-decoration: none; }
.line-actions { display: flex; align-items: center; gap: 0.8rem; margin-top: 0.45rem; }
.qty-stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.qty-stepper button, .qty-stepper input { width: 2.4rem; height: 2.4rem; border: 0; background: transparent; text-align: center; }
.qty-stepper input { -moz-appearance: textfield; }
.qty-stepper input::-webkit-outer-spin-button, .qty-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.summary-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 1rem; }
.summary-card .btn { width: 100%; margin-top: 0.8rem; }
.totals-list { display: grid; grid-template-columns: 1fr auto; gap: 0.45rem 1rem; margin: 0.6rem 0; }
.totals-list dt { color: var(--muted); }
.totals-list dd { margin: 0; text-align: right; font-weight: 700; }
.quote-form { margin-top: 0.8rem; }
.check { display: flex; gap: 0.55rem; align-items: flex-start; margin: 0.85rem 0; }
.check input { margin-top: 0.28rem; }
.contact-field[hidden] { display: none; }
.channel-choice { border: 0; margin: 0.4rem 0 0; padding: 0; }
.channel-choice label { display: flex; gap: 0.5rem; align-items: center; margin: 0.35rem 0; }
.summary-lines { list-style: none; margin: 0; padding: 0; }
.summary-lines li { display: flex; gap: 0.4rem; margin: 0.35rem 0; }
.summary-lines span { margin-left: auto; }

.site-footer { margin-top: 2rem; background: var(--soft); color: var(--navy); }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 1.5rem; padding: 2.2rem 0; }
.footer-grid h2 { margin: 0 0 0.7rem; color: var(--navy); font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid a { text-decoration: none; }
.footer-grid .muted, .footer-grid a { color: var(--muted); }
.footer-grid .logo strong { color: var(--navy); }
.legal-bar { border-top: 1px solid var(--line); font-size: 0.88rem; }
.legal-bar .wrap { display: flex; justify-content: space-between; gap: 1rem; padding: 0.9rem 0; }
.page-main { width: min(760px, calc(100% - 32px)); margin: 0 auto; padding: 2rem 0 3rem; }
.page-main .btn { max-width: 100%; }
.articles-main { padding: 2rem 0 3rem; }
.article-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin-top: 1.4rem; }
.article-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.article-card a { display: block; text-decoration: none; }
.article-photo, .article-hero { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.article-card h2 { margin: 0.9rem 1rem 0.35rem; font-size: 1.25rem; }
.article-card p { margin: 0 1rem 1.1rem; color: var(--muted); }
.article-hero { border-radius: 16px; margin: 1rem 0 1.2rem; }
.page-main h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.entry h2, .detail-copy h2 { margin: 1.6rem 0 0.45rem; }
.stack-form { max-width: 36rem; }

@media (max-width: 1100px) {
  .category-tiles, .product-grid, ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .menu-toggle { display: inline-flex; }
  .cat-bar { display: none; }
  .cat-bar.is-open { display: block; }
  .nav-panel.is-open .cat-scroll, .shop-layout, .detail-grid, .basket-layout, .checkout-grid, .footer-grid { display: block; }
  .store-hero, .store-hero-copy { min-height: 62vh; }
  .store-hero-media img { object-position: 78% center; }
  .store-hero::after { background: linear-gradient(180deg, rgba(245, 247, 248, 0.15) 0%, rgba(245, 247, 248, 0.78) 62%, rgba(245, 247, 248, 0.9) 100%); }
  .store-hero h1, .store-hero .lede, .store-hero .kicker { max-width: 100%; }
  .category-tiles, .product-grid, ul.products { grid-template-columns: 1fr 1fr; }
  .footer-grid > div { margin-bottom: 1.2rem; }
  .legal-bar .wrap { flex-direction: column; }
}
@media (max-width: 560px) {
  .category-tiles, .product-grid, ul.products, .product-facts, .article-grid { grid-template-columns: 1fr; }
  .page-main .btn { width: 100%; }
  .basket-lines { grid-template-columns: 72px 1fr; }
  .line-total { grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .product-card, .category-tiles a, .btn, .cat-scroll a { transition: none; }
}
