/*
Theme Name: Petal & Forge
Theme URI: https://petalandforge.co.uk
Author: Petal & Forge
Description: Custom WooCommerce theme for Petal & Forge, a handcrafted wellness store. Ported from the original static design mockups.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 7.4
Tested up to: 6.6
WC requires at least: 8.0
WC tested up to: 9.0
Text Domain: petal-and-forge
*/
/* ================================
   Design tokens (ported from the mockups)
   ================================ */
:root {
  --color-primary: #743D3D;
  --color-primary-dark: #4A2424;
  --color-blush: #E3B9BA;
  --color-sage: #8CAF8F;
  --color-tan: #E6D2C3;
  --color-cream: #FAF4E9;
  --color-white: #FFFFFF;
  --color-text: #34201D;
  --color-muted: #74584C;
  --color-border: rgba(116, 61, 61, 0.15);
  --color-focus: #3D6B8C;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-md: 1.625rem;
  --text-lg: 2.625rem;
  --text-xl: 3rem;
  --space-1: 0.5rem;
  --space-2: 0.8125rem;
  --space-3: 1.3125rem;
  --space-4: 2.125rem;
  --space-5: 3.4375rem;
  --space-6: 5.5625rem;
  --radius: 4px;
  --radius-lg: 12px;
  --container: 1200px;
  --pattern-light: radial-gradient(circle at 10px 10px, rgba(116,61,61,0.06) 1.5px, transparent 1.6px);
  --pattern-dark: radial-gradient(circle at 10px 10px, rgba(255,255,255,0.05) 1.5px, transparent 1.6px);
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--color-cream);
  color: var(--color-text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .brand-font {
font-family: 'Bodoni Moda', serif;
  font-weight: 600;
  color: var(--color-primary-dark);
  margin: 0;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; background: none; border: none; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--space-3); }
