/**
 * 3100_081A — Premium Storefront Visual Polish
 * Presentation-only. Charcoal + copper foundation preserved.
 */
/* —— Font fallback safety (Cloud CDN may fail CORS) —— */
body,
.cw-073,
.cw-074 {
  font-family: var(--font-body, 'Prompt', 'Kanit', 'Noto Sans Thai', 'Sarabun', system-ui, sans-serif);
}

h1, h2, h3, h4,
.cw-hero-title,
.cw-r2-section-head h2,
.p-title,
.pd-title,
.cw-g-master {
  font-family: var(--font-heading, 'Outfit', 'Oswald', 'Kanit', 'Prompt', 'Noto Sans Thai', system-ui, sans-serif);
}

/* —— Section pacing / width —— */
.cw-r2-section,
.cw-featured-section,
.cw-work-section,
.cw-process-section {
  padding-block: clamp(2.75rem, 5vw, 4.25rem);
}

.cw-r2-section-head {
  max-width: 42rem;
  margin-inline: auto;
  margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
  text-align: center;
}

.cw-r2-section-head .eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cw-copper, #B87333);
  margin-bottom: 0.55rem;
  font-weight: 600;
}

.cw-r2-section-head h2 {
  font-size: clamp(1.45rem, 2.6vw, 2rem);
  line-height: 1.25;
  margin: 0 0 0.55rem;
  color: var(--cw-warm-white, #F5F0E8);
}

.cw-r2-section-head p {
  margin: 0;
  color: rgba(232, 226, 217, 0.72);
  font-size: 0.95rem;
  line-height: 1.65;
}

.product-grid.cw-product-grid,
.cw-featured-grid,
.cw-listing-grid {
  gap: clamp(1rem, 2vw, 1.35rem);
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: clamp(1rem, 3vw, 1.5rem);
}

/* —— Unified product card system —— */
.cw-product-card.sf-product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(180deg, #1c2025 0%, #15181c 100%);
  border: 1px solid rgba(184, 115, 51, 0.18);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.cw-product-card.sf-product-card:hover {
  border-color: rgba(184, 115, 51, 0.42);
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.36);
}

.cw-listing-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.cw-cover-wrap.cw-listing-cover {
  position: relative;
  aspect-ratio: 4 / 5;
  width: 100%;
  overflow: hidden;
  background:
    linear-gradient(145deg, #121417 0%, #1a1d21 55%, #23272c 100%);
  border-bottom: 1px solid rgba(184, 115, 51, 0.12);
}

.cw-cover-wrap .cw-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cw-cover-wrap.cw-cover-missing .cw-cover-img,
.cw-cover-img.cw-img-fallback {
  object-fit: cover;
}

.cw-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.45rem;
  padding: 0.9rem 0.95rem 1rem;
}

.cw-card-category {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(184, 115, 51, 0.9);
  font-weight: 600;
}

.cw-card-title.cw-card-title-clamp {
  font-size: 0.98rem;
  line-height: 1.4;
  margin: 0;
  color: var(--cw-warm-white, #F5F0E8);
  font-weight: 650;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cw-card-sku {
  font-size: 0.72rem;
  color: rgba(232, 226, 217, 0.45);
}

.cw-sale-badge {
  align-self: flex-start;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  padding: 0.22rem 0.5rem;
  border-radius: 4px;
  border: 1px solid rgba(184, 115, 51, 0.35);
  color: #e8c49a;
  background: rgba(184, 115, 51, 0.1);
}

.cw-card-price {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--cw-warm-white, #F5F0E8);
  margin-top: 0.1rem;
}

.cw-card-price-quote {
  font-size: 0.92rem;
  color: #d9c3a4;
  font-weight: 650;
}

.cw-price-compare {
  font-size: 0.78rem;
  font-weight: 500;
  text-decoration: line-through;
  color: rgba(232, 226, 217, 0.45);
  margin-right: 0.35rem;
}

.cw-card-actions {
  margin-top: auto;
  padding-top: 0.55rem;
}

.cw-card-cta.btn,
.cw-card-actions .cw-card-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.4rem;
  width: 100%;
  padding: 0.55rem 0.75rem;
  font-size: 0.84rem;
  font-weight: 650;
  border-radius: 6px;
  background: linear-gradient(180deg, #c48445 0%, #a8662f 100%);
  color: #1a120c;
  border: 1px solid rgba(255, 220, 180, 0.2);
}

/* —— Portfolio unique tiles —— */
.cw-work-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.85rem, 2vw, 1.25rem);
  max-width: 1100px;
  margin-inline: auto;
  padding-inline: clamp(1rem, 3vw, 1.5rem);
}

.cw-work-tile {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(184, 115, 51, 0.16);
  background: #15181c;
}

.cw-work-tile-visual {
  aspect-ratio: 4 / 3;
  background-size: cover;
  background-position: center;
}

.cw-work-tile h3 {
  margin: 0;
  padding: 0.85rem 0.95rem 1rem;
  font-size: 0.95rem;
  color: var(--cw-warm-white, #F5F0E8);
}

/* —— Floating contact —— */
.contact-widget-container.cw-g-dock {
  right: max(1rem, env(safe-area-inset-right, 0px));
  bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  z-index: 40;
  gap: 0.55rem;
}

.contact-widget-container .contact-call-btn,
.contact-widget-container .contact-main-toggle {
  width: 52px;
  height: 52px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

/* —— Footer polish —— */
.main-footer.cw-071-footer {
  padding-block: clamp(2.5rem, 4vw, 3.5rem) 1.25rem;
  border-top: 1px solid rgba(184, 115, 51, 0.16);
}

.main-footer .footer-grid {
  gap: clamp(1.5rem, 3vw, 2.5rem);
  max-width: 1200px;
  margin-inline: auto;
}

.main-footer .cw-071-foot-brand {
  max-width: 22rem;
}

.main-footer .footer-bottom {
  margin-top: 1.75rem;
  padding-top: 1rem;
  font-size: 0.78rem;
  opacity: 0.75;
}

/* —— Header polish —— */
#main-header.site-header {
  backdrop-filter: blur(8px);
}

#main-header .cw-header-cta,
#main-header .btn.cw-header-cta {
  white-space: nowrap;
}

/* —— Hero restraint —— */
.cw-hero .cw-hero-title {
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.55);
}

