/*
Theme Name: ESP AI Shop
Theme URI: https://example.com/
Author: ESP AI Shop
Description: Lightweight WooCommerce theme for ESP32 DIY kits and China-sourced AI hardware.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 8.0
Text Domain: esp-ai-shop
*/

:root {
  --ink: #121417;
  --muted: #5c6570;
  --line: #d8dde3;
  --paper: #ffffff;
  --soft: #f3f6f8;
  --teal: #007c78;
  --teal-dark: #055f5c;
  --lime: #bedc36;
  --coral: #ee5d4a;
  --amber: #f2b84b;
  --max: 1180px;
  --shadow: 0 18px 50px rgba(18, 20, 23, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  height: auto;
  max-width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(216, 221, 227, 0.8);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
}

.header-inner,
.section-inner,
.footer-inner {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.06rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  color: #fff;
  background: var(--ink);
}

.nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-weight: 650;
  font-size: 0.95rem;
}

.nav a {
  padding: 10px 12px;
  border-radius: 6px;
}

.nav a:hover,
.nav .current-menu-item > a {
  color: var(--ink);
  background: var(--soft);
}

.cart-link {
  border: 1px solid var(--line);
}

.hero {
  position: relative;
  min-height: min(680px, calc(100svh - 72px));
  display: flex;
  align-items: center;
  overflow: hidden;
  color: #fff;
  background: #101316;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(18, 20, 23, 0.86) 0%, rgba(18, 20, 23, 0.62) 48%, rgba(18, 20, 23, 0.24) 100%);
}

.hero-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  padding: 72px 0;
  transform: translateX(calc((min(var(--max), calc(100vw - 32px)) - min(760px, calc(100vw - 32px))) / -2));
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  color: var(--lime);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.35rem, 4rem, 4.9rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero p {
  max-width: 620px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.15rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button,
.button.alt,
.wp-element-button,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 18px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  color: #fff;
  background: var(--ink);
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.button:hover,
.wp-element-button:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
}

.button.secondary {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.72);
  background: transparent;
}

.button.secondary:hover {
  color: var(--ink);
  background: #fff;
  border-color: #fff;
}

.section {
  padding: 72px 0;
}

.section.soft {
  background: var(--soft);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.section-head h2,
.page-title {
  margin: 0;
  font-size: clamp(1.85rem, 2.6rem, 3rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.section-head p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
}

.category-grid,
.promise-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.category-tile,
.promise {
  min-height: 190px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.category-tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.category-tile:nth-child(2) {
  border-top: 5px solid var(--teal);
}

.category-tile:nth-child(3) {
  border-top: 5px solid var(--coral);
}

.category-tile:nth-child(4) {
  border-top: 5px solid var(--amber);
}

.category-tile strong,
.promise strong {
  display: block;
  font-size: 1.16rem;
  line-height: 1.2;
}

.category-tile span,
.promise span {
  display: block;
  margin-top: 10px;
  color: var(--muted);
}

.product-band {
  background: #151719;
  color: #fff;
}

.product-band .section-head p {
  color: rgba(255, 255, 255, 0.7);
}

.woocommerce ul.products {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.woocommerce ul.products::before,
.woocommerce ul.products::after {
  content: none;
}

.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
  width: auto;
  float: none;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: none;
}

.product-band .woocommerce ul.products li.product {
  border-color: rgba(255, 255, 255, 0.16);
  background: #fff;
}

.woocommerce ul.products li.product a img {
  aspect-ratio: 4 / 3;
  width: 100%;
  object-fit: cover;
  margin: 0;
  background: var(--soft);
}

.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product .price,
.woocommerce ul.products li.product .button {
  margin-left: 16px;
  margin-right: 16px;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
  min-height: 50px;
  margin-top: 16px;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.28;
}

.woocommerce ul.products li.product .price {
  color: var(--teal-dark);
  font-weight: 900;
}

.woocommerce ul.products li.product .button {
  margin-bottom: 16px;
}

.content-wrap {
  width: min(900px, calc(100% - 32px));
  margin: 0 auto;
  padding: 64px 0;
}

.content-wrap a {
  color: var(--teal-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.quote-form-wrap {
  margin-top: 28px;
}

.quote-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.quote-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 750;
}

.quote-form label:last-of-type {
  grid-column: 1 / -1;
}

.quote-form input,
.quote-form textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

.quote-form textarea {
  min-height: 148px;
  resize: vertical;
}

.quote-form .button {
  width: fit-content;
}

.notice {
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: 6px;
  font-weight: 750;
}

.notice.success {
  color: #063f3d;
  background: #d9f2ef;
}

.notice.error {
  color: #742014;
  background: #ffe3dd;
}

.woocommerce .content-wrap {
  width: min(var(--max), calc(100% - 32px));
}

.site-footer {
  padding: 42px 0;
  color: rgba(255, 255, 255, 0.76);
  background: #111315;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 28px;
}

.footer-inner strong {
  display: block;
  margin-bottom: 10px;
  color: #fff;
}

.footer-inner p {
  margin: 0;
}

.site-footer a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 900px) {
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 0;
  }

  .hero {
    min-height: 620px;
  }

  .hero-content {
    transform: none;
  }

  .category-grid,
  .promise-grid,
  .woocommerce ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .nav {
    font-size: 0.9rem;
  }

  .nav a {
    padding: 8px 9px;
  }

  .hero {
    min-height: 590px;
  }

  .hero::after {
    background: rgba(18, 20, 23, 0.72);
  }

  .hero h1 {
    font-size: 2.55rem;
  }

  .section {
    padding: 54px 0;
  }

  .section-head {
    display: block;
  }

  .section-head p {
    margin-top: 12px;
  }

  .category-grid,
  .promise-grid,
  .woocommerce ul.products,
  .quote-form {
    grid-template-columns: 1fr;
  }
}