/* ---------- accessibility helpers ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.skip-link { position: absolute; left: var(--space-2); top: -48px; background: var(--color-primary-dark); color: var(--color-white); padding: var(--space-1) var(--space-3); border-radius: var(--radius); font-size: var(--text-sm); z-index: 100; transition: top 0.15s ease; }
.skip-link:focus { top: var(--space-2); }
a:focus-visible, button:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; border-radius: var(--radius); }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
/* ---------- logo ---------- */
.logo-lockup { display: flex; align-items: center; gap: var(--space-2); }
.logo-word { font-size: 1.25rem; letter-spacing: 0.01em; white-space: nowrap; }
.logo-badge { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--color-primary); display: flex; align-items: center; justify-content: center; font-family: 'Playfair Display', serif; font-weight: 600; font-size: 0.9rem; color: var(--color-primary); flex-shrink: 0; }
.logo-stacked {
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.logo-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
}
.logo-mobile .logo-image {
  height: 90px;
  width: auto;
}
/* ---------- promo banner (scrolling marquee) ---------- */
.promo-banner {
  background: var(--color-primary);
  color: var(--color-white);
  overflow: hidden;
  white-space: nowrap;
  padding: var(--space-1) 0;
}
.promo-banner-track {
  display: inline-flex;
  animation: promo-marquee 14s linear infinite;
}
.promo-banner p {
  margin: 0;
  padding-right: 4rem;
  font-size: var(--text-sm);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
@keyframes promo-marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 30; background: var(--color-white); border-bottom: 1px solid var(--color-border); }
.header-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--space-2); padding-top: var(--space-2); padding-bottom: var(--space-2); }
.header-start { display: flex; align-items: center; justify-content: flex-start; }
.header-center { display: flex; align-items: center; justify-content: center; }
.header-end { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-2); }
.icon-btn { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 1.2rem; color: var(--color-primary-dark); }
.icon-btn:hover { background: var(--color-cream); }
.basket-btn { position: relative; width: 44px; height: 44px; border: 1px solid var(--color-primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; color: var(--color-primary-dark); }
.basket-count { position: absolute; top: -6px; right: -6px; background: var(--color-primary); color: var(--color-white); font-size: 0.65rem; font-weight: 600; border-radius: 50%; width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; }
.logo-desktop { display: none; }
.logo-mobile { display: flex; }
.nav-links ul { display: none; gap: var(--space-4); font-size: var(--text-sm); letter-spacing: 0.02em; list-style: none; margin: 0; padding: 0; }
.nav-links li { display: inline; }
.nav-links a { padding: var(--space-1) 0; border-bottom: 1px solid transparent; }
.nav-links a:hover, .nav-links .current-menu-item a { border-color: var(--color-primary); color: var(--color-primary); }
.nav-links li::before {
  content: '\00B7';
  display: inline-block;
  margin-right: var(--space-2);
  color: var(--color-muted);
  font-size: 1.8em;
}
.nav-links li:last-child::after {
  content: '\00B7';
  display: inline-block;
  margin-left: var(--space-2);
  color: var(--color-muted);
  font-size: 1.8em;
}
.search-toggle { display: none; }
.nav-drawer { display: none; border-top: 1px solid var(--color-border); background: var(--color-white); padding: var(--space-3); }
.nav-drawer.open { display: block; }
.nav-drawer .drawer-search { display: flex; align-items: center; gap: var(--space-1); border: 1px solid var(--color-border); border-radius: 999px; padding: var(--space-1) var(--space-3); margin-bottom: var(--space-3); }
.nav-drawer .drawer-search input { border: none; outline: none; flex: 1; font-size: 16px; background: transparent; color: var(--color-text); }
.nav-drawer nav ul { display: flex; flex-direction: column; gap: var(--space-2); list-style: none; margin: 0; padding: 0; }
.nav-drawer nav a { font-size: 1rem; padding: var(--space-1) 0; }
.search-field { display: none; align-items: center; gap: var(--space-1); border: 1px solid var(--color-border); border-radius: 999px; padding: 6px var(--space-2); background: var(--color-cream); }
.search-field.open { display: flex; }
.search-field input { border: none; outline: none; background: transparent; font-size: 16px; width: 160px; color: var(--color-text); }
.search-field form, .drawer-search form { display: contents; }
/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-1); padding: var(--space-2) var(--space-4); border-radius: var(--radius); font-size: var(--text-sm); letter-spacing: 0.03em; border: 1px solid var(--color-primary); }
.btn-primary { background: var(--color-primary); color: var(--color-white); }
.btn-primary:hover { background: var(--color-primary-dark); }
/* ---------- hero / sections / tiles / policy / quotes (unchanged from mockup) ---------- */
.hero { background: var(--color-cream); background-image: var(--pattern-light); padding: var(--space-5) 0; }
.hero .container { display: flex; flex-direction: column; gap: var(--space-4); }
.hero-copy { max-width: 480px; }
.hero-eyebrow { font-size: var(--text-sm); text-transform: uppercase; letter-spacing: 0.12em; color: var(--color-muted); margin-bottom: var(--space-2); }
.hero-copy h1 { font-size: var(--text-xl); line-height: 1.15; margin-bottom: var(--space-3); }
.hero-copy p { color: var(--color-muted); margin-bottom: var(--space-4); max-width: 40ch; }
.hero-image {
  aspect-ratio: 1084/806;
  background: transparent;
  border-radius: var(--radius-lg);
  overflow: hidden;
  width: 100%;
  margin: 0 auto;
  align-self: center;
}
.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-lg);
  display: block;
}
/* Tablet and desktop: shrink to 75% and keep it centred in the section */
@media (min-width: 768px) {
  .hero-image {
    width: 75%;
  }
}

