/*
Theme Name: Mad Dental Care
Theme URI: http://localhost:8081
Author: Local Clone
Description: WooCommerce theme matched closely to the MAD Dental Care storefront.
Version: 1.1.0
Text Domain: mad-dental
*/

:root {
  --mad-blue: #0a2a9a;
  --mad-blue-deep: #071f73;
  --mad-ink: #111;
  --mad-muted: #666;
  --mad-sale: #d9534f;
  --mad-bg: #fafafc;
  --mad-white: #fff;
  --mad-border: #e8e8ee;
  --mad-max: 1180px;
  --font: "Poppins", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--mad-ink);
  background: var(--mad-white);
  line-height: 1.55;
  font-size: 15px;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1,h2,h3 { line-height: 1.2; font-weight: 600; }

.mad-wrap {
  width: min(100% - 2rem, var(--mad-max));
  margin-inline: auto;
}

/* Top bar */
.mad-announce {
  background: var(--mad-blue);
  color: #fff;
  font-size: 13px;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  overflow: hidden;
}
.mad-announce span { white-space: nowrap; }

/* Header */
.mad-header {
  background: #fff;
  border-bottom: 1px solid var(--mad-border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.mad-header__inner {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.mad-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  text-transform: lowercase;
  font-size: 18px;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.mad-logo img { width: 46px; height: auto; }
.mad-nav {
  display: flex;
  gap: 28px;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
}
.mad-nav a:hover { color: var(--mad-blue); }
.mad-header__actions {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  font-weight: 600;
}
.mad-cart-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--mad-blue);
  color: #fff;
  font-size: 11px;
  margin-left: 4px;
}

.mad-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 12px 28px;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: .2s ease;
}
.mad-btn--primary { background: var(--mad-blue); color: #fff; }
.mad-btn--primary:hover { background: var(--mad-blue-deep); }
.mad-btn--ghost { background: #fff; border-color: #111; color: #111; }
.mad-btn--ghost:hover { background: #111; color: #fff; }
.md-full { width: 100%; }

/* Hero video */
.md-hero {
  position: relative;
  min-height: min(72vh, 640px);
  overflow: hidden;
  background: #0a1a40;
}
.md-hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.md-hero__overlay {
  position: relative;
  z-index: 1;
  min-height: inherit;
  display: flex;
  align-items: flex-end;
  padding: 48px 0 40px;
  background: linear-gradient(180deg, rgba(0,0,0,.08), rgba(0,0,0,.55));
  color: #fff;
}
.md-hero h1 {
  margin: 0;
  max-width: 780px;
  font-size: clamp(22px, 3.2vw, 34px);
  font-weight: 500;
  text-align: center;
  margin-inline: auto;
}

/* Split promo */
.md-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  padding: 64px 0;
}
.md-split--reverse .md-split__media { order: 2; }
.md-split__media {
  border-radius: 4px;
  overflow: hidden;
  background: #f2f2f5;
  aspect-ratio: 1;
}
.md-split__media img { width: 100%; height: 100%; object-fit: cover; }
.md-split__copy { text-align: center; }
.md-split__copy h2 {
  margin: 0 0 14px;
  font-size: clamp(28px, 3.5vw, 42px);
}
.md-split__copy p {
  margin: 0 0 22px;
  color: var(--mad-muted);
  font-size: 16px;
}

/* Featured product */
.md-product {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  padding: 20px 0 70px;
  align-items: start;
}
.md-product__main {
  background: #f4f4f7;
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 1;
}
.md-product__main img { width: 100%; height: 100%; object-fit: cover; }
.md-product__thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 12px;
}
.md-thumb {
  border: 1px solid transparent;
  padding: 0;
  background: #f4f4f7;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 1;
}
.md-thumb.is-active { border-color: var(--mad-blue); }
.md-thumb img { width: 100%; height: 100%; object-fit: cover; }
.md-product__info h2 {
  margin: 0 0 12px;
  font-size: 24px;
}
.md-price {
  margin: 0 0 22px;
  color: var(--mad-sale);
  font-size: 22px;
  font-weight: 700;
}
.md-price del { color: #999; font-weight: 500; font-size: 16px; margin-left: 8px; }
.md-qty-label {
  display: block;
  font-size: 13px;
  margin-bottom: 8px;
  font-weight: 500;
}
.md-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid #ccc;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 14px;
}
.md-qty input {
  width: 52px;
  border: 0;
  text-align: center;
  font: inherit;
  padding: 10px 0;
}
.md-qty__btn {
  width: 40px;
  height: 42px;
  border: 0;
  background: #fff;
  font-size: 18px;
  cursor: pointer;
}
.md-cart-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 420px;
}

