/* Page styles. Brand tokens (colours, font, radii) live in brand.css, loaded first. */
:root {
  --ink: var(--ds-text);
  --muted: var(--ds-muted);
  --line: var(--ds-line);
  --bg: var(--ds-surface);
  --card: var(--ds-white);
  --brand: var(--ds-navy);
  --brand-ink: var(--ds-white);
  --cta: var(--ds-red-text);
  --focus: var(--ds-red);
  --error: #b42318;
  --error-bg: #fdecea;
  --info-bg: var(--ds-navy-tint);
  --radius: var(--ds-radius-card);
  font-family: var(--ds-font);
  font-size: 100%;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6rem; color: var(--ds-text); }
h1 { font-size: 2.1rem; font-weight: var(--ds-fw-regular); letter-spacing: -.02em; }
h2 { font-size: 1.3rem; font-weight: var(--ds-fw-bold); }
h3 { font-size: 1.05rem; font-weight: var(--ds-fw-bold); }
p { margin: 0 0 .6rem; }
a { color: inherit; text-underline-offset: .15em; }
a:hover { color: var(--cta); }
[hidden] { display: none !important; }

.wrap { max-width: 760px; margin: 0 auto; padding: 0 1rem; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--card); color: var(--ink); padding: .5rem 1rem; z-index: 40; }
.skip-link:focus { left: 1rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Site header (static copy of www.direct-sails.com) ---------- */
.site-header { position: relative; z-index: 30; background: var(--ds-navy); color: var(--ds-white); }
.site-header__inner { max-width: 1340px; margin: 0 auto; height: var(--ds-header-h); padding: 0 1.25rem; display: flex; align-items: center; gap: 1rem; }
.logo { display: block; flex: none; line-height: 0; }
.logo img { display: block; height: 48px; width: auto; }
.site-nav { margin-left: auto; }
.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav a, .site-nav .nav-label { display: block; color: var(--ds-white); text-decoration: none; text-transform: uppercase; font-size: var(--ds-fs-nav); font-weight: var(--ds-fw-bold); line-height: 1.4; }
.site-nav a:hover { color: var(--ds-peach); }
.hdr-cta { flex: none; }
.menu-toggle { display: none; }

/* Mobile: CTA + hamburger; nav opens as a grey panel under the header (site behaviour). */
@media (max-width: 999.98px) {
  .site-header__inner { padding: 0 .9rem 0 1.25rem; }
  .hdr-cta { margin-left: auto; min-height: 44px; padding: .5rem 1.1rem; font-size: .75rem; }
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 48px; height: 48px; padding: 0; border: 0; background: transparent; color: var(--ds-white); cursor: pointer; }
  .menu-toggle__bars, .menu-toggle__bars::before, .menu-toggle__bars::after { display: block; width: 30px; height: 2px; background: currentColor; content: ""; position: relative; transition: transform .2s; }
  .menu-toggle__bars::before { position: absolute; top: -9px; }
  .menu-toggle__bars::after { position: absolute; top: 9px; }
  .menu-toggle[aria-expanded="true"] .menu-toggle__bars { background: transparent; }
  .menu-toggle[aria-expanded="true"] .menu-toggle__bars::before { transform: translateY(9px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] .menu-toggle__bars::after { transform: translateY(-9px) rotate(-45deg); }
  .site-nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--ds-grey-text); padding: 1.2rem 2.25rem 1.6rem; box-shadow: 0 8px 20px rgba(0, 0, 0, .2); }
  .site-nav a, .site-nav .nav-label { padding: .55rem 0; }
  .site-nav .sub { padding-left: 1rem; }
  /* Without JS the nav stays visible (in the header flow) so the links still work. */
  .site-header:not(.js-menu) .site-nav { position: static; margin: 0; box-shadow: none; }
  .site-header:not(.js-menu) .site-header__inner { height: auto; min-height: var(--ds-header-h); flex-wrap: wrap; padding-block: .8rem; }
  .site-header.js-menu:not(.is-open) .site-nav { display: none; }
}