.section { padding: var(--space-5) 0; }
.section-heading { text-align: center; margin-bottom: var(--space-4); }
.section-heading.left { text-align: left; }
.section-heading h2 { font-size: var(--text-lg); margin-bottom: var(--space-2); }
.section-heading p { color: var(--color-muted); margin: 0; }
.category-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
.category-tile { border-radius: var(--radius-lg); padding: var(--space-4) var(--space-2); display: flex; flex-direction: column; align-items: center; gap: var(--space-2); text-align: center; color: var(--color-primary-dark); border: 1px solid var(--color-border); }
.category-tile .tile-icon { width: 48px; height: 48px; border-radius: 50%; background: var(--color-white); display: flex; align-items: center; justify-content: center; font-size: 1.3rem; }
.category-tile span { font-family: 'Playfair Display', serif; font-size: 1rem; }
.tile-collections { background: var(--color-blush); }
.tile-skincare { background: var(--color-sage); }
.tile-scents { background: var(--color-tan); }
.tile-wellness { background: var(--color-cream); }
.carousel-wrap { position: relative; }
.carousel-track { display: flex; gap: var(--space-3); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: var(--space-1); scrollbar-width: none; }
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track .product-card { min-width: 200px; scroll-snap-align: start; }
.carousel-arrow { position: absolute; top: 40%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; background: var(--color-white); border: 1px solid var(--color-border); display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 4px rgba(52,32,29,0.12); z-index: 2; }
.carousel-arrow.prev { left: -8px; }
.carousel-arrow.next { right: -8px; }
.category-block { padding: var(--space-4) 0; border-bottom: 1px solid var(--color-border); }
.category-block:last-of-type { border-bottom: none; }
.category-block .block-heading { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: var(--space-3); }
.category-block .block-heading h2 { font-size: 1.4rem; }
.category-block .block-heading a { font-size: var(--text-sm); color: var(--color-primary); }
.quote-panel { background: var(--color-cream); background-image: var(--pattern-light); border-radius: var(--radius-lg); padding: var(--space-4); text-align: center; margin: var(--space-4) 0; }
.quote-panel p { font-family: 'Playfair Display', serif; font-style: italic; font-weight: 400; font-size: 1.15rem; color: var(--color-muted); max-width: 42ch; margin: 0 auto; line-height: 1.5; }
.policy-banner { background: var(--color-white); border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); }
.policy-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-3); padding: var(--space-4) 0; }
.policy-item { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-1); }
.policy-item .policy-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--color-cream); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; color: var(--color-primary); }
.policy-item h3 { font-size: 0.95rem; }
.policy-item p { font-size: 0.8rem; color: var(--color-muted); margin: 0; max-width: 22ch; }
.breadcrumb { font-size: var(--text-sm); color: var(--color-muted); padding: var(--space-3) 0; }
.breadcrumb a:hover { color: var(--color-primary); }
.pf-note { font-size: var(--text-sm); color: var(--color-muted); }
/* ================================
   Generic page content (legal pages etc.)
   Widens out the reading column and improves line-height for
   long-form text like the Privacy Policy, Terms and Conditions,
   and Return & Refund Policy pages.
   ================================ */
.page .entry-content,
.page article,
.page-content {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-5) var(--space-4);
  line-height: 1.8;
}
@media (min-width: 768px) {
  .page .entry-content,
  .page article,
  .page-content {
    padding: var(--space-6) var(--space-5);
  }
}
.page .entry-content h1,
.page article h1,
.page-content h1 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-4);
  line-height: 1.25;
}
.page .entry-content h2,
.page article h2,
.page-content h2 {
  font-size: 1.5rem;
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
  line-height: 1.3;
}
.page .entry-content h3,
.page article h3,
.page-content h3 {
  font-size: 1.2rem;
  margin-top: var(--space-5);
  margin-bottom: var(--space-2);
}
.page .entry-content p,
.page article p,
.page-content p {
  margin-bottom: var(--space-3);
  color: var(--color-text);
  font-size: 1.05rem;
}
.page .entry-content ul,
.page .entry-content ol,
.page article ul,
.page article ol,
.page-content ul,
.page-content ol {
  margin: 0 0 var(--space-4) 0;
  padding-left: 1.6rem;
}
.page .entry-content li,
.page article li,
.page-content li {
  margin-bottom: var(--space-2);
  line-height: 1.7;
}
.page .entry-content a,
.page article a,
.page-content a {
  color: var(--color-primary);
  text-decoration: underline;
}
.page .entry-content address,
.page article address,
.page-content address {
  font-style: normal;
  line-height: 1.8;
  margin-bottom: var(--space-3);
}
.page .entry-content strong,
.page article strong,
.page-content strong {
  color: var(--color-primary-dark);
}
/* ---------- footer ---------- */
.site-footer { background: var(--color-primary-dark); background-image: var(--pattern-dark); color: var(--color-cream); padding: var(--space-5) 0 var(--space-4); margin-top: var(--space-6); }
.site-footer .container { display: grid; grid-template-columns: 1fr; gap: var(--space-4); }
.site-footer h3 { color: var(--color-white); font-size: var(--text-base); margin-bottom: var(--space-2); }
.site-footer p, .site-footer a { color: rgba(250,244,233,0.8); font-size: var(--text-sm); }
.footer-bottom { text-align: center; font-size: 0.75rem; color: rgba(250,244,233,0.55); margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid rgba(250,244,233,0.15); }
/* ================================
   WooCommerce native output, reskinned
   These target WooCommerce's real generated markup (product loops,
   single product, cart) rather than static mockup classes, since
   that's what actually renders on a live WooCommerce site.
   ================================ */