.cw-hero .btn-primary {
  box-shadow: 0 8px 22px rgba(168, 102, 47, 0.28);
}

/* —— Product detail missing media —— */
.pd-main-img-wrap.cw-pd-missing {
  aspect-ratio: 16 / 10;
  max-height: min(36vh, 320px);
  border-color: rgba(184, 115, 51, 0.22);
}

body.cw-product-detail .pd-info {
  padding-top: 0.25rem;
}

body.cw-product-detail .pd-actions .btn-primary {
  min-height: 2.75rem;
}

body.cw-product-detail .pd-actions .btn-secondary {
  opacity: 0.92;
}

/* —— Mobile 390 —— */
@media (max-width: 767px) {
  .product-grid.cw-product-grid,
  .cw-featured-grid,
  .cw-listing-grid {
    gap: 0.9rem;
    padding-inline: 0.9rem;
  }

  .cw-card-body {
    padding: 0.8rem 0.8rem 0.9rem;
    gap: 0.38rem;
  }

  .cw-card-title.cw-card-title-clamp {
    font-size: 0.92rem;
    -webkit-line-clamp: 3;
    line-height: 1.38;
  }

  .cw-card-price {
    font-size: 0.98rem;
  }

  .cw-card-cta.btn,
  .cw-card-actions .cw-card-cta {
    min-height: 2.55rem;
    font-size: 0.82rem;
  }

  .cw-work-tiles {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .contact-widget-container.cw-g-dock {
    right: max(0.75rem, env(safe-area-inset-right, 0px));
    bottom: max(0.85rem, calc(env(safe-area-inset-bottom, 0px) + 0.35rem));
  }

  .contact-widget-container .contact-call-btn,
  .contact-widget-container .contact-main-toggle {
    width: 48px;
    height: 48px;
  }

  /* Keep floating controls clear of sticky CTA band */
  body.cw-product-detail .contact-widget-container.cw-g-dock {
    bottom: max(5.5rem, calc(env(safe-area-inset-bottom, 0px) + 4.75rem));
  }

  .pd-main-img-wrap.cw-pd-missing {
    aspect-ratio: 16 / 9;
    max-height: min(28vh, 220px);
  }

  .cw-r2-section,
  .cw-featured-section,
  .cw-work-section {
    padding-block: 2.25rem;
  }
}

@media (max-width: 420px) {
  .cw-cover-wrap.cw-listing-cover {
    aspect-ratio: 1 / 1.05;
  }
}

/* Desktop composition */
@media (min-width: 1100px) {
  .cw-work-tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
