/*
 * Bonjour Ben child theme overrides
 * Loaded after whisper-base.css so we can fill the gaps:
 *   - base.css expects markup the parent Storefront/WC doesn't produce,
 *   - and a few utility classes we use in our PHP templates.
 */

/* ---------- Reset / containers ---------- */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }

.visually-hidden {
  position: absolute !important; clip: rect(1px, 1px, 1px, 1px);
  width: 1px; height: 1px; overflow: hidden; white-space: nowrap;
}
.skip-link.visually-hidden:focus {
  position: absolute !important; clip: auto; width: auto; height: auto;
  top: 8px; left: 8px; padding: 8px 12px; background: #000; color: #fff; z-index: 9999;
}
.muted { color: rgba(0, 0, 0, 0.5); }

.section-inner,
.header-inner,
.footer-inner,
.product-page__inner,
.collection-page__inner,
.page-wrapper__inner {
  max-width: var(--container-width, 1440px);
  margin: 0 auto;
  padding: 0 24px;
}
.section-inner--narrow { max-width: 760px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: var(--color-background, #fff);
  border-bottom: 1px solid var(--color-border, #e2ded7);
}
.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding-top: 16px; padding-bottom: 16px;
}
.logo { display: inline-flex; align-items: center; text-decoration: none; font-family: var(--font-heading--family); font-weight: 700; font-size: 1.5rem; color: var(--color-foreground); }
.logo img { max-height: 36px; width: auto; }
.main-nav { display: flex; justify-content: center; }
.main-nav__list,
.main-nav ul {
  list-style: none; display: flex; gap: 28px; margin: 0; padding: 0;
  font-family: var(--font-body--family);
  font-size: 0.9375rem;
}
.main-nav a { text-decoration: none; color: var(--color-foreground); padding: 6px 0; border-bottom: 1px solid transparent; transition: border-color var(--animation-speed); }
.main-nav a:hover { border-color: var(--color-foreground); }
.header-actions { display: flex; gap: 16px; align-items: center; font-size: 0.9375rem; }
.header-action { text-decoration: none; color: var(--color-foreground); display: inline-flex; align-items: center; gap: 6px; }
.cart-link .cart-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  background: var(--color-foreground); color: var(--color-background);
  font-size: 0.75rem; font-weight: 600;
}
@media (max-width: 900px) {
  .header-inner { grid-template-columns: auto 1fr auto; gap: 12px; }
  .main-nav__list, .main-nav ul { gap: 14px; font-size: 0.875rem; flex-wrap: wrap; justify-content: flex-end; }
}
@media (max-width: 640px) {
  .main-nav { display: none; }
  .header-actions { gap: 10px; font-size: 0.875rem; }
}

/* ---------- Buttons ---------- */
.btn,
button.btn,
a.btn,
.button {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  padding: var(--button-padding-block, 14px) var(--button-padding-inline, 28px);
  border-radius: var(--button-radius, 37px);
  font-family: var(--font-body--family);
  font-size: 1rem; font-weight: 500;
  text-decoration: none; cursor: pointer;
  border: var(--button-border-width, 0) solid transparent;
  transition: background var(--animation-speed), color var(--animation-speed);
}
.btn-primary, .button.alt {
  background: var(--color-foreground);
  color: var(--color-background);
  border: 0;
}
.btn-primary:hover, .button.alt:hover {
  background: var(--color-primary-hover, #2a2a2a);
  color: var(--color-background);
}
.btn-secondary {
  background: var(--color-secondary-button-background, transparent);
  color: var(--color-secondary-button-text);
  border: 1px solid var(--color-secondary-button-border);
}
.btn-secondary:hover {
  background: var(--color-secondary-button-hover-background);
  border-color: var(--color-secondary-button-hover-border);
}
.link-arrow { color: var(--color-foreground); text-decoration: none; font-weight: 500; border-bottom: 1px solid currentColor; padding-bottom: 2px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 60vh;
  display: flex; align-items: stretch;
  background-color: #1f1c19;
  background-size: cover; background-position: center;
  color: #fff;
  margin-bottom: 0;
}
.hero--secondary {
  background-color: #2b2622;
  min-height: 50vh;
}
.hero__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.0) 0%, rgba(0,0,0,0.55) 100%);
  pointer-events: none;
}
.hero__inner {
  position: relative;
  max-width: var(--container-width, 1440px);
  margin: 0 auto;
  padding: 96px 24px 64px;
  width: 100%;
  display: flex; flex-direction: column; gap: 16px;
  justify-content: flex-end;
}
.hero__inner--left { align-items: flex-start; max-width: 720px; padding-right: 24px; }
.hero__eyebrow { font-size: 1.125rem; margin: 0; opacity: 0.92; }
.hero__title, .jumbo-text {
  font-family: var(--font-heading--family);
  font-weight: 700;
  font-size: clamp(2.75rem, 9vw, 7rem);
  line-height: 0.85;
  letter-spacing: -0.03em;
  margin: 0;
  color: #fff;
}
.hero--secondary .hero__title { font-size: clamp(2rem, 5vw, 4.5rem); line-height: 1; }
.hero__copy { font-size: 1.125rem; margin: 0; max-width: 36ch; opacity: 0.92; }
.hero .btn { align-self: flex-start; }