.products {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-4);
  list-style: none;
  margin: 0;
  padding: 0;
}
/* Mobile: 2 per row */
.products .product {
  flex: 0 0 calc(50% - (var(--space-4) / 2));
  max-width: calc(50% - (var(--space-4) / 2));
}
/* Tablet: 3 per row */
@media (min-width: 768px) {
  .products .product {
    flex: 0 0 calc(33.333% - (var(--space-4) * 2 / 3));
    max-width: calc(33.333% - (var(--space-4) * 2 / 3));
  }
}
/* Desktop: 4 per row */
@media (min-width: 1024px) {
  .products .product {
    flex: 0 0 calc(25% - (var(--space-4) * 3 / 4));
    max-width: calc(25% - (var(--space-4) * 3 / 4));
  }
}
/* ----------------------------------------------------------------
   Category page sub-sections (e.g. Scents > Pillow Spray, Room
   Sprays, Wax Melts): centred, responsive grid of their own -
   1 per row on mobile, 2 on tablet, 3 on desktop. These groups
   often contain just 1-4 products, so a lone leftover card needs to
   centre cleanly at every breakpoint rather than sit flush-left.
   Higher specificity (3 classes) than the shop-page grid rules
   above, so this wins at every breakpoint without touching the
   main Shop page's own grid (which isn't inside a .category-block).
   ---------------------------------------------------------------- */
.category-block .products {
  justify-content: center;
}
/* Mobile: 1 per row */
.category-block .products .product {
  flex: 0 0 100%;
  max-width: 420px;
}
/* Tablet: 2 per row */
@media (min-width: 768px) {
  .category-block .products .product {
    flex: 0 0 calc(50% - (var(--space-4) / 2));
    max-width: calc(50% - (var(--space-4) / 2));
  }
}
/* Desktop: 3 per row */
@media (min-width: 1024px) {
  .category-block .products .product {
    flex: 0 0 calc(33.333% - (var(--space-4) * 2 / 3));
    max-width: calc(33.333% - (var(--space-4) * 2 / 3));
  }
}
/* ----------------------------------------------------------------
   Homepage "Our favourites" carousel override
   This element renders as <ul class="products carousel-track">, so it
   picks up the shop-grid rules above (which force flex-wrap: wrap and
   fixed 50%/33%/25% widths). That fights with the carousel's intended
   single-row horizontal scroll, causing cards to wrap one-per-line on
   narrow screens instead of scrolling sideways. This override has
   higher specificity (two classes) so it wins automatically and
   restores the scrollable single row, without affecting the plain
   shop/category grid (which doesn't have the carousel-track class).
   ---------------------------------------------------------------- */
