/* ==========================================================================
   HEADWAY EXPERTS LTD - Core Stylesheet
   High-Contrast, Modern UK Pet Supplies E-Commerce
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;700&family=Caveat:wght@600&family=Rethink+Sans:ital,wght@0,400;0,500;0,600;1,400;1,500&display=swap');

:root {
  /* Locked High-Contrast Color Variables */
  --ink: #1A2421;
  --body: #33413C;
  --accent: #1E6B52;
  --accent-hover: #165340;
  --support: #EEF5F2;
  --bg-white: #FFFFFF;
  --bg-cream: #FAF8F5;
  --border: #D6DFDC;
  --dark-text: #E5ECE9;

  /* Additional Layout & Typography Tokens */
  --font-heading: 'Bricolage Grotesque', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-body: 'Rethink Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-eyebrow: 'Caveat', cursive, sans-serif;

  --radius-card: 16px;
  --radius-btn: 10px;
  --radius-sm: 8px;
  --radius-pill: 9999px;

  --shadow-subtle: 0 4px 16px rgba(26, 36, 33, 0.06);
  --shadow-lift: 0 10px 24px rgba(26, 36, 33, 0.10);
  --shadow-drawer: -6px 0 30px rgba(26, 36, 33, 0.18);
  --shadow-modal: 0 20px 40px rgba(26, 36, 33, 0.22);

  --max-width: 1160px;
  --header-height: 92px;
  --announcement-height: 38px;
  --top-total-height: 130px;
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--body);
  background-color: var(--bg-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Typography Rules */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--ink);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.015em;
}

h1 {
  font-size: clamp(2.3rem, 4.5vw, 3.8rem);
  font-weight: 700;
  line-height: 1.15;
}

h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  line-height: 1.25;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.35;
}

p {
  color: var(--body);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* Eyebrow Accent (strictly lowercase, 2-3 words max, Caveat 600) */
.eyebrow {
  display: inline-block;
  font-family: var(--font-eyebrow);
  font-weight: 600;
  font-size: 20px;
  line-height: 1;
  color: var(--accent);
  text-transform: lowercase;
  margin-bottom: 0.5rem;
}

.eyebrow-dark {
  color: #79D4B8;
}

/* Container & Layout */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

@media (max-width: 640px) {
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* Alternating Section Bands */
.section {
  padding-top: 80px;
  padding-bottom: 80px;
  position: relative;
}

.section-white {
  background-color: var(--bg-white);
  border-bottom: 1px solid var(--border);
}

.section-cream {
  background-color: var(--bg-cream);
  border-bottom: 1px solid var(--border);
}

.section-support {
  background-color: var(--support);
  border-bottom: 1px solid var(--border);
}

.section-dark {
  background-color: var(--ink);
  color: var(--dark-text);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.section-dark h1,
.section-dark h2,
.section-dark h3,
.section-dark h4 {
  color: var(--bg-white);
}

.section-dark p {
  color: var(--dark-text);
}

@media (max-width: 768px) {
  .section {
    padding-top: 48px;
    padding-bottom: 48px;
  }
}

/* Standard Section Header */
.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 48px auto;
}

.section-header.text-left {
  text-align: left;
  margin-left: 0;
}

.section-header h2 {
  margin-top: 4px;
  margin-bottom: 12px;
}

.section-header p {
  font-size: 1.05rem;
  color: var(--body);
}

/* Buttons (10px radius, 44px min tap targets, high contrast) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.975rem;
  padding: 13px 24px;
  border-radius: var(--radius-btn);
  border: 1px solid transparent;
  cursor: pointer;
  min-height: 46px;
  text-align: center;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn:focus-visible {
  outline: 3px solid #79D4B8;
  outline-offset: 2px;
}

.btn-primary {
  background-color: var(--accent);
  color: #FFFFFF !important;
  border-color: var(--accent);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(30, 107, 82, 0.25);
}

.btn-outline {
  background-color: transparent;
  color: var(--ink);
  border-color: var(--border);
}

.btn-outline:hover {
  background-color: var(--support);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.btn-outline-white {
  background-color: transparent;
  color: #FFFFFF !important;
  border-color: rgba(255, 255, 255, 0.85);
}

.btn-outline-white:hover {
  background-color: rgba(255, 255, 255, 0.15);
  border-color: #FFFFFF;
  color: #FFFFFF !important;
  transform: translateY(-1px);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.875rem;
  min-height: 40px;
}

.btn-block {
  width: 100%;
}

/* Soft-square cards with 1px border */
.card {
  background-color: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-subtle);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: #BAC7C3;
}

/* Symmetrical 4-Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  align-items: stretch;
}

@media (max-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (max-width: 600px) {
  .product-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

/* Individual Product Card */
.product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-subtle);
  overflow: hidden;
  position: relative;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
}

/* Uniform 1:1 square container */
.product-card-img-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  background-color: #F4F6F5;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.product-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-card:hover .product-card-img-wrap img {
  transform: scale(1.04);
}

.badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background-color: var(--ink);
  color: #FFFFFF;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  z-index: 2;
}

.badge-accent {
  background-color: var(--accent);
}

.badge-outline {
  background-color: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  border: 1px solid var(--border);
}

.product-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-category {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 6px;
}

.product-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
  margin-bottom: 8px;
}

.product-title a:hover {
  color: var(--accent);
}

.product-desc {
  font-size: 0.9rem;
  color: var(--body);
  line-height: 1.5;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.product-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.product-price {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
}

.product-shipping-note {
  font-size: 0.78rem;
  color: var(--body);
  opacity: 0.9;
}

.product-card-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.btn-quick-view {
  padding: 10px 14px;
  min-height: 44px;
  border: 1px solid var(--border);
  background: var(--support);
  border-radius: var(--radius-btn);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.btn-quick-view:hover {
  background-color: #E2ECE8;
  border-color: var(--accent);
  color: var(--accent);
}

/* Sticky Header Offset: No Sticky Header Clipping */
.page-top-offset {
  padding-top: 110px;
}

@media (max-width: 768px) {
  .page-top-offset {
    padding-top: 100px;
  }
}

/* Page Header Banner for Inner Pages */
.page-header {
  padding: 48px 0 40px 0;
  background-color: var(--bg-cream);
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  margin-bottom: 8px;
}

.page-header p {
  font-size: 1.1rem;
  color: var(--body);
  max-width: 640px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--body);
  margin-bottom: 12px;
}

.breadcrumb a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.breadcrumb span {
  opacity: 0.5;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