/* ---------- Sections ---------- */
section { padding: 64px 0; }
.featured-products, .collection-links { padding: 72px 0; }
.section-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 32px; gap: 16px; flex-wrap: wrap; }
.section-title { font-family: var(--font-heading--family); font-size: clamp(1.75rem, 3vw, 2.5rem); font-weight: 700; margin: 0; letter-spacing: -0.01em; }
.section-link { text-decoration: none; color: var(--color-foreground); border-bottom: 1px solid currentColor; padding-bottom: 2px; font-size: 0.9375rem; }

/* ---------- Pull quote ---------- */
.pull-quote { background: var(--color-hover, #f4f1ec); text-align: center; padding: 96px 0; }
.pull-quote__text {
  font-family: var(--font-body--family);
  font-size: clamp(1.125rem, 2vw, 1.5rem);
  line-height: 1.5;
  margin: 0 0 32px;
}

/* ---------- Product grid — Whisper-style with breathing room ---------- */
.product-grid,
ul.products,
.woocommerce ul.products {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (max-width: 1100px) {
  .product-grid, ul.products, .woocommerce ul.products {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}
@media (max-width: 600px) {
  .product-grid, ul.products, .woocommerce ul.products {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

/* Product card — make the image dominant */
.product-card,
ul.products li.product,
.woocommerce ul.products li.product {
  width: 100% !important;
  margin: 0 !important;
  float: none !important;
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  background: transparent;
  border: 0;
  text-align: left;
}
.product-card a { text-decoration: none; color: inherit; display: block; }
.product-card a img,
.product-card__image,
ul.products li.product a img,
ul.products li.product img.attachment-woocommerce_thumbnail,
ul.products li.product img.wp-post-image,
.woocommerce ul.products li.product a img {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
  margin: 0 0 12px;
  border-radius: 0;
  background: #f5f3ef;
}
.product-card__content { display: flex; flex-direction: column; gap: 4px; }
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.product-card .woocommerce-loop-product__title {
  font-family: var(--font-body--family);
  font-size: 16px;
  font-weight: 500;
  margin: 8px 0 4px;
  padding: 0;
  color: var(--color-text, var(--color-foreground, #0a1109));
  line-height: 1.3;
}
.woocommerce ul.products li.product .price,
.product-card .price {
  font-family: var(--font-body--family);
  font-size: 15px;
  font-weight: 400;
  color: var(--color-text-muted, #5a5a5a);
  margin: 0;
}
.woocommerce ul.products li.product .button {
  margin-top: 8px; align-self: flex-start; font-size: 0.875rem;
}

/* ---------- Collection links ---------- */
.collection-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 768px) {
  .collection-grid { grid-template-columns: repeat(2, 1fr); }
}
.collection-card {
  position: relative; display: flex; align-items: flex-end;
  aspect-ratio: 4/5;
  padding: 24px;
  background-color: var(--color-hover, #f4f1ec);
  background-size: cover; background-position: center;
  text-decoration: none; color: #fff;
  border-radius: 4px;
  overflow: hidden;
  transition: transform var(--animation-speed);
}
.collection-card:hover { transform: translateY(-2px); }
.collection-card__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.55) 100%);
}
.collection-card__label {
  position: relative; z-index: 1;
  font-family: var(--font-heading--family);
  font-size: 1.5rem; font-weight: 700;
  letter-spacing: -0.01em;
}

/* ---------- Single product page ---------- */
.product-page { padding: 32px 0 80px; }
.product-page__inner { display: block; }
.product.product-layout {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 48px;
  margin: 0 0 48px;
}
@media (max-width: 900px) {
  .product.product-layout { grid-template-columns: 1fr; gap: 24px; }
}
.product-layout__media,
.product-gallery { min-width: 0; }
.woocommerce-product-gallery {
  width: 100% !important;
  float: none !important;
  margin: 0 !important;
}
.woocommerce-product-gallery img { border-radius: 4px; }
.product-layout__summary,
.product-info {
  display: flex; flex-direction: column; gap: 16px;
  padding-top: 8px;
}
.product-info .product_title,
.product-layout__summary .product_title {
  font-family: var(--font-heading--family);
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.product-info .price,
.product-layout__summary .price {
  font-family: var(--font-body--family);
  font-size: 1.5rem; font-weight: 500; margin: 0;
}
.product-info .woocommerce-product-details__short-description {
  font-family: var(--font-body--family);
  font-size: 1rem; line-height: 1.6;
  color: rgba(10, 17, 9, 0.78);
}
.product-info .cart,
form.cart {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  margin: 16px 0 0;
}
.product-info table.variations,
form.cart table.variations {
  width: 100%; border-collapse: collapse; margin: 0 0 16px;
}
.product-info table.variations td,
form.cart table.variations td { padding: 6px 0; vertical-align: middle; }
.product-info table.variations select,
form.cart table.variations select,
form.cart .quantity input.qty {
  padding: 12px 14px;
  border: 1px solid var(--color-input-border);
  background: var(--color-input-background);
  border-radius: var(--style-border-radius-inputs, 8px);
  font-size: 1rem;
}
form.cart .quantity input.qty { width: 80px; }
form.cart .single_add_to_cart_button {
  background: var(--color-foreground);
  color: var(--color-background);
  border: 0;
  padding: 14px 28px;
  border-radius: var(--button-radius, 37px);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
}
form.cart .single_add_to_cart_button:hover { background: var(--color-primary-hover); }
.product_meta { font-size: 0.875rem; color: rgba(10, 17, 9, 0.65); margin-top: 24px; }
.product_meta > span { display: block; margin-bottom: 4px; }

/* WC tabs + related */
.product-layout__after { margin-top: 48px; }
.woocommerce-tabs ul.tabs.wc-tabs {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 24px; border-bottom: 1px solid var(--color-border);
}
.woocommerce-tabs ul.tabs.wc-tabs li { padding: 0 0 12px; border: 0; }
.woocommerce-tabs ul.tabs.wc-tabs li a { text-decoration: none; color: var(--color-foreground); font-weight: 500; }
.woocommerce-tabs ul.tabs.wc-tabs li.active a { border-bottom: 2px solid var(--color-foreground); padding-bottom: 12px; }
.woocommerce-tabs .panel { padding: 24px 0; font-size: 1rem; line-height: 1.6; }
.related.products, .upsells.products { margin-top: 48px; }
.related.products > h2, .upsells.products > h2 {
  font-family: var(--font-heading--family); font-size: 1.5rem; font-weight: 700; margin: 0 0 24px;
}

/* ---------- Collection / archive page ---------- */
.collection-page { padding: 40px 0 80px; }
.collection-page__header { margin-bottom: 32px; }
.collection-title,
.woocommerce-products-header__title {
  font-family: var(--font-heading--family);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}
.term-description { color: rgba(10, 17, 9, 0.7); max-width: 64ch; margin-top: 8px; }
.woocommerce-result-count { color: rgba(10, 17, 9, 0.6); font-size: 0.875rem; }
.woocommerce-ordering select {
  padding: 8px 12px; border: 1px solid var(--color-input-border);
  background: var(--color-input-background); border-radius: 8px;
}
.woocommerce-pagination { margin-top: 32px; }
.woocommerce-pagination ul.page-numbers {
  list-style: none; padding: 0; margin: 0; display: flex; gap: 8px;
}
.woocommerce-pagination .page-numbers {
  padding: 8px 12px; border: 1px solid var(--color-border);
  text-decoration: none; color: var(--color-foreground); border-radius: 4px;
}
.woocommerce-pagination .page-numbers.current {
  background: var(--color-foreground); color: var(--color-background);
}

/* ---------- Page wrapper ---------- */
.page-wrapper { padding: 56px 0 80px; }
.page-header { margin-bottom: 24px; }
.page-title { font-family: var(--font-heading--family); font-weight: 700; font-size: clamp(2rem, 4vw, 3rem); margin: 0; }
.page-content { font-size: 1.0625rem; line-height: 1.65; max-width: 72ch; }
.page-content h2 { font-size: 1.5rem; margin-top: 1.75em; }
.page-content p { margin: 0 0 1em; }

/* ---------- 404 ---------- */
.error-404 { min-height: 60vh; display: flex; align-items: center; justify-content: center; padding: 80px 24px; background: var(--color-hover, #f4f1ec); }
.error-404__inner { text-align: center; max-width: 520px; }
.error-404__eyebrow { font-family: var(--font-heading--family); font-size: 4rem; font-weight: 800; color: var(--color-foreground); margin: 0 0 8px; letter-spacing: -0.02em; }
.error-404__title { font-family: var(--font-heading--family); font-size: clamp(1.5rem, 3vw, 2.25rem); margin: 0 0 16px; }
.error-404__copy { margin: 0 0 24px; color: rgba(10, 17, 9, 0.7); }
.error-404__actions { display: inline-flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 0;
  background: #0a1109;
  color: rgba(255, 255, 255, 0.78);
  padding: 64px 0 32px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 48px;
}
@media (max-width: 720px) {
  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
}
.footer-heading { font-family: var(--font-heading--family); color: #fff; font-size: 1.125rem; font-weight: 700; margin: 0 0 12px; }
.footer-tagline { margin: 0; max-width: 32ch; opacity: 0.85; }
.footer-nav, .footer-social { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.footer-nav a, .footer-social a { color: #fff; text-decoration: none; opacity: 0.92; }
.footer-nav a:hover, .footer-social a:hover { opacity: 1; text-decoration: underline; }
.footer-bottom {
  max-width: var(--container-width, 1440px);
  margin: 32px auto 0;
  padding: 24px 24px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.875rem;
}

/* ---------- Forms (WC misc) ---------- */
.woocommerce-notices-wrapper { margin: 16px 0; }
.woocommerce-message, .woocommerce-info, .woocommerce-error {
  padding: 12px 16px; border-radius: 8px;
  background: var(--color-hover, #f4f1ec);
  border: 1px solid var(--color-border);
  list-style: none;
}
.woocommerce-message { border-left: 3px solid var(--color-success, #2a8a2a); }
.woocommerce-error { border-left: 3px solid var(--color-error, #d33); }

/* Hide Storefront's default page wrapper if it leaks in */
.storefront-handheld-footer-bar { display: none !important; }

/* ---------- Site logo (custom_logo) ---------- */
.site-branding .custom-logo-link { display: inline-block; }
.site-branding .custom-logo {
  max-height: 56px;
  width: auto;
  display: block;
}
@media (max-width: 768px) {
  .site-branding .custom-logo { max-height: 40px; }
}
