/*
Theme Name: The Beauty Way
Description: Custom theme matching the original Squarespace design of thebeautywayllc.com. WooCommerce ready.
Version: 1.1.3
Text Domain: thebeautyway
*/

:root {
  --tbw-black: #000;
  --tbw-white: #fff;
  --tbw-taupe: #9c8b7e;
  --tbw-light: #d6d2cd;
  --tbw-text: #000;
  --tbw-display: 'Bodoni Moda', 'Didot', serif;
  --tbw-body: 'Spectral', Georgia, serif;
  --tbw-max: 1400px;
  --tbw-gutter: clamp(16px, 4vw, 48px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--tbw-white);
  color: var(--tbw-text);
  font-family: var(--tbw-body);
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--tbw-display);
  font-weight: 500;
  /* Large optical sizes of Bodoni Moda have hairline strokes that vanish on screen. */
  font-optical-sizing: none;
  font-variation-settings: "opsz" 11;
  text-transform: uppercase;
  line-height: 1.15;
  letter-spacing: 0;
  margin: 0 0 .6em;
}
h1 { font-size: clamp(2rem, 4.2vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: clamp(1.8rem, 3.6vw, 2.8rem); }
h4 { font-size: clamp(1.2rem, 2vw, 1.5rem); }
p { margin: 0 0 1em; }

.screen-reader-text, .skip-link:not(:focus) {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
}

/* Header */
.tbw-header {
  background: var(--tbw-black);
  color: var(--tbw-white);
  position: sticky; top: 0; z-index: 50;
}
.tbw-header__inner {
  max-width: var(--tbw-max); margin: 0 auto;
  padding: 14px var(--tbw-gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.tbw-logo {
  font-family: var(--tbw-display); text-transform: uppercase; text-decoration: none;
  font-size: 1.6rem; letter-spacing: .02em; white-space: nowrap;
}
.tbw-nav { display: flex; align-items: center; gap: 22px; }
.tbw-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 22px; }
.tbw-nav a { text-decoration: none; font-size: 1.2rem; }
.tbw-nav a:hover { opacity: .75; }
.tbw-social { display: flex; gap: 18px; align-items: center; }
.tbw-social svg { width: 20px; height: 20px; fill: currentColor; display: block; }
.tbw-menu-toggle {
  display: none; background: none; border: 0; color: inherit; cursor: pointer; padding: 6px;
}
.tbw-menu-toggle svg { width: 26px; height: 26px; stroke: currentColor; }

@media (max-width: 800px) {
  .tbw-menu-toggle { display: block; }
  .tbw-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--tbw-black); flex-direction: column; align-items: flex-start;
    padding: 16px var(--tbw-gutter) 24px; gap: 18px;
  }
  .tbw-nav.is-open { display: flex; }
  .tbw-nav ul { flex-direction: column; gap: 14px; }
  .tbw-nav a { font-size: 1.4rem; }
}

/* Page sections imported from the original layout */
/* On short pages the last section stretches to the footer instead of leaving a white gap. */
.tbw-main { min-height: 50vh; display: flex; flex-direction: column; }
.tbw-main > * { flex: 0 0 auto; }
.tbw-main > .tbw-section:last-child { flex-grow: 1; }
.tbw-section {
  position: relative;
  padding: clamp(40px, 7vw, 96px) var(--tbw-gutter);
  background-size: cover; background-position: center;
}
.tbw-section__inner { max-width: var(--tbw-max); margin: 0 auto; }
.tbw-section--narrow .tbw-section__inner { max-width: 900px; }
.tbw-theme-white, .tbw-theme- { background-color: var(--tbw-white); color: var(--tbw-black); }
.tbw-theme-light { background-color: var(--tbw-light); color: var(--tbw-black); }
.tbw-theme-bright { background-color: var(--tbw-taupe); color: var(--tbw-white); }
.tbw-theme-dark, .tbw-theme-black { background-color: var(--tbw-black); color: var(--tbw-white); }
.tbw-section.has-bg::before {
  content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.35);
}
.tbw-section.has-bg > * { position: relative; }
.tbw-section.has-bg { color: var(--tbw-white); }
.tbw-theme-bright h1, .tbw-theme-bright h2, .tbw-theme-bright h3, .tbw-theme-bright p { color: var(--tbw-white); }
.tbw-theme-bright p.tbw-statement { font-family: var(--tbw-display); text-transform: uppercase; font-size: clamp(1.6rem, 3.6vw, 2.9rem); line-height: 1.5; }
.tbw-wave { display: block; width: 100%; height: 60px; margin-bottom: -1px; }
.tbw-wave path { fill: var(--tbw-taupe); }

/* Single-wave divider with a cream line along its edge, as on the original home page.
   The wave is drawn at the bottom of a section in the colour of the section below it. */