/* Blue feature band */
.md-band--blue {
  background: var(--mad-blue);
  color: #fff;
  padding: 56px 0;
}
.md-band__inner {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 32px;
  align-items: center;
}
.md-band h2 { margin: 0 0 12px; font-size: 28px; }
.md-band p { margin: 0; opacity: .95; max-width: 52ch; }
.md-band__media {
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255,255,255,.1);
}
.md-band__media img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }

/* Secret / stats */
.md-secret {
  text-align: center;
  padding: 70px 0 40px;
}
.md-kicker { color: var(--mad-muted); margin: 0 0 8px; }
.md-secret h2 { margin: 0 0 36px; font-size: 32px; }
.md-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.md-stats div {
  padding: 18px 12px;
}
.md-stats img {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
}
.md-stats strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
}

.md-award {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 36px;
  align-items: center;
  padding: 40px 0 60px;
}
.md-award__media img {
  width: 100%;
  border-radius: 8px;
  background: #f2f2f5;
}
.md-proof {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  padding: 20px 0 60px;
  align-items: start;
}
.md-store-box {
  border: 1px solid var(--mad-border);
  border-radius: 12px;
  padding: 22px;
  background: #fafafa;
}
.md-store-box h3 { margin: 0 0 10px; }
.md-trust {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  padding: 20px 0 60px;
}
.md-trust__tag {
  font-weight: 700;
  margin-top: 12px;
}

/* Product grid */
.md-shop { padding: 10px 0 70px; }
.md-shop__head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 18px;
}
.md-shop__head h2 { margin: 0; }
.md-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.md-card {
  display: block;
  border: 1px solid var(--mad-border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  transition: .2s ease;
}
.md-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0,0,0,.08);
}
.md-card__img {
  display: block;
  aspect-ratio: 1;
  background: #f3f3f6;
  overflow: hidden;
}
.md-card__img img { width: 100%; height: 100%; object-fit: cover; }
.md-card__body { display: block; padding: 12px 14px 16px; }
.md-card__title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  min-height: 2.7em;
  margin-bottom: 8px;
}
.md-card__price {
  display: block;
  color: var(--mad-sale);
  font-weight: 700;
}

/* Newsletter */
.md-newsletter {
  background: var(--mad-blue);
  color: #fff;
  text-align: center;
  padding: 56px 0;
}
.md-newsletter h2 { margin: 0 0 8px; }
.md-newsletter p { margin: 0 0 18px; opacity: .95; }
.md-newsletter__form {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.md-newsletter__form input {
  min-width: min(100%, 320px);
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
}

/* Footer */
.mad-footer {
  background: #111;
  color: #ccc;
  padding: 48px 0 20px;
}
.mad-footer a { color: #ccc; }
.mad-footer a:hover { color: #fff; }
.mad-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 28px;
  margin-bottom: 28px;
}
.mad-footer h4 {
  margin: 0 0 14px;
  color: #fff;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.mad-footer li + li { margin-top: 8px; }
.mad-footer__bottom {
  border-top: 1px solid #333;
  padding-top: 14px;
  font-size: 13px;
  color: #888;
}

.site-main { padding: 0; }
.page-title { font-size: 32px; }
.woocommerce ul.products { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
.woocommerce ul.products li.product { width: 100%; margin: 0; float: none; }
.woocommerce #respond input#submit.alt,
.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce input.button.alt {
  background: var(--mad-blue);
  border-radius: 999px;
}
.woocommerce span.onsale {
  background: var(--mad-blue);
  border-radius: 999px;
}

@media (max-width: 980px) {
  .mad-nav { display: none; }
  .md-split,
  .md-product,
  .md-band__inner,
  .md-stats,
  .md-award,
  .md-proof,
  .md-trust,
  .md-grid,
  .mad-footer__grid,
  .woocommerce ul.products {
    grid-template-columns: 1fr 1fr;
  }
  .md-split--reverse .md-split__media { order: 0; }
}
@media (max-width: 640px) {
  .mad-announce { flex-direction: column; gap: 4px; }
  .mad-announce span { white-space: normal; }
  .md-split,
  .md-product,
  .md-band__inner,
  .md-stats,
  .md-award,
  .md-proof,
  .md-trust,
  .md-grid,
  .mad-footer__grid,
  .woocommerce ul.products {
    grid-template-columns: 1fr;
  }
}
