/* =========================================================
   Old Tupton Ware — Template 2026
   Scoped to the header, nav, footer and shared UI bits only.
   Load this AFTER your existing stylesheets. It deliberately
   uses new class names (no .topnewbanner / .smallboxnew / etc.)
   so it can't be fought over by the legacy rules that your
   catalogue & product pages still depend on.
   ========================================================= */

:root{
  --ink:        #1f231f;
  --ink-soft:   #5b6058;
  --bg:         #ffffff;
  --bg-soft:    #f6f5f1;
  --line:       #e6e3da;
  --accent:     #2f6f62;   /* glaze teal — links, icons, focus  */
  --accent-deep:#234f45;   /* hover / active                    */
  --accent-tint:#eaf3f0;   /* light fill for badges / hovers    */
  --warm:       #c1622e;   /* used once, on the primary CTA     */
  --warm-deep:  #a44f23;
  --pill:       #c9dfd8;   /* nav pill, matches existing site sage */
  --pill-deep:  #a9c5bc;   /* nav pill hover / current            */
  --radius:     10px;
  --container:  1180px;
  --font-head:  "Rubik", "Helvetica Neue", Arial, sans-serif;
  --font-body:  "Roboto", "Helvetica Neue", Arial, sans-serif;
  --shadow:     0 8px 24px rgba(31,35,31,0.08);
  --header-h:   122px;
  --control-h:  40px;
}

/* ---------- base ---------- */
.site-header, .site-footer, .site-header *, .site-footer *{
  box-sizing:border-box;
}
.site-header, .site-footer{
  font-family: var(--font-body);
  color: var(--ink);
}
.site-header a, .site-footer a{
  color: inherit;
  text-decoration:none;
  font-weight:400;
}
.skip-link{
  position:absolute;
  left:-9999px;
  top:0;
  background:var(--ink);
  color:#fff;
  padding:10px 16px;
  border-radius:0 0 8px 0;
  z-index:999;
}
.skip-link:focus{ left:0; }

:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.icon{
  width:18px;
  height:18px;
  stroke:currentColor;
  fill:none;
  stroke-width:1.7;
  stroke-linecap:round;
  stroke-linejoin:round;
  vertical-align:-3px;
  flex-shrink:0;
}

/* ---------- header ---------- */
.site-header{
  position:fixed;
  top:0; left:0; right:0;
  z-index:100;
  background:rgba(255,255,255,0.72);
  -webkit-backdrop-filter:blur(8px);
  backdrop-filter:blur(8px);
  border-bottom:1px solid var(--line);
  transition: box-shadow .25s ease, background-color .25s ease;
}
.site-header.is-scrolled{
  box-shadow: var(--shadow);
  background:rgba(255,255,255,0.9);
}
.site-header__inner{
  max-width:var(--container);
  margin:0 auto;
  padding:0 24px;
}
.header-row{
  display:flex;
  align-items:center;
  gap:20px;
}
.header-row--top{
  padding-top:14px;
  padding-bottom:10px;
}
.header-row--bottom{
  padding-bottom:14px;
  justify-content:flex-end;
}

.brand{
  display:flex;
  flex-direction:column;
  line-height:1.15;
  margin-right:auto;
  white-space:nowrap;
}
.brand__name{
  font-family:var(--font-head);
  font-weight:600;
  font-size:20px;
  letter-spacing:0.06em;
  color:var(--ink);
}
.brand__tag{
  font-size:11px;
  letter-spacing:0.08em;
  color:var(--ink-soft);
  text-transform:uppercase;
  margin-top:2px;
}

.nav{
  display:flex;
  align-items:center;
  gap:10px;
  flex:1;
}
.nav__link{
  flex:1 1 auto;
  display:flex;
  align-items:center;
  justify-content:center;
  height:var(--control-h);
  padding:0 22px;
  font-size:14.5px;
  font-weight:500;
  color:var(--ink-soft);
  border-radius:999px;
  background:var(--bg-soft);
  border:1px solid var(--line);
  white-space:nowrap;
  transition:background-color .18s ease, border-color .18s ease, color .18s ease;
}
.nav__link:hover, .nav__link:focus-visible{
  background:var(--pill);
  border-color:var(--pill-deep);
  color:var(--ink);
}
.nav__link.is-current{
  background:var(--pill);
  border-color:var(--pill-deep);
  color:var(--ink);
  font-weight:600;
}

