/*
Theme Name: Bathroom Mega Store
Description: Storefront child theme for bathroommegastore.com.au. Monochrome showroom design after the brand's GoDaddy reference page (Playfair Display / Source Sans / Montserrat, near-black + hairline grays, 50px rule device, brushed-brass accent).
Author: Bathroom Mega Store
Template: storefront
Version: 2.0.0
*/

:root {
  --bms-ink: #1b1b1b; /* reference rgb(27,27,27) */
  --bms-black: #111111;
  --bms-gray: #969696; /* reference muted text */
  --bms-silver: #ababab; /* reference footer text rgb(171,171,171) */
  --bms-line: #e2e2e2; /* reference rgb(226,226,226) */
  --bms-mist: #f6f6f5;
  --bms-paper: #ffffff;
  --bms-brass: #a8843c; /* single accent: brushed tapware brass */
  --bms-brass-dark: #8c6d30;

  --bms-serif: "Playfair Display", Georgia, serif;
  --bms-sans:
    "Source Sans 3", "Source Sans Pro", -apple-system, "Segoe UI", Roboto,
    Arial, sans-serif;
  --bms-mono-caps: "Montserrat", "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Base ---------- */
body {
  font-family: var(--bms-sans);
  color: var(--bms-ink);
  background: var(--bms-paper);
  font-size: 1.05rem;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--bms-serif);
  color: var(--bms-ink);
  font-weight: 700;
  letter-spacing: 0;
}
a {
  color: var(--bms-ink);
}
a:hover {
  color: var(--bms-brass-dark);
}

/* The reference's signature device: a 50px x 2px rule */
.bms-rule {
  display: block;
  width: 50px;
  height: 2px;
  background: var(--bms-ink);
  margin: 24px auto 0;
}

/* ---------- Header ---------- */
.site-header {
  background-color: var(--bms-paper) !important;
  border-bottom: 1px solid var(--bms-line);
  padding-top: 0;
}
.site-branding .site-title {
  font-family: var(--bms-mono-caps);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 1.35em;
}
.site-branding .site-title a,
.site-branding .site-title a:hover {
  color: var(--bms-ink) !important;
  text-decoration: none;
}
.site-description {
  display: none; /* wordmark only, as on the reference page */
}

/* Primary navigation */
.storefront-primary-navigation {
  background-color: var(--bms-paper);
  border-bottom: 1px solid var(--bms-line);
}
.main-navigation ul li a,
ul.menu li a {
  font-family: var(--bms-mono-caps);
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  color: var(--bms-ink);
}
.main-navigation ul li a:hover,
.main-navigation ul li.current-menu-item > a {
  color: var(--bms-gray);
}
.main-navigation ul.sub-menu {
  background-color: var(--bms-paper);
  border: 1px solid var(--bms-line);
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  width: max-content; /* size the panel to its longest label... */
  min-width: 220px;
  max-width: 320px; /* ...but never wider than this */
}
.main-navigation ul.sub-menu li a {
  color: var(--bms-ink);
  width: 100%; /* Storefront hard-codes 200px; fill the panel instead */
  box-sizing: border-box;
  white-space: normal; /* allow wrapping if a label ever exceeds the cap */
}

/* Header cart + search */
.site-header-cart .cart-contents,
.site-header-cart .cart-contents:hover {
  color: var(--bms-ink);
}
/* Mini-cart dropdown: panel look; Storefront hides it at left:-999em and
   reveals on hover/focus, so position it ONLY in the revealed states */
.site-header-cart .widget_shopping_cart {
  width: 360px;
  background: var(--bms-paper);
  border: 1px solid var(--bms-line);
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}
.site-header-cart:hover .widget_shopping_cart,
.site-header-cart.focus .widget_shopping_cart {
  left: auto;
  right: 0;
}
/* The cart wrapper is a ul.menu — undo the nav typography inside the panel */
.site-header-cart .widget_shopping_cart li a,
.site-header-cart .widget_shopping_cart a:not(.button) {
  font-family: var(--bms-sans);
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  white-space: normal;
}

/* Single-row header: branding, search, account, cart — one flex line,
   vertically centred, tight. Selector strength matches Storefront's grid. */
