/* main.css — async loaded, full styles */

/* ===== typography ===== */
p { margin: 0 0 1em; }
h2, h3, h4 { color: var(--text); line-height: 1.25; margin: 1.5em 0 0.5em; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }
@media (min-width: 900px) {
  h2 { font-size: 26px; }
  h3 { font-size: 20px; }
}
ul, ol { margin: 0 0 1em 1.25em; padding: 0; }
li { margin: 0.25em 0; }
strong { font-weight: 600; }
.prose a {
  color: var(--accent-dk);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.prose a:hover { text-decoration: none; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ===== layout ===== */
.main { padding: 0 0 40px; }
.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 16px;
}
@media (min-width: 1000px) {
  .layout { grid-template-columns: minmax(0, 1fr) 300px; }
}
.content { min-width: 0; }
.sidebar { font-size: 14px; }
.sidebar-box {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 20px;
}
.sidebar-box-title {
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--mute);
  margin-bottom: 10px;
}
.sidebar-box ul { list-style: none; margin: 0; padding: 0; }
.sidebar-box li + li { margin-top: 8px; }
.sidebar-box a {
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.35;
  display: block;
}
.sidebar-box a:hover { color: var(--accent-dk); }

/* ===== grid (4 cols desktop, 2 mobile) ===== */
.grid, .product-grid, .category-grid, .article-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, 1fr);
  margin: 16px 0 24px;
}
@media (min-width: 900px) {
  .grid, .product-grid, .category-grid, .article-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ===== product card ===== */
.product-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow .15s, transform .15s;
}
.product-card:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,.08);
  transform: translateY(-1px);
}
.product-card-img {
  aspect-ratio: 1 / 1;
  background: var(--bg-soft);
  overflow: hidden;
}
.product-card-img img { width: 100%; height: 100%; object-fit: cover; }
.product-card-body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.product-card-title {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}
.product-card-price {
  font-weight: 700;
  font-size: 16px;
  color: var(--accent-dk);
}
.product-card-brand { font-size: 11px; color: var(--mute); text-transform: uppercase; letter-spacing: 0.4px; }

/* ===== category card ===== */
.category-card {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  background: #fff;
}
.category-card:hover { border-color: var(--accent); }
.category-card-title { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.category-card-count { font-size: 12px; color: var(--mute); }

/* ===== product page ===== */
.product-main {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin: 16px 0 24px;
}
@media (min-width: 700px) {
  .product-main { grid-template-columns: 1fr 1fr; }
}
.product-gallery { display: flex; flex-direction: column; gap: 10px; }
.product-gallery-main {
  aspect-ratio: 1 / 1;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.product-gallery-main img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.product-gallery-thumbs { display: flex; gap: 8px; }
.product-gallery-thumbs img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
}
.product-price-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 12px 0;
}
.product-price {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent-dk);
}
.product-stock {
  color: #1a7f37;
  font-size: 13px;
  font-weight: 600;
}
.product-stock.out { color: #b13d13; }
.product-sku { color: var(--mute); font-size: 13px; }
.product-rating {
  font-size: 13px;
  color: var(--mute);
  margin: 8px 0 12px;
}
.product-rating .stars { color: #f5a623; font-weight: 600; }

.specs-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 14px;
}
.specs-table th, .specs-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.specs-table th {
  font-weight: 500;
  color: var(--mute);
  white-space: nowrap;
  width: 40%;
}

.product-description { margin: 16px 0; }
.product-description p { margin: 0 0 0.9em; }
.product-description ul li { margin: 0.2em 0; }

/* ===== faq ===== */
.faq { margin: 20px 0; }
.faq details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin: 6px 0;
  background: #fff;
}
.faq details[open] { background: var(--bg-soft); }
.faq summary {
  cursor: pointer;
  font-weight: 500;
  list-style: none;
  padding-right: 18px;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 0;
  font-size: 20px;
  line-height: 1;
  color: var(--accent);
}
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 8px 0 4px; color: var(--text); }

/* ===== article ===== */
.article-meta {
  color: var(--mute);
  font-size: 13px;
  margin-bottom: 16px;
}
.article-hero {
  margin: 0 0 20px;
  max-width: 960px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-soft);
}
.article-hero img {
  width: 100%;
  height: auto;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
  display: block;
}
.article-body h2 { margin-top: 1.5em; }
.article-body p, .article-body ul, .article-body ol {
  max-width: 760px;
}

/* ===== article card (blog index, home, related) ===== */
.article-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow .15s, transform .15s;
}
.article-card:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,.08);
  transform: translateY(-1px);
}
.article-card-img {
  aspect-ratio: 1200 / 630;
  background: var(--bg-soft);
  overflow: hidden;
}
.article-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.article-card-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.article-card-title {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card-date {
  font-size: 12px;
  color: var(--mute);
  margin-top: auto;
}

/* ===== ad slot ===== */
.ad-container {
  margin: 24px 0;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}
.ad-label {
  display: block;
  font-size: 11px;
  color: var(--mute);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 4px;
}

/* ===== forms ===== */
.form-row { margin-bottom: 12px; }
label { display: block; margin-bottom: 4px; font-size: 14px; color: var(--text); }
input[type=text], input[type=email], input[type=tel], textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 15px;
  background: #fff;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(11,87,208,0.15);
}
.form-success {
  margin-top: 12px;
  padding: 12px 14px;
  background: #e6f4ea;
  border: 1px solid #b7dfbc;
  border-radius: var(--radius);
  color: #166027;
}

/* ===== cart badge + toast ===== */
.cart-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: var(--bg-soft);
  border-radius: 20px;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
}
.cart-badge {
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1f1f1f;
  color: #fff;
  padding: 10px 18px;
  border-radius: 20px;
  font-size: 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.toast.is-visible { opacity: 1; pointer-events: auto; }

/* ===== footer ===== */
.site-footer {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  padding: 32px 0;
  margin-top: 40px;
  color: var(--mute);
  font-size: 14px;
}
.footer-wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
@media (min-width: 700px) {
  .footer-wrap { grid-template-columns: 2fr 1fr 1fr; }
}
.foot-col strong { color: var(--text); font-size: 15px; }
.foot-links a {
  display: block;
  color: var(--mute);
  text-decoration: none;
  padding: 3px 0;
}
.foot-links a:hover { color: var(--accent-dk); }
.foot-copy { grid-column: 1 / -1; border-top: 1px solid var(--border); padding-top: 16px; font-size: 13px; }

/* ===== misc ===== */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}
.section-title { font-size: 22px; margin: 32px 0 12px; }
.no-results {
  padding: 20px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  color: var(--mute);
  text-align: center;
}