.home .tbw-main > .tbw-section:has(+ .tbw-theme-bright),
.home .tbw-main > .tbw-theme-bright:has(+ .tbw-section) {
  padding-bottom: calc(clamp(40px, 7vw, 96px) + 6vw);
}
.home .tbw-main > .tbw-section:has(+ .tbw-theme-bright)::after,
.home .tbw-main > .tbw-theme-bright:has(+ .tbw-section)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 6vw;
  background: no-repeat center / 100% 100%;
}
.home .tbw-main > .tbw-section:has(+ .tbw-theme-bright)::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 10' preserveAspectRatio='none'%3E%3Cpath d='M0 7C35-3 65 13 100 3V10H0Z' fill='%239c8b7e'/%3E%3Cpath d='M0 7C35-3 65 13 100 3' fill='none' stroke='%23f2ece2' stroke-width='6' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
}
.home .tbw-main > .tbw-theme-bright:has(+ .tbw-section)::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 10' preserveAspectRatio='none'%3E%3Cpath d='M0 7C35-3 65 13 100 3V10H0Z' fill='%23d6d2cd'/%3E%3Cpath d='M0 7C35-3 65 13 100 3' fill='none' stroke='%23f2ece2' stroke-width='6' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
}

/* Home page "about" text above the photo row */
.home .tbw-main > .tbw-theme-bright > .tbw-section__inner > p {
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  line-height: 1.6;
  text-align: center;
  max-width: 1000px; margin: 0 auto 1.6em;
}
.tbw-card a.tbw-button:empty { display: none; }

.tbw-content-img { margin: 0 0 1.5em; }
.tbw-section h1:first-child, .tbw-section h3:first-child { text-align: center; }

/* Card grids (product summaries, carousels) */
/* auto-fit, not auto-fill: empty tracks would push the cards off-center. */
.tbw-grid {
  display: grid; gap: 28px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  margin: 0 0 2em;
}
/* Home page photo rows stay on one line on desktop, however many photos they hold. */
@media (min-width: 801px) {
  .home .tbw-grid { grid-auto-flow: column; grid-auto-columns: 1fr; grid-template-columns: none; }
}
@media (max-width: 800px) {
  .home .tbw-grid { grid-template-columns: repeat(2, 1fr); }
}
.tbw-card { position: relative; }
/* Tagline that sat in a small box over the photo on the original carousel */
.tbw-card > p:has(> span:only-child) {
  position: absolute; z-index: 1;
  top: 12px; left: 12px; right: 12px;
  margin: 0 auto; width: fit-content; padding: 4px 10px;
  background: var(--tbw-black); color: var(--tbw-white);
  font-size: .78rem; line-height: 1.35; text-align: center;
}
.tbw-card img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; margin-bottom: .75em; }
.tbw-card__title { color: var(--tbw-taupe); text-decoration: underline; text-underline-offset: 3px; display: block; }
.tbw-card__price { margin-top: .4em; font-size: .9rem; }
.tbw-card .tbw-content-img { margin: 0; }
.tbw-card p { margin: 0 0 .4em; }
.tbw-card p a { color: var(--tbw-taupe); text-underline-offset: 3px; }

/* Buttons */
.tbw-button, .wp-element-button, .woocommerce a.button, .woocommerce button.button,
.woocommerce input.button, .woocommerce #respond input#submit, .wpcf7-submit {
  display: inline-block;
  background: var(--tbw-taupe) !important; color: var(--tbw-white) !important;
  font-family: var(--tbw-body); font-size: 1.2rem; font-weight: 400;
  padding: 16px 52px; border: 0; border-radius: 999px !important; text-decoration: none; cursor: pointer;
}
.tbw-button:hover, .woocommerce a.button:hover, .woocommerce button.button:hover, .wpcf7-submit:hover { opacity: .85; }
.tbw-buttons { margin: 1.5em 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 18px; }
/* Taupe buttons vanish on the taupe section, so outline them in white there. */
.tbw-theme-bright .tbw-button { box-shadow: inset 0 0 0 2px var(--tbw-white); }

/* Forms */
.wpcf7 input[type=text], .wpcf7 input[type=email], .wpcf7 input[type=tel], .wpcf7 textarea,
.woocommerce form .input-text, .woocommerce select {
  width: 100%; padding: 14px 16px; border: 1px solid #ccc; background: #fff;
  font-family: var(--tbw-body); font-size: 1rem; border-radius: 0;
}
.wpcf7 label { display: block; margin-bottom: 14px; }
.wpcf7 .wpcf7-submit { margin-top: 22px; }