@media (min-width: 768px) {
  .site-header > .col-full {
    display: flex;
    align-items: center;
    gap: 2em;
    padding-top: 1.1em;
    padding-bottom: 1.1em;
    max-width: 80%;
  }
  .site-header .site-branding {
    float: none;
    margin: 0;
    flex: 1 1 auto;
  }
  .site-header .site-search {
    float: none;
    width: 320px;
    margin: 0;
    flex: 0 0 auto;
  }
  .site-header .site-search .widget,
  .site-header .site-search form {
    margin: 0;
  }
  .site-header .bms-account-link {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
  }
  .woocommerce-active .site-header .site-header-cart,
  .site-header .site-header-cart {
    float: none;
    clear: none;
    width: auto;
    margin: 0;
    position: relative;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
  }
  .site-header .site-header-cart li {
    display: flex;
    align-items: center;
    margin: 0;
  }
  .site-header-cart .cart-contents {
    display: inline-flex;
    align-items: center;
    gap: 0.55em;
    padding: 0;
    font-family: var(--bms-mono-caps);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    line-height: 1;
  }
  .site-header-cart .cart-contents .amount {
    margin-right: 0;
  }
  .site-header-cart .cart-contents .count {
    font-size: 1em;
  }
  .site-header-cart .cart-contents::after {
    float: none;
    margin: 0;
    line-height: 1;
  }
  .bms-account-link a {
    line-height: 1;
  }
  .main-navigation ul.menu > li > a {
    padding-left: 0.9em;
    padding-right: 0.9em;
  }
  /* Storefront reserves 26% of this row for the cart we relocated —
     give the nav the full width so all buttons fit one line.
     Selector must out-rank .woocommerce-active .site-header .main-navigation. */
  .woocommerce-active
    .site-header
    .storefront-primary-navigation
    .main-navigation {
    width: 100%;
    margin-right: 0;
  }
}
.site-header .widget_product_search input[type="search"],
.widget_product_search input[type="search"] {
  border: 1px solid var(--bms-line);
  border-radius: 4px;
  background: var(--bms-paper);
  font-family: var(--bms-sans);
}
.site-header .widget_product_search input[type="search"]:focus {
  outline: none;
  border-color: var(--bms-ink);
  box-shadow: inset 0 0 0 1px var(--bms-ink);
}

/* ---------- Account link ---------- */
.bms-account-link a {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  font-family: var(--bms-mono-caps);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--bms-ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  white-space: nowrap;
}
.bms-account-link a:hover {
  color: var(--bms-ink);
  border-bottom-color: var(--bms-ink);
}
.bms-account-icon {
  width: 1.15em;
  height: 1.15em;
  fill: currentColor;
}

/* ---------- Login / register (My Account, logged out) ---------- */
.woocommerce-account .u-column1,
.woocommerce-account .u-column2 {
  border: 1px solid var(--bms-line);
  border-radius: 4px;
  padding: 2em 2.2em 2.4em;
}
.woocommerce-account .u-column1 h2,
.woocommerce-account .u-column2 h2 {
  font-family: var(--bms-serif);
  text-align: center;
  position: relative;
  padding-bottom: 22px;
  margin-bottom: 1.2em;
}
.woocommerce-account .u-column1 h2::after,
.woocommerce-account .u-column2 h2::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 50px;
  height: 2px;
  background: var(--bms-ink);
}
.woocommerce-form-login .woocommerce-form-login__submit,
.woocommerce-form-register .woocommerce-form-register__submit {
  width: 100%;
  margin-top: 0.5em;
}
.woocommerce-LostPassword {
  text-align: center;
  font-size: 0.92em;
}
.bms-register-closed p,
.bms-reset-closed p {
  color: var(--bms-muted);
  text-align: center;
  max-width: 30em;
  margin-left: auto;
  margin-right: auto;
}
.bms-reset-closed {
  border: 1px solid var(--bms-line);
  border-radius: 4px;
  padding: 2em 2.2em 2.4em;
  max-width: 34em;
  margin: 0 auto;
}
.bms-reset-closed h2 {
  font-family: var(--bms-serif);
  text-align: center;
  position: relative;
  padding-bottom: 22px;
  margin-bottom: 1.2em;
}
.bms-reset-closed h2::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 50px;
  height: 2px;
  background: var(--bms-ink);
}

