/* Brass+Co Core Styles
   Palette:
   - Bone / Off white: #F5F4F1
   - Brass accent: #B68A4A
   - Charcoal text: #2F2F2F
   - Soft grey text: #6A6A6A
   - Hairline border: rgba(0,0,0,0.08)
   Typeface approach:
   - Headings: high-contrast serif look (simulate with Georgia for now)
   - Body: clean sans (system-ui stack)
   Spacing: generous, calm, high-end
*/

/* Reset-ish */
* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  margin: 0;
  padding: 0;
}

html {
  overflow-x: hidden; /* Prevent horizontal scroll at root level */
  max-width: 100%;
}

body {
  background-color: #F5F4F1;
  color: #2F2F2F;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Inter", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  font-size: 16px;
  overflow-x: hidden; /* Prevent horizontal scroll on mobile */
  max-width: 100%;
}

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

/* Typography */
h1, h2, h3, .serif {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-weight: 400;
  line-height: 1.2;
  color: #2F2F2F;
  letter-spacing: -0.03em;
}

h1 {
  font-size: clamp(2rem, 2.4vw, 2.75rem);
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(1.5rem, 1.2vw, 2rem);
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

p {
  color: #2F2F2F;
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

p.lead {
  font-size: 1rem;
  line-height: 1.6;
  color: #2F2F2F;
  max-width: 44ch;
  margin-bottom: 2rem;
}

.text-muted {
  color: #6A6A6A;
}

/* Layout helpers */
.wrapper {
  width: 100%;
  max-width: 1400px;
  padding: 2rem 1.5rem;
  margin: 0 auto;
}

.section {
  padding: 4rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.section-tight {
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.flex {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

.flex-between {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
}

.col-2 {
  flex: 1 1 300px;
  max-width: 600px;
}

.col-3-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(min(320px,100%), 1fr));
}

/* Header / Nav */
.site-header {
  border-bottom: 1px solid rgba(0,0,0,0.08);
  background: #F5F4F1;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  max-width: 1400px;
  padding: 1rem 1.5rem;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.brand-block {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.brand-name {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 1.125rem;
  letter-spacing: -0.04em;
  color: #2F2F2F;
}

.brand-tagline {
  font-size: .75rem;
  color: #6A6A6A;
  line-height: 1.4;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  font-size: .9rem;
}

.nav-links a {
  color: #2F2F2F;
  text-decoration: none;
  position: relative;
  line-height: 1.4;
}

.nav-links a:hover {
  color: #B68A4A;
}

/* Hide the injected submenu toggle by default (desktop). Mobile media query will reveal it. */
.submenu-toggle {
  display: none !important; /* hide injected button on desktop; mobile will override */
}

/* Mobile nav toggle (hamburger) */
.nav-toggle {
  display: none; /* shown on small screens via media query */
  background: transparent;
  border: none;
  padding: 0.5rem;
  margin-left: 1rem;
  cursor: pointer;
}

.nav-toggle:focus {
  outline: 2px solid rgba(182,138,74,0.25);
  outline-offset: 2px;
}

.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: #2F2F2F;
  margin: 4px 0;
}

/* Small screens: provide a full-screen (under-header) overlay menu. Desktop unchanged. */
@media (max-width: 800px) {
  .nav-toggle { display: block; }

  /* Ensure header content aligns correctly on mobile and allows a pinned hamburger on the right */
  .nav-inner,
  .nav-bar {
    align-items: center;
    justify-content: space-between;
    position: relative;
    display: flex;
    gap: 1rem;
  }

  /* Brand stays left, nav takes remaining space, toggle is pinned right */
  .nav-inner .brand-block,
  .nav-bar .brand-block {
    order: 1;
    flex: 0 0 auto;
    text-align: left;
  }

  .nav-inner .nav-links,
  .nav-bar .nav-links {
    order: 2;
    flex: 1 1 auto;
    margin: 0 1rem;
  }

  .nav-inner .nav-toggle,
  .nav-bar .nav-toggle {
    order: 3;
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 0;
  }

  /* Keep header sticky but show the menu as a fixed overlay beneath it */
  .site-header {
    position: sticky; /* retains desktop-like behaviour but restyled overlay only */
    top: 0;
    z-index: 100;
  }

  /* The main nav becomes a full-screen area beneath the header when open */
  .nav-links {
    display: none; /* hidden by default on mobile */
  }

  .site-header.nav-open .nav-links {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    top: calc(var(--header-height, 64px)); /* leaves header visible */
    bottom: 0;
    padding: 1rem 1.5rem;
    background: #F5F4F1;
    overflow: auto;
    flex-direction: column;
    gap: 0.25rem 0;
    z-index: 95;
  }

  .nav-links a {
    display: block;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.04);
  }

  /* Ensure each nav item stacks and can contain a togglable submenu */
  .nav-item {
    display: block;
    width: 100%;
  }

  /* Submenu: hidden by default on mobile and revealed when .submenu-open is present */
  .submenu {
    position: static;
    border: none;
    box-shadow: none;
    padding-left: 1rem;
    display: none;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .nav-item.submenu-open > .submenu {
    display: block;
  }

  .submenu a {
    padding: 0.5rem 0;
    display: block;
  }

  /* Replace hover chevron on mobile with a visible toggle control (we inject via JS) */
  .has-submenu > a::after { content: ""; }

  .has-submenu {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
  }

  .submenu-toggle {
    display: inline-block !important; /* show submenu toggle on mobile only */
    background: transparent;
    border: none;
    font-size: 1rem;
    padding: 0.5rem;
    line-height: 1;
    cursor: pointer;
    color: #2F2F2F;
    outline-offset: 2px;
  }

  /* When nav closes, ensure submenu visual state resets (JS will also toggle classes) */
}

/* --- Dropdown Navigation --- */
.nav-item {
  position: relative;
  display: inline-block;
}

.has-submenu > a::after {
  /* remove desktop chevron entirely */
  content: none !important;
}

.has-submenu:hover > a::after {
  transform: none;
}

/* Submenu styling */
.submenu {
  display: block;
  position: absolute;
  left: 0;
  top: calc(100% + 0.25rem);
  background: #F5F4F1;
  border: 1px solid rgba(0, 0, 0, 0.08);
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
  z-index: 50;
  box-shadow: 0 8px 16px rgba(0,0,0,0.05);
}

.submenu a {
  display: block;
  padding: 0.6rem 1rem;
  color: #2F2F2F;
  font-size: 0.9rem;
  text-decoration: none;
  background: #F5F4F1;
  transition: background 0.2s;
}

.submenu a:hover {
  background: #E9E6DF;
  color: #B68A4A;
}

/* Hover reveal */
.nav-item:hover > .submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Mobile-friendly (submenu just stacks inline) */
@media (max-width: 800px) {
  .submenu {
    position: static;
    box-shadow: none;
    border: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    padding-left: 1rem;
  }
}


.nav-cta a {
  color: #B68A4A;
  font-weight: 500;
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;

  /* Add or adjust these: */
  background-image: url('your-image.jpg'); /* if you're using a background image */
  background-size: cover; /* or try 'contain' if you prefer */
  background-position: center;
  background-repeat: no-repeat;
}

/* Support for the overlay-style hero markup used on index.html */
.hero-overlay-section {
  display: block;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero-overlay-container {
  position: relative;
  width: 100%;
  height: 75vh;
  min-height: 500px;
}

.hero-overlay-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.hero-overlay-content {
  padding: 0.5rem 0;
}

.hero-copy h1 {
  max-width: 16ch;
}

.hero-copy .lead {
  max-width: 40ch;
}

.hero-image {
  background: #E9E6DF;
  border: 1px solid rgba(0,0,0,0.08);
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6A6A6A;
  font-size: .9rem;
  padding: 2rem;
}

/* Category cards */
.category-card {
  border: 1px solid rgba(0,0,0,0.08);
  background: #EEEDE8;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: #2F2F2F;
  transition: background .2s;
}

.category-card:hover {
  background: #E6E3DC;
}

.category-card img {
  background: #D8D4C9;
  border: 1px solid rgba(0,0,0,0.08);
  margin-bottom: 1rem;
  aspect-ratio: 4/3;
  object-fit: cover;
}

.category-card h3 {
  color: #2F2F2F;
  margin-bottom: .5rem;
}

.category-card p {
  color: #6A6A6A;
  font-size: .9rem;
  line-height: 1.5;
  margin-bottom: .5rem;
}

.link-inline {
  font-size: .9rem;
  color: #B68A4A;
  text-decoration: none;
}

.link-inline:hover {
  text-decoration: underline;
}

/* Top-align only the Ceiling Hung category image */
.category-card[href="ceiling-hung.html"] img {
  object-position: top;
  /* optional: keep same crop height as other cards — adjust or remove if undesired */
  /* height: 220px; */
  /* object-fit: cover; */
}



/* Product spec table style block */
.spec-block {
  border: 1px solid rgba(0,0,0,0.08);
  background: #EEEDE8;
  padding: 1.5rem;
}

.spec-block h3 {
  margin-bottom: .5rem;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
  line-height: 1.4;
}

.spec-table tr + tr td {
  border-top: 1px solid rgba(0,0,0,0.08);
}

.spec-table td {
  padding: .5rem .25rem;
  vertical-align: top;
}

.spec-label {
  font-weight: 500;
  color: #2F2F2F;
  width: 40%;
}

.spec-value {
  color: #6A6A6A;
  width: 60%;
}

/* CTA blocks */
.cta-bar {
  border: 1px solid rgba(0,0,0,0.08);
  background: #E9E6DF;
  padding: 1.5rem;
  text-align: center;
}

.button {
  display: inline-block;
  background: #B68A4A;
  color: #F5F4F1;
  font-size: .9rem;
  line-height: 1.2;
  text-decoration: none;
  padding: .8rem 1.25rem;
  margin-top: 1rem;
  min-width: 160px;
  text-align: center;
  letter-spacing: -0.02em;
}

.button:hover {
  background: #9F7841;
}

/* Footer */
.site-footer {
  background: #F5F4F1;
  border-top: 1px solid rgba(0,0,0,0.08);
  padding-top: 2rem;
  padding-bottom: 2rem;
  font-size: .8rem;
  color: #6A6A6A;
}

.footer-inner {
  max-width: 1400px;
  padding: 0 1.5rem;
  margin: 0 auto;
  display: grid;
  gap: 2rem;
}

@media(min-width:800px){
  .footer-inner {
    grid-template-columns: 1fr auto;
    align-items: start;
  }
}

.footer-left .brand-name {
  font-size: 1rem;
}

.footer-right {
  text-align: left;
}

.footer-links {
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.5rem;
}

.footer-links a {
  color: #2F2F2F;
  text-decoration: none;
}

.footer-links a:hover {
  color: #B68A4A;
}

.footer-legal {
  color: #6A6A6A;
  line-height: 1.4;
  font-size: .75rem;
}

/* Product page layout */
.product-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media(min-width:1000px){
  .product-hero {
    grid-template-columns: 2fr 1fr;
  }
}

.product-image-main {
  background: #E9E6DF;
  border: 1px solid rgba(0,0,0,0.08);
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6A6A6A;
  font-size: .9rem;
  padding: 2rem;
}

.product-summary h1 {
  margin-bottom: 1rem;
}

.product-summary p.lead {
  margin-bottom: 1.5rem;
}

.size-grid {
  margin-top: 2rem;
  border-top: 1px solid rgba(0,0,0,0.08);
  padding-top: 2rem;
  display: grid;
  gap: 1.5rem;
}

.size-card {
  border: 1px solid rgba(0,0,0,0.08);
  background: #F8F7F4;
  padding: 1rem 1.25rem;
  font-size: .9rem;
  line-height: 1.5;
}

.size-card h4 {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-weight: 400;
  font-size: 1rem;
  color: #2F2F2F;
  letter-spacing: -0.03em;
  margin-bottom: .25rem;
}

.size-card .dimensions {
  color: #6A6A6A;
  font-size: .85rem;
  line-height: 1.4;
  margin-bottom: .5rem;
}

/* Contact form */
.form-block {
  max-width: 480px;
  width: 100%;
}

form label {
  display: block;
  font-size: .8rem;
  font-weight: 500;
  color: #2F2F2F;
  margin-bottom: .25rem;
  letter-spacing: -0.02em;
}

form input,
form textarea,
form select {
  width: 100%;
  border: 1px solid rgba(0,0,0,0.2);
  background: #F8F7F4;
  font-size: .9rem;
  padding: .75rem .75rem;
  color: #2F2F2F;
  margin-bottom: 1rem;
  font-family: inherit;
  outline-color: #B68A4A;
  border-radius: 0;
}

form textarea {
  min-height: 120px;
  resize: vertical;
}

/* Utility spacing tweaks */
.mb-2 { margin-bottom: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mt-2 { margin-top: 2rem; }
.center { text-align: center; }
.brass { color: #B68A4A; }

/* Responsive tweaks */
@media(max-width:500px){
  .nav-inner {
    flex-direction: column;
    gap: 1rem;
  }
  .nav-links {
    padding-left: 0;
  }
}


/* --- Product Hero (Novocastrian style) --- */
.hero-product {
  position: relative;
  overflow: hidden;
}

.hero-product .hero-img {
  width: 100%;
  height: 75vh;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Show ceiling mounting on ceiling-hung page - full width, cropped */
.page-ceiling-hung .hero-product .hero-img {
  object-fit: cover;
  object-position: top;
}

.hero-overlay {
  position: absolute;
  bottom: 10%;
  left: 5%;
  max-width: 600px;
  background: rgba(245, 244, 241, 0.8);
  padding: 2rem;
  backdrop-filter: blur(4px);
}

.hero-overlay h1 {
  margin-bottom: 0.5rem;
}

.hero-overlay .lead {
  color: #2F2F2F;
}

/* --- Gallery Grid --- */
.gallery-grid img {
  border: 1px solid rgba(0,0,0,0.05);
  background: #E9E6DF;
  object-fit: cover;
  aspect-ratio: 4/3;
}

/* --- Narrow wrapper for paragraphs --- */
.wrapper.narrow {
  max-width: 800px;
  margin: 0 auto;
}

/* --- Minor fade on images --- */
.gallery-grid img:hover {
  opacity: 0.9;
  transition: opacity 0.2s ease-in-out;
}

/* --- Full-width hero with overlay text --- */
.hero-overlay-section {
  position: relative;
  width: 100%;
  overflow: hidden;
  margin: 0;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.hero-overlay-container {
  position: relative;
  width: 100%;
  height: 75vh;
  min-height: 500px;
  display: flex;
  flex-direction: row;
}

/* Image section - maintains aspect ratio */
.hero-image-section {
  height: 100%;
  flex-shrink: 0;
  position: relative;
  aspect-ratio: 4096 / 3848; /* Natural aspect ratio of the image */
}

.hero-overlay-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

/* Color block fills remaining space */
.hero-color-block {
  flex-grow: 1;
  background: #E9E6DF; /* Neutral color matching site palette */
  height: 100%;
}

/* Overlay text box */
.hero-overlay-content {
  position: absolute;
  bottom: 12%;
  left: 8%;
  background: rgba(245, 244, 241, 0.6); /* more transparent */
  padding: 2rem 2.5rem;
  max-width: 600px;
  backdrop-filter: blur(4px);
  color: #2F2F2F;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.hero-overlay-content h1 {
  font-size: clamp(2rem, 2.5vw, 2.8rem);
  margin-bottom: 1rem;
}

.hero-overlay-content .lead {
  margin-bottom: 2rem;
  max-width: 45ch;
}

/* Button override for this hero */
.hero-overlay-content .button {
  background: #B68A4A;
  color: #F5F4F1;
  text-decoration: none;
  padding: 0.8rem 1.5rem;
}

.hero-overlay-content .button:hover {
  background: #9F7841;
}

/* Desktop/mobile description visibility */
.hero-description-mobile {
  display: none; /* hidden by default on desktop */
}

.hero-description-desktop {
  display: block; /* shown by default on desktop */
}

/* Responsive */
@media (max-width: 900px) {
  .hero-overlay-container {
    height: 60vh;
    min-height: 400px;
    flex-direction: column;
  }
  
  .hero-image-section {
    width: 100%;
    height: auto;
    aspect-ratio: 4096 / 3848;
  }
  
  .hero-color-block {
    display: none; /* Hide color block on mobile */
  }
  
  .hero-overlay-content {
    left: 5%;
    right: 5%;
    padding: 1.5rem;
    bottom: 10%;
  }
  
  /* Hide description overlay on mobile, show below image */
  .hero-description-desktop {
    display: none;
  }
  
  .hero-description-mobile {
    display: block;
    padding: 2rem 0;
    background: #F5F4F1;
  }
  
  .hero-description-mobile .lead {
    text-align: center;
    max-width: 55ch;
    margin: 0 auto;
  }
}

@media (max-width: 600px) {
  .hero-overlay-content {
    background: rgba(245, 244, 241, 0.6);
    backdrop-filter: blur(4px);
    border-radius: 0.5rem;
  }
  .hero-overlay-content h1 {
    font-size: 1.75rem;
  }
}
/* --- Product intro layout --- */
.product-intro-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
}

/* On larger screens, show side by side */
@media (min-width: 900px) {
  .product-intro-content {
    grid-template-columns: 1fr 1fr;
  }

  .product-intro-image {
    justify-self: end;
  }
}

.product-intro-text p {
  margin-bottom: 1.5rem;
}

.product-intro-image img {
  width: 100%;
  height: auto;
  object-fit: contain; /* keeps full image visible */
  display: block;
  border-radius: 0.5rem; /* optional: for soft corners */
}
/* --- Gallery grid layout --- */
.col-3-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .col-3-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* --- Overlay effect --- */
.image-overlay {
  position: relative;
  overflow: hidden;
  border-radius: 0.5rem;
}

.image-overlay img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.4s ease;
}

/* Caption overlay FOR FINISH SAMPLES */
.image-overlay figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.95rem;
  text-align: center;
  padding: 0.6rem 0;
  opacity: 0;
  transform: translateY(100%);
  transition: all 0.4s ease;
  letter-spacing: 0.5px;
}

/* Mobile: always show finish names, no hover required */
@media (max-width: 900px) {
  .image-overlay figcaption {
    opacity: 1;
    transform: translateY(0);
    position: static;
    background: transparent;
    color: #2F2F2F;
    font-size: 1rem;
    font-weight: 400;
    margin-top: 0.25rem;
    padding: 0;
    border-radius: 0;
  }
  
  /* Ensure image keeps rounded corners on mobile */
  .image-overlay img {
    border-radius: 0.5rem;
  }
}

/* --- Hover effects --- */
.image-overlay:hover img {
  transform: scale(1.05);
}

.image-overlay:hover figcaption {
  opacity: 1;
  transform: translateY(0);
}

/* Mobile: Show figcaption below finishes with "click to view" styling */
@media (max-width: 768px) {
  .image-overlay figcaption {
    position: static;
    opacity: 1;
    transform: none;
    background: transparent;
    color: #6A6A6A;
    font-size: 0.75rem;
    font-style: italic;
    padding: 0.5rem 0 0 0;
    text-align: center;
  }
  
  .image-overlay figcaption::after {
    content: " – click to view";
  }
}

/* --- Layout for text/table + image --- */
.size-layout {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 2rem;
}

@media (min-width: 900px) {
  .size-layout {
    grid-template-columns: 1fr 1fr; /* left: table, right: image */
  }
}

/* --- Layout: table + image --- */
.size-layout {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 2rem;
}
@media (min-width: 900px) {
  .size-layout {
    grid-template-columns: 1fr 1fr; /* table left, image right */
  }
}

/* --- Standard Modules Table Styling --- */
.size-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  margin-top: 2rem;
  font-size: 0.95rem;
  background-color: #F8F7F4; /* soft background to match site tone */
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 0.5rem;
  overflow: hidden; /* ensure corners are rounded */
  box-shadow: 0 2px 6px rgba(0,0,0,0.03); /* subtle lift */
}

.size-table th,
.size-table td {
  border: 1px solid rgba(0,0,0,0.08);
}

.size-table thead th {
  background-color: #EEEDE8; /* soft grey tone for top row */
  font-weight: 600;
  padding: 0.75rem 1rem;
}

.size-table tbody th {
  background-color: #F1F0EC;
  font-weight: 600;
  width: 8rem;
  text-align: center;
  vertical-align: middle;
}

.size-table td {
  width: 6rem;
  height: 2.5rem;
  position: relative;
  text-align: center;
  vertical-align: middle;
  cursor: pointer;
  padding: 0;
  line-height: 2.5rem;
  transition: background-color 0.2s ease;
  /* Top merged header row (Width mm) */
.size-table thead tr:first-child th {
  background-color: #EEEDE8;
  font-weight: 600;
  text-align: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

/* Second header row (individual width values) */
.size-table thead tr:nth-child(2) th {
  background-color: #F1F0EC;
  font-weight: 600;
  padding: 0.75rem 1rem;
}

}

/* Hover highlights */
.size-table td.row-highlight,
.size-table th.row-highlight,
.size-table td.col-highlight,
.size-table th.col-highlight {
  background-color: rgba(215,199,158,0.25);
}

.size-table td.hovered {
  background-color: rgba(215,199,158,0.4);
}

/* Clicked cell */
.size-table td.active {
  background-color: #d7c79e;
  font-weight: 600;
  color: #000;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Measurement text (appears on click) */
.size-table td.active::after {
  content: attr(data-label);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.5rem;
  font-weight: 600;
  color: #000;
  line-height: 1.2;
  text-align: center;
  pointer-events: none;
}




/* DATA CELLS */
.size-table td {
  width: 6rem;              /* lock width so table doesn't jump */
  height: 2.5rem;           /* lock height so table doesn't jump */
  position: relative;       /* so ::after can sit on top */
  overflow: hidden;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s ease;
  padding: 0;               /* we control centering with line-height */
  line-height: 2.5rem;      /* vertically center default state */
}

/* --- Hover preview styles --- */
.size-table td.row-highlight,
.size-table th.row-highlight,
.size-table td.col-highlight,
.size-table th.col-highlight {
  background-color: rgba(215,199,158,0.25);
}

.size-table td.hovered {
  background-color: rgba(215,199,158,0.4);
}

/* --- Locked / clicked cell --- */
.size-table td.active {
  background-color: #d7c79e;
  font-weight: 600;
  color: #000;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Show the measurement text without resizing the cell */
.size-table td.active::after {
  content: attr(data-label);   /* text comes from JS-set data-label */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.8rem;
  font-weight: 600;
  color: #000;
  line-height: 1.2;
  text-align: center;
  pointer-events: none;
}

/* Mobile: smaller font size for measurement text to fit in cells */
@media (max-width: 900px) {
  .size-table {
    font-size: 0.85rem; /* slightly smaller base font */
  }
  
  .size-table td.active::after {
    font-size: 0.4rem; /* much smaller text to fit in mobile cells */
    line-height: 1.1;
    white-space: nowrap;
  }
  
  .size-table th,
  .size-table td {
    padding: 0.4rem 0.2rem; /* tighter padding on mobile */
  }
  
  .size-table thead th {
    padding: 0.6rem 0.4rem;
    font-size: 0.8rem;
  }
}


/* --- Interactive highlights --- */
.size-table td.active {
  background-color: #d7c79e; /* brass tone for clicked cell */
}
.size-table td.row-highlight,
.size-table th.row-highlight {
  background-color: rgba(215,199,158,0.25);
}
.size-table td.col-highlight,
.size-table th.col-highlight {
  background-color: rgba(215,199,158,0.25);
}

/* Hovered (temporary) cell */
.size-table td.hovered {
  background-color: rgba(215,199,158,0.4); /* lighter brass tone */
}
/* --- Final Standard Module Table Styling --- */
.size-table td.active {
  background-color: #d7c79e;
  font-weight: 600;
  color: #000;
  font-size: 0.85rem;
  text-align: center;
  line-height: 2.5rem;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ✅ Section spacing */
.size-table-container h2 {
  margin-bottom: 0.75rem;
}

.size-table-container p {
  margin-bottom: 1.25rem;
}

.option-table + h3 {
  margin-top: 2rem;
}

/* --- Option Tables (Finish, Material, Shelf Count) --- */
.option-table {
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.95rem;
  background-color: #F8F7F4;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 0.5rem;
  overflow: hidden;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
  width: auto;               /* 👈 allow tables to shrink to fit */
  margin-left: 0;            /* default alignment */
  margin-right: 0;
}

/* Table cells */
.option-table td {
  border: 1px solid rgba(0,0,0,0.08);
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Hover preview */
.option-table td.hovered {
  background-color: rgba(215,199,158,0.3);
}

/* Clicked/selected */
.option-table td.active {
  background-color: #d7c79e;
  font-weight: 600;
  color: #000;
}

/* Center align specific option tables */
#metalFinishTable,
#shelfMaterialTable,
#typeTable,
#shelfCountTable {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

/* Make shelf count table columns wider */
#shelfCountTable td {
  min-width: 100px;  /* Double the typical width */
  padding: 0.75rem 2rem;  /* Increased horizontal padding */
}

/* Option tables that follow centered sections should also use full-width centering */
.configurator-section-centered + .option-table {
  width: auto;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  display: table;
}

.configurator-section-centered + .option-table tbody {
  display: table-row-group;
}



/* --- Enquiry layout --- */
.enquiry-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  border-top: 1px solid rgba(0,0,0,0.08);
  padding-top: 2rem;
}

@media (min-width: 900px) {
  .enquiry-layout {
    grid-template-columns: 2fr 1fr;
    align-items: start;
  }
}

.enquiry-form-block {
  background: #F8F7F4;
  border: 1px solid rgba(0,0,0,0.08);
  padding: 2rem;
  border-radius: 0.5rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.enquiry-aside-inner {
  background: #EEEDE8;
  border: 1px solid rgba(0,0,0,0.08);
  padding: 1.5rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  line-height: 1.4;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

/* form rows */
.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
@media (min-width: 700px) {
  .form-row {
    grid-template-columns: 1fr 1fr;
  }
}

.form-field {
  display: flex;
  flex-direction: column;
}

.form-field label {
  font-size: .8rem;
  font-weight: 500;
  color: #2F2F2F;
  margin-bottom: .25rem;
  letter-spacing: -0.02em;
}

.form-field input,
.form-field textarea {
  width: 100%;
  border: 1px solid rgba(0,0,0,0.2);
  background: #F8F7F4;
  font-size: .9rem;
  padding: .75rem .75rem;
  color: #2F2F2F;
  font-family: inherit;
  outline-color: #B68A4A;
  border-radius: 0;
}

.form-field textarea {
  min-height: 120px;
  resize: vertical;
}

.block-label {
  display: block;
  font-size: .8rem;
  font-weight: 500;
  color: #2F2F2F;
  margin-bottom: .5rem;
  letter-spacing: -0.02em;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .9rem;
  color: #2F2F2F;
  margin-bottom: .5rem;
}

/* Layout for the inner bespoke checkboxes */
.bespoke-details .checkbox-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

/* Layout for the main "Bespoke Work Required" line */
.bespoke-block .main-bespoke {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}


.summary-card {
  background: #EEEDE8;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  margin-top: 2rem;
  font-size: .9rem;
  line-height: 1.4;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.summary-card h3 {
  font-size: 1rem;
  margin-bottom: .75rem;
  font-weight: 400;
  letter-spacing: -0.03em;
}

.summary-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.summary-list li {
  margin-bottom: .5rem;
  color: #2F2F2F;
}
.summary-list strong {
  color: #2F2F2F;
  font-weight: 500;
}


/* --- Image styling --- */
.size-image {
  display: flex;
  justify-content: flex-end; /* keeps image on the right */
  align-items: flex-start;   /* top-align within the grid row */
  margin-top: 15rem; /* Offset to align with "Select Your Size" section (after Type section) */
}

/* Mobile image container (shows after size table, before finish) */
.mobile-image-container {
  display: none; /* hidden by default */
  justify-content: center;
  margin: 3rem 0;
}

.mobile-image-container img {
  width: 80%;
  height: auto;
  object-fit: contain;
  border-radius: 0.5rem;
  border: 1px solid rgba(0,0,0,0.08);
  background-color: #F8F7F4;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* Mobile: hide desktop image, show mobile image */
@media (max-width: 900px) {
  .size-image {
    display: none; /* hide desktop positioned image */
  }
  
  .mobile-image-container {
    display: flex; /* show mobile positioned image */
  }
}
/* Optional: make the image itself behave cleanly */
.size-image img {
  width: 80%;
  height: auto;
  object-fit: contain;
  border-radius: 0.5rem;
  display: block;
  vertical-align: top;

    /* 👇 Add this */
  border: 1px solid rgba(0,0,0,0.08); /* matches your spec tables */
  background-color: #F8F7F4; /* optional: gives it the same soft tone behind */
  box-shadow: 0 2px 8px rgba(0,0,0,0.04); /* optional: a gentle lift if you like */
}



/* Small text note */
.text-muted.small {
  font-size: 0.85rem;
  margin-top: 0.75rem;
  color: #666;
}
/* =========================================================
   ✅ Center the Finish & Shelf Material tables
   ========================================================= */

#metalFinishTable,
#shelfMaterialTable,
#typeTable {
  display: table;
  width: auto;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  border: 1px solid rgba(0,0,0,0.08); /* keep spec-table style */
}

/* ✅ Center headings and text for these sections */
#metalFinishTable,
#shelfMaterialTable,
#typeTable,
#metalFinishTable + p,
#shelfMaterialTable + p,
#metalFinishTable ~ h2,
#shelfMaterialTable ~ h2,
#metalFinishTable ~ h3,
#shelfMaterialTable ~ h3 {
  text-align: center;
}

/* ✅ Ensure the container allows centering */
.size-table-container {
  display: flex;
  flex-direction: column;
  align-items: center; /* horizontally centers child tables */
}

.size-table-container > * {
  width: 100%;
  max-width: 650px; /* keeps it neat and prevents text spanning too wide */
}

.size-table-container h2,
.size-table-container h3,
.size-table-container p {
  text-align: center;
}
/* =========================================================
   🧱 Spacing between configurator sections (size / finish / shelving)
   ========================================================= */

.standard-modules h2.serif {
  margin-top: 3rem; /* default top spacing */
  margin-bottom: 1rem;
}

/* Extra gap between the size table and the next heading (Select Your Finish) */
#sizeTable {
  margin-bottom: 4rem; /* increase spacing below the size table */
}

/* Extra gap between finish section and shelving section */
#metalFinishTable,
#typeTable {
  margin-bottom: 4rem; /* spacing below the finish / type options */
}

/* Tighten or widen spacing before smaller subheadings (like "Number of Shelves") */
.standard-modules h3.serif {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

/* Optional: add more breathing room below the last table (Shelf Material) */
#shelfMaterialTable {
  margin-bottom: 4rem;
}
/* =========================================================
   🪚 Shelving Configurator Main Heading
   ========================================================= */
.configurator-heading {
  font-size: clamp(2rem, 3vw, 2.75rem);  /* large and responsive */
  font-weight: 400;
  text-align: center;
  margin-bottom: 1rem;                   /* space before description */
  margin-top: 0.7rem;                    /* optional top spacing */
  color: #2F2F2F;
  letter-spacing: -0.03em;
}

/* Configurator intro paragraph (description) */
.configurator-intro {
  text-align: center;
  margin: 0 auto 3rem;
  max-width: 60ch;
  padding: 0 1rem; /* Add horizontal padding for mobile */
}

/* Configurator header wrapper - full width centered container */
.configurator-header-wrapper {
  text-align: center;
  width: 100%;
  padding: 0 2rem 0 2rem; /* Match wrapper padding */
  margin: 0 auto;
  max-width: 1400px; /* Match wrapper max-width */
}

@media (max-width: 768px) {
  .configurator-header-wrapper {
    padding: 0 1.5rem; /* Reduce padding on mobile to match wrapper */
  }
}

/* Center align configurator section headings (except "Select Your Size") */
.configurator-section-centered {
  text-align: center;
  max-width: 100%;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.configurator-section-centered h2,
.configurator-section-centered h3,
.configurator-section-centered p {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

/* Continue with selections button */
.continue-button-wrapper {
  text-align: center;
  margin-top: 3rem;
  margin-bottom: 2rem;
  width: 100%;
}

.continue-selections-btn {
  display: inline-block;
  padding: 0.875rem 2rem;
  background-color: #B68A4A;
  color: white;
  text-decoration: none;
  border-radius: 0.375rem;
  font-size: 1rem;
  font-weight: 500;
  transition: background-color 0.2s ease, transform 0.1s ease;
  border: none;
  cursor: pointer;
}

.continue-selections-btn:hover {
  background-color: #9A7239;
  transform: translateY(-1px);
}

.continue-selections-btn:active {
  transform: translateY(0);
}

/* Add extra top spacing if needed between configurator and previous section */
.standard-modules {
  padding-top: 4rem;
}
/* --- Bespoke section layout fixes --- */
.bespoke-block {
  margin-top: 2rem;
}

.bespoke-block .checkbox-line {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.bespoke-block input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: #d7c79e; /* brass tint */
}

/* Visual summary card spacing */
.summary-card {
  border: 1px solid rgba(0,0,0,0.1);
  background-color: #f1ede5;
  padding: 1.25rem 1.5rem;
  border-radius: 0.5rem;
  margin: 2rem 0 3rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.summary-card h3 {
  margin-bottom: 0.75rem;
}
.summary-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.summary-list li {
  margin-bottom: 0.3rem;
}
/* --- Bespoke details layout --- */
.bespoke-details .checkbox-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.bespoke-details label {
  min-width: 110px; /* keeps labels nicely aligned */
}

.bespoke-text {
  flex: 1;
  padding: 0.4rem 0.6rem;
  font-size: 0.9rem;
  border: 1px solid rgba(0,0,0,0.2);
  border-radius: 0.3rem;
  background: #F8F7F4;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.bespoke-text:focus {
  border-color: #B68A4A;
  background-color: #fff;
  outline: none;
}

/* Email links: no underline, no color change */
a.email-link {
  color: inherit;
  text-decoration: none;
}

a.email-link:hover {
  color: inherit;
  text-decoration: none;
}


/* =========================================================
   Responsive styles for configurator on mobile
   ========================================================= */
@media (max-width: 900px) {
  /* Prevent horizontal scroll on mobile */
  body {
    overflow-x: hidden;
  }
  
  /* Ensure centered items remain centered on mobile */
  .configurator-section-centered {
    padding: 0; /* Remove padding to allow perfect centering */
    max-width: 100%;
    width: 100%;
  }
  
  .configurator-section-centered h2,
  .configurator-section-centered h3,
  .configurator-section-centered p {
    text-align: center;
    padding: 0 1rem; /* Add padding only to text */
  }
  
  /* Keep button centered on mobile */
  .continue-button-wrapper {
    text-align: center;
    padding: 0 1rem;
    width: 100%;
    max-width: 100%;
  }
  
  /* Ensure shelf count table fits on mobile */
  #shelfCountTable td {
    min-width: 60px;  /* Reduce width on mobile */
    padding: 0.75rem 1rem;  /* Less padding on mobile */
  }

  /* Center all option tables on mobile */
  .option-table,
  #metalFinishTable,
  #shelfMaterialTable,
  #typeTable,
  #shelfCountTable {
    margin-left: auto;
    margin-right: auto;
    display: table; /* Override any flex display */
    max-width: 100%;
    width: auto;
  }

  /* Wrapper should not cause overflow but maintain padding for text */
  .standard-modules .wrapper.size-layout {
    padding-left: 0;
    padding-right: 0;
    max-width: 100%;
    overflow-x: hidden;
  }

  /* Fix mobile centering - use grid place-items */
  .size-layout {
    place-items: center; /* Center grid items */
    max-width: 100%;
  }

  .size-table-container {
    display: flex;
    flex-direction: column;
    align-items: center; /* Center horizontally */
    max-width: 100%;
    width: 100%; /* Take full width */
    padding: 0; /* Remove padding to allow perfect centering */
  }

  .size-table-container > * {
    width: auto; /* Allow elements to size naturally */
    max-width: 100%; /* Don't exceed container */
  }

  .size-table-container h2,
  .size-table-container h3,
  .size-table-container p {
    text-align: center;
    width: 100%; /* Full width for text elements */
    padding: 0 1.5rem; /* Add padding only to text elements */
  }

  /* Ensure all tables display as table and are centered */
  .size-table,
  .option-table,
  #sizeTable,
  #typeTable,
  #metalFinishTable,
  #shelfCountTable,
  #shelfMaterialTable {
    display: table !important; /* Tables must be display: table */
    margin-left: auto;
    margin-right: auto;
    width: auto; /* Allow natural width */
    max-width: 100%; /* But don't overflow */
  }

  /* Center text within table cells on mobile */
  .option-table td,
  #sizeTable td,
  #typeTable td,
  #metalFinishTable td,
  #shelfCountTable td,
  #shelfMaterialTable td {
    text-align: center;
  }

  /* Center the continue button/link on mobile */
  .continue-button-wrapper,
  .size-table-container a[href*="enquiry"] {
    display: block !important;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    max-width: 100%;
  }

  .mobile-image-container {
    display: flex; /* Keep flex for image container */
    justify-content: center;
    text-align: center;
    max-width: 100%;
  }

  .configurator-section-centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 100%;
  }
}

/* CONFIGURATOR & TABLE RESPONSIVENESS FIXES */
.configurator-header-wrapper {
  width: 100%;
  max-width: 1400px;
  padding: 2rem 1.5rem;
  margin: 0 auto;
  text-align: center;
  box-sizing: border-box;
  position: relative;
  z-index: 2;
}

.configurator-heading {
  margin: 0 0 0.5rem;
}

.configurator-intro {
  margin: 0 auto;
  max-width: 60ch;
  color: #6A6A6A;
  text-align: center;
  padding: 0 1rem;
}

.continue-button-wrapper {
  text-align: center;
  margin: 1.5rem 0;
}
.continue-selections-btn { display: inline-block; }

.configurator-section-centered { text-align: center; }
.configurator-section-centered p { margin-left: auto; margin-right: auto; max-width: 50ch; }

/* Tables on mobile: ensure they fit within viewport */
@media (max-width: 900px) {
  .wrapper.size-layout table,
  .size-layout table,
  .wrapper.size-layout .option-table,
  .wrapper.size-layout .size-table,
  .wrapper.size-layout #shelfCountTable,
  .size-layout .option-table,
  .size-layout .size-table,
  .size-layout #shelfCountTable {
    display: table;
    width: auto;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    overflow-x: visible; /* Don't enable horizontal scroll */
  }
}

.size-layout table th,
.size-layout table td,
.size-layout table caption {
  white-space: nowrap;
  vertical-align: middle;
  padding: .5rem .5rem;
  box-sizing: border-box;
}

@media (min-width: 601px) {
  #shelfCountTable td,
  #shelfCountTable th {
    min-width: 100px;
    padding: .5rem 1rem;
    text-align: center;
  }
}

@media (max-width: 600px) {
  #shelfCountTable td,
  #shelfCountTable th {
    min-width: 50px; /* Reduced to fit better on mobile */
    padding: .45rem .5rem; /* Reduced padding */
    text-align: center;
    font-size: 0.85rem; /* Slightly smaller font */
  }

  .configurator-header-wrapper { padding: 1.25rem 1rem; }
  .configurator-intro { padding: 0 .75rem; max-width: 55ch; }
  
  /* Ensure tables scale down on very small screens */
  .size-table,
  .option-table {
    font-size: 0.8rem;
  }
  
  .size-table td,
  .size-table th,
  .option-table td {
    padding: .4rem .3rem;
  }
}

.size-layout,
.wrapper.size-layout {
  box-sizing: border-box;
  max-width: 100%;
  overflow-x: hidden;
}

/* End of configurator and table responsiveness fixes */