/* Contact page: text on the left, a compact form on the right, as on the original site. */
.page-contact .tbw-section--narrow .tbw-section__inner {
  max-width: var(--tbw-max);
  display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto auto auto auto 1fr;
  column-gap: clamp(32px, 8vw, 120px);
}
.page-contact .tbw-section__inner > :not(.wpcf7) { grid-column: 1; }
.page-contact .tbw-section__inner > .wpcf7 { grid-column: 2; grid-row: 1 / -1; }
.page-contact .tbw-section__inner > h2 { font-size: clamp(2.6rem, 5vw, 4.2rem); line-height: 1.05; text-align: left; }
@media (max-width: 800px) {
  .page-contact .tbw-section--narrow .tbw-section__inner { grid-template-columns: 1fr; grid-template-rows: none; }
  .page-contact .tbw-section__inner > .wpcf7 { grid-column: 1; grid-row: auto; margin-top: 24px; }
}
.page-contact .wpcf7 label { margin-bottom: 16px; font-size: 1.05rem; }
.page-contact .wpcf7 small { font-size: .78em; color: #555; margin-left: 2px; }
.page-contact .wpcf7-form-control-wrap { display: block; margin-top: 4px; }
.page-contact .tbw-name { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.page-contact .tbw-name legend { padding: 0; margin-bottom: 4px; font-size: 1.05rem; }
.page-contact .tbw-name label { font-size: .92rem; }
.page-contact .wpcf7 input[type=text], .page-contact .wpcf7 input[type=email], .page-contact .wpcf7 textarea {
  background: #f3f2f0; border: 1px solid #a9a6a2; padding: 10px 12px;
}
.page-contact .wpcf7 textarea { height: 100px; resize: vertical; }
.page-contact .wpcf7 .wpcf7-submit { margin-top: 4px; }

/* Footer */
.tbw-footer { background: var(--tbw-light); padding: 64px var(--tbw-gutter) 40px; font-size: 1.15rem; }
.tbw-footer__inner {
  max-width: var(--tbw-max); margin: 0 auto;
  display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.tbw-footer h4 { font-family: var(--tbw-body); text-transform: none; font-size: 1.2rem; margin-bottom: .5em; }
.tbw-footer ul { list-style: none; margin: 0; padding: 0; }
.tbw-footer li { margin-bottom: .3em; }
.tbw-footer a { text-decoration: none; }
.tbw-footer a:hover { text-decoration: underline; }
.tbw-footer .tbw-social { margin: .8em 0; }
.tbw-footer__signup {
  max-width: 560px; margin: 0 auto 56px; padding-bottom: 48px; text-align: center;
  border-bottom: 1px solid rgba(0, 0, 0, .12);
}
.tbw-footer__signup h4 { font-family: var(--tbw-display); text-transform: uppercase; font-size: 1.6rem; }
.tbw-footer__signup .wpcf7-form > p { margin: 0; position: relative; }
.tbw-footer__signup .wpcf7-spinner { position: absolute; margin: 38px 0 0 12px; }

/* WooCommerce */
.tbw-shop { max-width: var(--tbw-max); margin: 0 auto; padding: 48px var(--tbw-gutter) 80px; }
/* Categories run as a centered row above the products so the photos get the full width. */
.tbw-shop-layout { display: grid; grid-template-columns: 1fr; gap: 32px; }
.tbw-cat-nav ul {
  list-style: none; padding: 0 0 24px; margin: 0; border-bottom: 1px solid var(--tbw-light);
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 28px;
}
.tbw-cat-nav a { text-decoration: none; }
.tbw-cat-nav a:hover { color: var(--tbw-taupe); }
.tbw-cat-nav .current-cat > a { text-decoration: underline; text-underline-offset: 4px; }
.woocommerce ul.products { display: grid !important; gap: 40px 28px; grid-template-columns: repeat(4, 1fr); margin: 0 !important; }
@media (max-width: 1000px) { .woocommerce ul.products { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) { .woocommerce ul.products { grid-template-columns: repeat(2, 1fr); gap: 28px 16px; } }
.woocommerce ul.products::before, .woocommerce ul.products::after { display: none !important; }
.woocommerce ul.products li.product { width: auto !important; margin: 0 !important; float: none !important; }
.woocommerce ul.products li.product a img { aspect-ratio: 3 / 4; object-fit: cover; margin-bottom: .75em; }
.woocommerce ul.products li.product .woocommerce-loop-product__title {
  font-family: var(--tbw-body); text-transform: none; font-size: 1rem; padding: 0;
  color: var(--tbw-taupe); text-decoration: underline; text-underline-offset: 3px;
}
.woocommerce ul.products li.product .price { color: var(--tbw-black); font-size: .9rem; }
.woocommerce ul.products li.product .button { display: none; }
.woocommerce div.product .product_title { font-size: clamp(1.6rem, 3vw, 2.4rem); }
.woocommerce div.product p.price, .woocommerce div.product span.price { color: var(--tbw-black); font-size: 1.2rem; }
.woocommerce span.onsale { background: var(--tbw-taupe); }
.woocommerce .woocommerce-breadcrumb { font-size: .85rem; }
.woocommerce-store-notice, p.demo_store { background: var(--tbw-taupe); }