/* ---------- Buttons ---------- */
.button,
button,
input[type="button"],
input[type="submit"],
.woocommerce #respond input#submit,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.added_to_cart,
.widget a.button {
  background-color: var(--bms-ink) !important;
  border: 1px solid var(--bms-ink) !important;
  color: #fff !important;
  border-radius: 4px;
  font-family: var(--bms-mono-caps);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding-top: 0.9em;
  padding-bottom: 0.9em;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}
.button:hover,
button:hover,
input[type="submit"]:hover,
.woocommerce a.button:hover,
.added_to_cart:hover {
  background-color: var(--bms-black) !important;
  border-color: var(--bms-black) !important;
}
.button.alt,
.woocommerce a.button.alt,
.woocommerce button.button.alt,
.wc-proceed-to-checkout a.checkout-button {
  background-color: var(--bms-ink) !important;
  border-color: var(--bms-ink) !important;
}
/* Ghost button — reference's outlined-on-dark treatment */
.button.bms-ghost {
  background: transparent !important;
  border: 1px solid #fff !important;
  color: #fff !important;
}
.button.bms-ghost:hover {
  background: #fff !important;
  color: var(--bms-ink) !important;
}

/* ---------- Hero (homepage) ---------- */
/* Full-bleed image band; the dark text panel floats centered on top of it */
.bms-hero {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  background: url("assets/hero.webp") center 45% / cover no-repeat;
  color: #fff;
  padding: 5em 2em;
  margin-bottom: 3.5em;
  text-align: center;
}
body.page-template-template-homepage {
  overflow-x: hidden;
} /* 100vw breakout vs scrollbar */
.bms-hero > .col-full {
  background: rgba(15, 15, 15, 0.85);
  max-width: 56em;
  margin: 0 auto;
  padding: 4em 3em 4.5em;
}
.bms-hero h1 {
  color: #fff;
  font-family: var(--bms-serif);
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 0;
}
.bms-hero h1 em {
  font-style: italic;
  font-weight: 400;
}
.bms-hero .bms-rule {
  background: var(--bms-brass);
}
.bms-hero p {
  color: var(--bms-line);
  font-family: var(--bms-sans);
  font-size: 1.1rem;
  max-width: 36em;
  margin: 1.6em auto 2.2em;
}
.bms-hero .button.bms-hero-cta {
  font-size: 0.82rem;
  padding: 1em 2.6em;
}

/* Hide the empty "Home" page title/content on the homepage template */
.page-template-template-homepage .type-page > .entry-header {
  display: none;
}

/* ---------- Product grid ---------- */
/* CSS grid replaces Storefront's floats: every tile in a row stretches to the
   row height, so cards stay uniform regardless of title length. */
ul.products {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.8em 1.25em;
  width: 100%;
}
ul.products.columns-4 {
  grid-template-columns: repeat(4, 1fr);
}
ul.products.columns-2 {
  grid-template-columns: repeat(2, 1fr);
}
/* WooCommerce clearfix pseudo-elements become grid items and steal the first
   cell, shifting every card by one — remove them under grid */
ul.products::before,
ul.products::after {
  display: none;
}
@media (max-width: 767px) {
  ul.products,
  ul.products.columns-3,
  ul.products.columns-4 {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25em 0.9em;
  }
}
/* !important: Storefront sets per-column widths (e.g. ul.products.columns-4
   li.product { width: 20.75% }) at higher specificity — under grid the cell
   defines the width, so force cards to fill it. */
ul.products li.product,
ul.products li.product.first,
ul.products li.product.last {
  width: 100% !important;
  float: none !important;
  margin: 0 !important;
  display: flex;
  flex-direction: column;
}
ul.products li.product > .woocommerce-LoopProduct-link {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
/* Reserve two title lines and clamp longer names */
ul.products li.product .woocommerce-loop-product__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
  min-height: 2.8em;
}
/* Pin the price (and anything after it) to the card bottom */
ul.products li.product .price {
  margin-top: auto;
  padding-top: 0.5em;
}
ul.products li.product .button {
  align-self: flex-start;
  margin-top: 0.6em;
}
ul.products li.product {
  background: var(--bms-paper);
  border: 1px solid var(--bms-line);
  border-radius: 4px;
  padding: 1.1em 1.1em 1.5em;
  transition:
    box-shadow 0.15s ease,
    border-color 0.15s ease;
}
ul.products li.product:hover {
  border-color: var(--bms-gray);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}