/* Desktop: inline nav, "Our sails" opens its sub-menu on hover or keyboard focus. */
@media (min-width: 1000px) {
  :root { --ds-header-h: 111px; }
  .site-header__inner { padding: 0 3.125rem; gap: 2rem; }
  .logo img { height: 77px; }
  .site-nav > ul { display: flex; align-items: center; gap: .5rem 2.9rem; }
  .site-nav .has-sub { position: relative; }
  .site-nav .sub { position: absolute; top: calc(100% + .6rem); left: -1rem; min-width: 12rem; padding: .6rem 1rem; background: var(--ds-navy); border-radius: 0 0 var(--ds-radius-card) var(--ds-radius-card);
    opacity: 0; visibility: hidden; transition: opacity .15s, visibility .15s; }
  .site-nav .sub a { padding: .45rem 0; }
  .site-nav .has-sub::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: .7rem; } /* hover bridge */
  .site-nav .has-sub:hover .sub, .site-nav .has-sub:focus-within .sub { opacity: 1; visibility: visible; }
  .hdr-cta { margin-left: .4rem; }
}

/* ---------- Site footer (static copy of www.direct-sails.com) ---------- */
.site-footer { background: var(--ds-white); color: var(--ds-text); margin-top: 2.5rem; }
.footer-main { background: var(--ds-grey-text); color: var(--ds-white); }
.footer-main__inner { max-width: 1340px; margin: 0 auto; padding: 3rem 1.6rem 3.4rem; display: grid; gap: 2.2rem; }
.footer-main h2 { color: var(--ds-white); font-size: var(--ds-fs-nav); font-weight: var(--ds-fw-bold); letter-spacing: .05em; text-transform: uppercase; margin: 0 0 1rem; }
.footer-main p, .footer-main address { font-size: .8125rem; line-height: 1.5; font-style: normal; margin: 0 0 .9rem; }
.footer-main a { color: var(--ds-white); }
.footer-main a:hover { color: var(--ds-peach); }
.footer-logo { display: inline-block; line-height: 0; margin-bottom: 1.6rem; }
.footer-logo img { height: 92px; width: auto; }
.footer-nav ul { list-style: none; margin: 0; padding: 0; }
.footer-nav a, .footer-nav .nav-label { display: block; text-decoration: none; text-transform: uppercase; font-size: .8125rem; font-weight: var(--ds-fw-bold); padding: .2rem 0; }
.footer-nav .sub { padding-left: .9rem; }
.footer-main .footer-quote p { font-size: 1rem; letter-spacing: .04em; margin-bottom: 1rem; }
.footer-quote .btn { min-height: var(--ds-btn-h); min-width: 14rem; }
.footer-bottom { max-width: 1340px; margin: 0 auto; padding: 1.8rem 1.6rem 5rem; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .8rem 2rem; font-size: .875rem; font-weight: var(--ds-fw-bold); }
.footer-bottom p { margin: 0; }
.footer-bottom a { color: var(--ds-text); }
@media (min-width: 760px) {
  .footer-main__inner { grid-template-columns: repeat(2, 1fr); }
  .footer-bottom { padding-bottom: 2.4rem; }
}
@media (min-width: 1000px) {
  .footer-main__inner { grid-template-columns: repeat(4, 1fr); padding: 3.75rem 3.125rem 4.5rem; }
  .footer-main p, .footer-main address { font-size: .75rem; }
  .footer-bottom { padding-inline: 3.125rem; }
}

/* ---------- Order page ---------- */
.intro { padding: 2rem 0 .4rem; }
.intro > p { font-size: 1.0625rem; line-height: 1.7; }
.products { display: grid; gap: .8rem; margin: 1.2rem 0; }
.product { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.swatch-list { list-style: none; padding: 0; margin: .4rem 0 .6rem; display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .9rem; }
.swatch-list li { display: flex; align-items: center; gap: .35rem; }
.price-table { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem 1rem; }
.price-table summary { cursor: pointer; font-weight: var(--ds-fw-bold); text-transform: uppercase; font-size: var(--ds-fs-nav); }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; margin: .6rem 0; font-size: .92rem; }
th, td { text-align: left; padding: .5rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: var(--ds-fw-bold); }
.num { text-align: right; white-space: nowrap; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; margin: 1.2rem 0; }