.utility{
  display:flex;
  align-items:center;
  gap:6px;
}
.utility__btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:var(--control-h);
  height:var(--control-h);
  border-radius:50%;
  color:var(--ink-soft);
  position:relative;
}
.utility__btn:hover, .utility__btn:focus-visible{
  background:var(--accent-tint);
  color:var(--accent-deep);
}
.utility__btn--label{
  width:auto;
  height:var(--control-h);
  border-radius:999px;
  padding:0 18px 0 22px;
  gap:7px;
  font-size:14.5px;
  font-weight:500;
}
.utility__count{
  position:absolute;
  top:1px; right:1px;
  min-width:16px; height:16px;
  border-radius:8px;
  background:var(--warm);
  color:#fff;
  font-size:10px;
  font-weight:700;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0 3px;
}

/* search */
.search{ position:relative; }
.search__form{
  display:flex;
  align-items:center;
  background:var(--bg-soft);
  border:1px solid var(--line);
  border-radius:999px;
  height:var(--control-h);
  padding:0 5px 0 16px;
  overflow:hidden;
  transition:border-color .2s ease;
}
.search__form:focus-within{
  border-color:var(--accent);
}
.search__input{
  -webkit-appearance:none;
  appearance:none;
  border:0;
  background:transparent;
  font-family:var(--font-body);
  font-size:14px;
  width:128px;
  flex:none;
  height:100%;
  padding:0 4px;
  color:var(--ink);
  border-radius:0;
  box-shadow:none;
  transition:width .2s ease;
}
.search__form:focus-within .search__input{
  width:170px;
}
.search__input:focus{ outline:none; }
.search__submit{
  -webkit-appearance:none;
  appearance:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:32px; height:32px;
  border-radius:50%;
  border:0;
  background:var(--accent);
  color:#fff;
  cursor:pointer;
  transition:background .15s ease;
  flex-shrink:0;
}
.search__submit:hover{ background:var(--accent-deep); }
.search__submit .icon{ width:15px; height:15px; stroke:#fff; }

/* mobile nav, JS-controlled via .is-open (see script in header) */
.nav-mobile{ display:none; position:relative; }
.nav-mobile__summary{
  display:flex;
  align-items:center;
  justify-content:center;
  width:40px; height:40px;
  border-radius:50%;
  cursor:pointer;
  color:var(--ink);
  background:transparent;
  border:0;
  padding:0;
}
.nav-mobile__summary:hover{ background:var(--accent-tint); }
.nav-mobile .icon-close{ display:none; }
.nav-mobile.is-open .icon-menu{ display:none; }
.nav-mobile.is-open .icon-close{ display:inline; }

.nav-mobile__panel{
  display:none;
  position:fixed;
  top:var(--header-h);
  left:0; right:0; bottom:0;
  background:var(--bg);
  overflow-y:auto;
  padding:8px 22px 32px;
  border-top:1px solid var(--line);
}
.nav-mobile__panel.is-open{ display:block; }
.nav-mobile__panel .nav__link{
  width:100%;
  font-size:17px;
  padding:14px 8px;
  background:transparent;
  border:0;
  border-radius:0;
  border-bottom:1px solid var(--line);
}
.nav-mobile__search{ margin:18px 8px 0; }
.nav-mobile__search .search__form{ width:100%; }
.nav-mobile__search .search__input{ flex:1; width:auto; }

/* ---------- body offset so fixed header doesn't cover content ---------- */
.page-offset{ height:var(--header-h); }

/* ---------- buttons ---------- */
.btn, a.btn, button.btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-family:var(--font-head);
  font-weight:600;
  font-size:14px;
  letter-spacing:0.01em;
  padding:12px 22px;
  border-radius:999px;
  border:1px solid transparent;
  text-decoration:none;
  cursor:pointer;
  transition:transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover, a.btn:hover{ transform:translateY(-1px); }
.btn--primary, a.btn--primary{ background:var(--accent); color:#fff; }
.btn--primary:hover, a.btn--primary:hover{ background:var(--accent-deep); color:#fff; }
.btn--warm, a.btn--warm{ background:var(--warm); color:#fff; }
.btn--warm:hover, a.btn--warm:hover{ background:var(--warm-deep); color:#fff; }
.btn--ghost, a.btn--ghost{ background:transparent; color:var(--ink); border-color:var(--line); }
.btn--ghost:hover, a.btn--ghost:hover{ border-color:var(--accent); color:var(--accent-deep); }

/* ---------- order history (previously ordered items) ---------- */
.order-history{
  margin:18px 0 30px;
}
.order-history h3{
  font-family:var(--font-head);
  font-weight:600;
  font-size:18px;
  color:var(--ink);
  margin:0 0 16px;
}
.order-history__grid{
  display:flex;
  flex-wrap:wrap;
  gap:16px;
}
.previousorder{
  width:138px;
}
.previousorder__link, a.previousorder__link{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
  text-decoration:none;
  color:var(--ink);
  background:#fff;
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:14px 10px 12px;
  transition:box-shadow .2s ease, border-color .2s ease, transform .2s ease;
}
.previousorder__link:hover, a.previousorder__link:hover{
  border-color:var(--accent);
  box-shadow:var(--shadow);
  transform:translateY(-2px);
  color:var(--ink);
}
.previousorder__thumb{
  display:flex;
  align-items:center;
  justify-content:center;
  height:108px;
  width:100%;
}
.previousorder__thumb img{
  max-width:100%;
  max-height:100%;
  object-fit:contain;
}
.previousorder__code{
  font-family:var(--font-head);
  font-size:12.5px;
  font-weight:600;
  letter-spacing:0.03em;
  color:var(--ink-soft);
  background:var(--bg-soft);
  border-radius:999px;
  padding:4px 11px;
}

/* ---------- 404 / error page ---------- */
.error-page{
  max-width:520px;
  margin:36px auto 56px;
  text-align:center;
}
.error-page__art{ margin-bottom:6px; }
.error-page__code{
  font-family:var(--font-head);
  font-weight:700;
  font-size:60px;
  line-height:1;
  color:var(--accent);
  margin:4px 0 6px;
}
.error-page__title{
  font-family:var(--font-head);
  font-weight:600;
  font-size:21px;
  color:var(--ink);
  margin:0 0 12px;
}
.error-page__text{
  color:var(--ink-soft);
  font-size:15px;
  line-height:1.65;
  margin:0 0 28px;
}
.error-page__search{
  display:flex;
  justify-content:center;
  margin-bottom:28px;
}
.error-page__search .search__form{ width:auto; }
.error-page__search .search__input{ width:190px; }
.error-page__search .search__form:focus-within .search__input{ width:230px; }
.error-page__actions{
  display:flex;
  gap:14px;
  justify-content:center;
  flex-wrap:wrap;
  margin-bottom:32px;
}
.error-page__links{
  display:flex;
  gap:10px;
  justify-content:center;
  flex-wrap:wrap;
  font-size:13.5px;
}
.error-page__links a{ color:var(--ink-soft); }
.error-page__links a:hover{ color:var(--accent-deep); text-decoration:underline; }
.error-page__links span{ color:var(--line); }

/* ---------- print button (content pages) ---------- */
.print-btn{
  -webkit-appearance:none;
  appearance:none;
  display:inline-flex;
  align-items:center;
  gap:8px;
  height:var(--control-h);
  padding:0 18px;
  border-radius:999px;
  background:var(--bg-soft);
  border:1px solid var(--line);
  color:var(--ink-soft);
  font-family:var(--font-body);
  font-size:14px;
  font-weight:500;
  cursor:pointer;
  box-shadow:none;
  transition:background-color .18s ease, border-color .18s ease, color .18s ease;
}
.print-btn:hover, .print-btn:focus-visible{
  background:var(--accent-tint);
  border-color:var(--accent);
  color:var(--accent-deep);
}
.print-btn .icon{ width:17px; height:17px; }

/* ---------- back to top ---------- */
.to-top{
  position:fixed;
  right:22px; bottom:22px;
  z-index:90;
  width:44px; height:44px;
  border-radius:50%;
  background:var(--ink);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  opacity:0;
  visibility:hidden;
  transform:translateY(8px);
  transition:opacity .2s ease, transform .2s ease, visibility .2s;
  border:0;
  cursor:pointer;
}
.to-top.is-visible{ opacity:1; visibility:visible; transform:translateY(0); }
.to-top:hover{ background:var(--accent-deep); }

/* ---------- footer ---------- */
.site-footer{
  background:#f3f3fe url(https://old-tupton-ware.co.uk/gifs/footer2023.png) no-repeat;
  background-position:bottom right;
  border-top:1px solid var(--line);
  margin-top:48px;
  padding-bottom:105px; /* shifts the bottom-anchored graphic down 105px total */
}
.site-footer__inner{
  max-width:var(--container);
  margin:0 auto;
  padding:52px 24px 28px;
  text-align:left; /* overrides the centered text-align inherited from BODY */
}
.footer-grid{
  display:grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap:36px;
}
.footer-col__heading{
  font-family:var(--font-head);
  font-size:13px;
  font-weight:600;
  letter-spacing:0.08em;
  text-transform:uppercase;
  color:var(--ink-soft);
  margin-bottom:14px;
}
.footer-col__list{ display:flex; flex-direction:column; gap:10px; }
.footer-col__list a{
  font-size:14.5px;
  color:var(--ink);
}
.footer-col__list a:hover{ color:var(--accent-deep); text-decoration:underline; }

.footer-brand__name{
  font-family:var(--font-head);
  font-weight:600;
  font-size:19px;
  letter-spacing:0.04em;
  margin-bottom:10px;
}
.footer-brand__blurb{
  font-size:14px;
  color:var(--ink-soft);
  line-height:1.6;
  max-width:280px;
  margin-bottom:18px;
}
.footer-brand__address{
  font-size:13.5px;
  color:var(--ink-soft);
  line-height:1.7;
}

.footer-bottom{
  margin-top:40px;
  padding-top:0;
  display:flex;
  flex-direction:column;
  gap:6px;
  font-size:13px;
  color:var(--ink-soft);
}
.footer-bottom a{ color:var(--ink-soft); }
.footer-bottom a:hover{ color:var(--accent-deep); text-decoration:underline; }

/* ---------- responsive ---------- */
@media (max-width: 980px){
  .footer-grid{ grid-template-columns: 1.4fr 1fr 1fr; }
}

@media (max-width: 760px){
  :root{ --header-h:64px; }
  .nav, .header-row--bottom{ display:none; }
  .nav-mobile{ display:block; }
  .header-row--top{ padding-top:0; padding-bottom:0; height:64px; }
  .site-header__inner{ padding:0 16px; }
  .brand__tag{ display:none; }
  .footer-grid{ grid-template-columns:1fr; gap:30px; }
  .site-footer__inner{ padding:40px 18px 22px; }
  .footer-bottom{ align-items:flex-start; text-align:left; }

  /* backdrop-filter on an iOS/WebKit ancestor traps position:fixed
     descendants inside its own box instead of the viewport — this is
     what was breaking the mobile menu panel on iPhone Safari/Chrome */
  .site-header, .site-header.is-scrolled{
    -webkit-backdrop-filter:none;
    backdrop-filter:none;
    background:rgba(255,255,255,0.97);
  }
}

@media (prefers-reduced-motion: reduce){
  .site-header, .nav__link, .btn, .to-top{ transition:none; }
}