ul.products li.product .woocommerce-loop-product__title {
  font-family: var(--bms-sans);
  color: var(--bms-ink);
  font-weight: 600;
  font-size: 1rem;
}
ul.products li.product .price {
  font-family: var(--bms-mono-caps);
  color: var(--bms-ink);
  font-weight: 600;
  letter-spacing: 0.02em;
}
ul.products li.product .price del {
  color: var(--bms-gray);
  font-weight: 400;
}
ul.products li.product .price ins {
  text-decoration: none;
  color: var(--bms-brass-dark);
}
.onsale,
.woocommerce span.onsale {
  background-color: var(--bms-brass) !important;
  color: #fff;
  border-radius: 999px;
  font-family: var(--bms-mono-caps);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  min-height: 0;
  padding: 0.5em 1.1em;
}
.star-rating span::before,
p.stars a:hover::after,
p.stars a.active::after {
  color: var(--bms-brass);
}
.woocommerce-products-header__title.page-title {
  font-family: var(--bms-serif);
  color: var(--bms-ink);
}

/* Section titles — reference heading + 50px rule device */
.storefront-product-section .section-title,
.page-template-template-homepage h2.section-title {
  font-family: var(--bms-serif);
  text-align: center;
  color: var(--bms-ink);
  position: relative;
  padding-bottom: 26px;
  margin-bottom: 1.6em;
}
.storefront-product-section .section-title::after,
.page-template-template-homepage h2.section-title::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 50px;
  height: 2px;
  background: var(--bms-ink);
}

/* Alternate section background for rhythm */
.storefront-product-section {
  padding-top: 1em;
}

/* ---------- Forms (reference floating-label feel, simplified) ---------- */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="search"],
textarea,
select {
  border: 1px solid var(--bms-line);
  border-radius: 4px;
  background: var(--bms-paper);
  font-family: var(--bms-sans);
  color: var(--bms-ink);
}
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--bms-ink);
  box-shadow: inset 0 0 0 1px var(--bms-ink);
}

/* ---------- Notices ---------- */
.woocommerce-message,
.woocommerce-info {
  border-top-color: var(--bms-ink);
  background: var(--bms-mist);
  color: var(--bms-ink);
}

/* ---------- Footer ---------- */
.site-footer {
  background-color: var(--bms-ink) !important;
  color: var(--bms-silver);
  font-family: var(--bms-sans);
}
.site-footer h1,
.site-footer h2,
.site-footer h3,
.site-footer h4,
.site-footer h5,
.site-footer h6 {
  font-family: var(--bms-mono-caps);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #fff;
}
.site-footer a:not(.button) {
  color: var(--bms-line) !important;
}
.site-footer a:not(.button):hover {
  color: #fff !important;
}
.site-footer .site-info {
  text-align: center;
  font-size: 0.9rem;
  color: var(--bms-silver);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1.6em;
  margin-top: 0.5em;
}

/* Footer columns */
.bms-footer-cols {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2em 3em;
  padding: 3.5em 0 2.5em;
}
@media (max-width: 767px) {
  .bms-footer-cols {
    grid-template-columns: 1fr 1fr;
    gap: 2em 1.5em;
    padding: 2.5em 0 2em;
  }
}
.bms-footer-wordmark {
  font-family: var(--bms-mono-caps);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #fff;
  margin-bottom: 0.8em;
}
.bms-footer-brand p {
  color: var(--bms-silver);
  font-size: 0.95em;
  max-width: 26em;
}
.bms-footer-heading {
  font-family: var(--bms-mono-caps);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #fff;
  margin-bottom: 1em;
}
.bms-footer-cols ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.bms-footer-cols ul li {
  margin-bottom: 0.55em;
}
.bms-footer-cols ul li a {
  font-size: 0.95em;
  text-decoration: none;
}
.bms-footer-cols ul li a:hover {
  text-decoration: underline;
}

/* ---------- Accessibility ---------- */
a:focus,
button:focus,
.button:focus,
input:focus {
  outline: 2px solid var(--bms-brass);
  outline-offset: 1px;
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