.choice-group { border: 0; padding: 0; margin: 0 0 1.1rem; min-width: 0; }
.choice-group legend { font-weight: var(--ds-fw-bold); margin-bottom: .45rem; padding: 0; }
.legend-value { font-weight: var(--ds-fw-regular); color: var(--muted); }
.choices { display: grid; gap: .5rem; }
.choices--compact { grid-template-columns: repeat(4, 1fr); }
.choices--swatches { grid-template-columns: repeat(2, 1fr); }
.choice { position: relative; display: flex; align-items: center; gap: .5rem; border: 1px solid var(--ds-field-border); border-radius: var(--ds-radius-field); padding: .65rem .75rem; cursor: pointer; min-height: 44px; background: var(--card); }
.choice:hover { border-color: var(--brand); }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: var(--info-bg); color: var(--brand); font-weight: var(--ds-fw-bold); }
.choice:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.choices--compact .choice { justify-content: center; }
.choice-text { font-size: .9rem; }

.swatch { display: inline-block; width: 1.4rem; height: 1.4rem; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .25); flex: none; }
/* DS: colour swatches. CSS placeholders; replace with swatch photos when supplied. */
.sw-red { background: #c62828; }
.sw-green { background: #2e7d32; }
.sw-blue { background: #1565c0; }
.sw-black { background: #1b1b1b; }
.sw-grey { background: #8a8f94; }
.sw-white-red-fleck { background: radial-gradient(circle at 30% 35%, #c62828 0 12%, transparent 13%), radial-gradient(circle at 68% 62%, #c62828 0 10%, transparent 11%), #f7f7f7; }
.sw-white-green-fleck { background: radial-gradient(circle at 30% 35%, #2e7d32 0 12%, transparent 13%), radial-gradient(circle at 68% 62%, #2e7d32 0 10%, transparent 11%), #f7f7f7; }
.sw-red-melange { background: repeating-linear-gradient(45deg, #c62828 0 3px, #e57373 3px 5px); }
.sw-green-melange { background: repeating-linear-gradient(45deg, #2e7d32 0 3px, #81c784 3px 5px); }
.sw-blue-melange { background: repeating-linear-gradient(45deg, #1565c0 0 3px, #64b5f6 3px 5px); }
.sw-black-melange { background: repeating-linear-gradient(45deg, #1b1b1b 0 3px, #616161 3px 5px); }
.sw-grey-melange { background: repeating-linear-gradient(45deg, #757575 0 3px, #bdbdbd 3px 5px); }
.sw-yellow-melange { background: repeating-linear-gradient(45deg, #f9a825 0 3px, #fff176 3px 5px); }

.row { display: grid; gap: 0 1rem; }
.field { margin: 0 0 .95rem; min-width: 0; }
.field label { display: block; font-weight: var(--ds-fw-bold); margin-bottom: .3rem; }
.optional { font-weight: var(--ds-fw-regular); color: var(--muted); }
input, select { font: inherit; width: 100%; min-height: 46px; padding: .55rem .75rem; border: 1px solid var(--ds-field-border); border-radius: var(--ds-radius-field); background: #fff; color: var(--ink); }
input:hover, select:hover { border-color: var(--brand); }
input:focus-visible, select:focus-visible, button:focus-visible, summary:focus-visible, a:focus-visible, [tabindex="-1"]:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.site-header a:focus-visible, .site-header button:focus-visible, .footer-main a:focus-visible { outline-color: var(--ds-peach); }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--error); box-shadow: inset 0 0 0 1px var(--error); }
.field-error { color: var(--error); font-size: .9rem; margin: .3rem 0 0; }
.hint { color: var(--muted); font-size: .9rem; }

.line-price { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); padding-top: .85rem; margin-top: .2rem; font-weight: var(--ds-fw-bold); }
.line-price output { font-size: 1.5rem; color: var(--brand); }

/* Buttons: pill, bold uppercase 14px, as on the site. Primary = brand red (darkened for contrast), secondary = navy outline. */
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .7rem; }
.btn { font: inherit; font-size: var(--ds-fs-btn); font-weight: var(--ds-fw-bold); text-transform: uppercase; line-height: 1.2; display: inline-flex; align-items: center; justify-content: center; gap: .7rem;
  min-height: 46px; padding: .6rem 1.4rem; border-radius: var(--ds-radius-pill); border: 1px solid var(--brand); background: #fff; color: var(--brand); cursor: pointer; text-decoration: none; transition: background-color .15s, color .15s; }
.btn:hover { background: var(--brand); color: var(--brand-ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:disabled:hover { background: #fff; color: var(--brand); }
.btn--primary { background: var(--cta); border-color: var(--cta); color: #fff; }
.btn--primary:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn--primary:disabled:hover { background: var(--cta); border-color: var(--cta); color: #fff; }
.btn--arrow::after { content: ""; width: 1.1em; height: 1.1em; flex: none; background: currentColor; -webkit-mask: url("assets/arrow-down-right.svg") center / contain no-repeat; mask: url("assets/arrow-down-right.svg") center / contain no-repeat; }
.btn--wide { width: 100%; min-height: var(--ds-btn-h); }
.btn--small { min-height: 40px; padding: .35rem .9rem; font-size: .8125rem; }
.btn--danger { border-color: var(--error); background: var(--error); color: #fff; }
.btn--danger:hover { background: #8f1c13; border-color: #8f1c13; }

.lines { list-style: none; margin: 0; padding: 0; }
.line { display: grid; grid-template-columns: 1fr auto; gap: .2rem .8rem; padding: .85rem 0; border-bottom: 1px solid var(--line); }
.line--editing { background: var(--info-bg); margin: 0 -1.1rem; padding: .85rem 1.1rem; }
.line--error { background: var(--error-bg); margin: 0 -1.1rem; padding: .85rem 1.1rem; }
.line-main p { margin: 0 0 .15rem; }
.line-title { font-weight: var(--ds-fw-bold); }
.line-no { color: var(--muted); }
.line-detail, .line-qty { color: var(--muted); font-size: .9rem; }
.line-amount { margin: 0; font-weight: var(--ds-fw-bold); white-space: nowrap; }
.line-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .3rem; }
.badge { display: inline-block; margin-left: .4rem; font-size: .75rem; font-weight: var(--ds-fw-bold); background: var(--brand); color: #fff; padding: .1rem .55rem; border-radius: var(--ds-radius-pill); vertical-align: middle; }
.total { display: flex; justify-content: space-between; align-items: baseline; padding-top: .85rem; gap: 1rem; font-weight: var(--ds-fw-bold); }
.total strong { font-size: 1.5rem; color: var(--brand); }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.bot-check { margin: .4rem 0; }
.notice { border-radius: var(--ds-radius-field); padding: .75rem .95rem; margin: .6rem 0; }
.notice p { margin: 0 0 .4rem; }
.notice p:last-child { margin: 0; }
.notice--error { background: var(--error-bg); color: var(--error); }
.notice--info { background: var(--info-bg); color: var(--ink); }

.confirmation { margin-top: 2rem; }
.order-no-label { color: var(--muted); margin: 0; }
.order-no { font-size: 2.2rem; font-weight: var(--ds-fw-bold); letter-spacing: .03em; margin: 0 0 .8rem; color: var(--brand); }
.conf-table .line-detail { font-size: .85rem; }
.conf-table tfoot th, .conf-table tfoot td { font-weight: var(--ds-fw-bold); border-bottom: 0; }

.toast { position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); display: flex; align-items: center; gap: .8rem; background: var(--ds-navy); color: #fff; padding: .6rem .7rem .6rem 1.1rem; border-radius: var(--ds-radius-pill); box-shadow: 0 6px 20px rgba(0, 0, 0, .25); z-index: 20; max-width: calc(100% - 2rem); }
.toast .btn { background: #fff; color: var(--ds-navy); border-color: #fff; }

@media (min-width: 640px) {
  h1 { font-size: 2.75rem; }
  .products { grid-template-columns: 1fr 1fr; }
  .row { grid-template-columns: 1fr 1fr; }
  .choices { grid-template-columns: 1fr 1fr; }
  .choices--swatches { grid-template-columns: repeat(3, 1fr); }
  .card { padding: 1.4rem; }
  .line--editing, .line--error { margin: 0 -1.4rem; padding: .85rem 1.4rem; }
  .line { grid-template-columns: 1fr auto auto; align-items: start; }
  .line-actions { grid-column: auto; margin-top: 0; }
  .btn--wide { width: auto; min-width: 16rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { scroll-behavior: auto !important; transition: none !important; }
}