.products.carousel-track {
  flex-wrap: nowrap;
  justify-content: flex-start;
}
.products.carousel-track .product {
  flex: 0 0 200px;
  max-width: 200px;
}
li.product-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
  list-style: none;
}
.product-image { position: relative; aspect-ratio: 1/1.272; background: var(--color-cream); overflow: hidden; }
.product-image img { width: 100%; height: 100%; object-fit: cover; }
.product-image a.add_to_cart_button,
.product-image a.added_to_cart {
  position: absolute; top: var(--space-2); right: var(--space-2);
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--color-white); border: 1px solid var(--color-primary); color: var(--color-primary-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 0;
  box-shadow: 0 1px 3px rgba(52,32,29,0.15);
}
.product-image a.add_to_cart_button::before { content: '+'; font-size: 1rem; }
.product-image a.added_to_cart::before { content: '\2713'; font-size: 1rem; }
.product-info { padding: var(--space-3); }
.product-info .category-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-muted); margin-bottom: 4px; display: block; }
.product-info .category-label a { color: var(--color-muted); }
.product-info h3 { font-size: 1.05rem; margin-bottom: var(--space-1); font-weight: 600; }
.product-info .price { color: var(--color-primary-dark); font-weight: 600; }
.product-info .price del { color: var(--color-muted); font-weight: 400; margin-right: 4px; }
/* single product page */
.woocommerce div.product { max-width: var(--container); margin: 0 auto; padding: var(--space-4) var(--space-3); display: grid; grid-template-columns: 1fr; gap: var(--space-4); }
@media (min-width: 860px) { .woocommerce div.product { grid-template-columns: 1fr 1fr; } }
.woocommerce div.product .woocommerce-product-gallery { background: var(--color-cream); border-radius: var(--radius-lg); overflow: hidden; }
.woocommerce div.product .summary { }
.woocommerce div.product .product_title { font-size: var(--text-lg); margin-bottom: var(--space-2); }
.woocommerce div.product p.price { font-size: 1.4rem; color: var(--color-primary-dark); font-weight: 600; margin-bottom: var(--space-3); }
.woocommerce div.product .woocommerce-product-details__short-description { color: var(--color-text); margin-bottom: var(--space-4); max-width: 60ch; }
.woocommerce div.product form.cart { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-3); }
.woocommerce div.product form.cart .quantity { border: 1px solid var(--color-border); border-radius: var(--radius); }
.woocommerce div.product form.cart .quantity input.qty { border: none; width: 48px; height: 44px; text-align: center; background: transparent; }
.woocommerce div.product .single_add_to_cart_button { background: var(--color-primary); color: var(--color-white); border-radius: var(--radius); padding: var(--space-2) var(--space-4); border: 1px solid var(--color-primary); flex: 1; }
.woocommerce div.product .single_add_to_cart_button:hover { background: var(--color-primary-dark); }
.woocommerce div.product .related.products { margin-top: var(--space-5); grid-column: 1 / -1; }
.woocommerce div.product .related.products h2 { font-size: var(--text-lg); text-align: center; margin-bottom: var(--space-4); }
/* cart page (classic [woocommerce_cart] shortcode markup) */
.woocommerce-cart .container { padding-top: var(--space-4); padding-bottom: var(--space-5); }
table.shop_table { width: 100%; border-collapse: collapse; }
table.shop_table th { text-align: left; font-size: var(--text-sm); color: var(--color-muted); padding: var(--space-2) 0; border-bottom: 1px solid var(--color-border); }
table.shop_table td { padding: var(--space-2) 0; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
table.shop_table td.product-thumbnail img { width: 64px; border-radius: var(--radius); background: var(--color-cream); }
table.shop_table td.product-quantity input.qty { width: 48px; height: 36px; border: 1px solid var(--color-border); border-radius: var(--radius); text-align: center; }
table.shop_table .actions .button { background: var(--color-primary); color: var(--color-white); border-radius: var(--radius); padding: var(--space-2) var(--space-4); }
.cart-collaterals .cart_totals { background: var(--color-cream); border-radius: var(--radius-lg); padding: var(--space-4); max-width: 420px; margin-left: auto; }
.cart-collaterals .cart_totals table { width: 100%; }
.cart-collaterals .cart_totals tr td, .cart-collaterals .cart_totals tr th { border: none; padding: var(--space-1) 0; }
.cart-collaterals .cart_totals .order-total { font-weight: 600; font-size: 1.1rem; border-top: 1px solid var(--color-border); }
.wc-proceed-to-checkout a.checkout-button { display: block; text-align: center; background: var(--color-primary); color: var(--color-white); border-radius: var(--radius); padding: var(--space-2); margin-top: var(--space-3); }
@media (min-width: 1024px) {
  .header-row { grid-template-columns: auto 1fr auto; }
  .header-start .menu-toggle { display: none; }
  .header-start .logo-desktop { display: flex; }
  .header-center .logo-mobile { display: none; }
  .header-center .nav-links ul { display: flex; }
  .header-end .search-toggle { display: flex; }
  .nav-drawer { display: none !important; }
}