/* ==========================================================================
   Catalog / Shop / Layout glue — UGREEN Nepal
   Token-driven. Vendor theme CSS in /public/ugreen-theme-css/* still owns
   homepage chrome (header, footer, product cards). This file styles pages
   the vendor theme doesn't cover (shop, breadcrumb, generic sections).
   ========================================================================== */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ug-ink);
  background: var(--ug-bg);
  font-family: var(--ug-font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

main {
  min-height: 60vh;
}

/* ---- Shop page ---- */

.shop-page {
  padding: clamp(40px, 6vw, 72px) 0 clamp(56px, 8vw, 96px);
  background: var(--ug-bg);
}

.shop-page__head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 16px 24px;
  margin-bottom: clamp(24px, 4vw, 36px);
  padding-bottom: clamp(20px, 3vw, 28px);
  border-bottom: 1px solid var(--ug-line);
}

.shop-page__eyebrow {
  grid-column: 1;
  margin: 0 0 8px;
  color: var(--ug-green-deep);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.shop-page__title {
  grid-column: 1;
  margin: 0;
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--ug-ink);
}

.shop-page__count {
  grid-column: 2;
  margin: 0;
  color: var(--ug-muted);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

/* ---- Shop tools (search + category) ---- */

.shop-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 280px);
  gap: 12px;
  margin-bottom: clamp(28px, 4vw, 40px);
}

.shop-tools__field {
  display: grid;
  gap: 6px;
}

.shop-tools__label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ug-muted);
  text-transform: uppercase;
}

.shop-tools input,
.shop-tools select {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  font: inherit;
  font-size: 15px;
  color: var(--ug-ink);
  background: var(--ug-bg);
  border: 1px solid var(--ug-line);
  border-radius: var(--ug-radius-md);
  outline: none;
  transition:
    border-color var(--ug-dur) var(--ug-ease),
    box-shadow var(--ug-dur) var(--ug-ease),
    background-color var(--ug-dur) var(--ug-ease);
  appearance: none;
}

.shop-tools select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
  cursor: pointer;
}

.shop-tools input:hover,
.shop-tools select:hover {
  border-color: var(--ug-ink-soft);
}

.shop-tools input:focus-visible,
.shop-tools select:focus-visible {
  border-color: var(--ug-green);
  box-shadow: 0 0 0 3px rgba(0, 166, 81, 0.18);
}

.shop-tools input::placeholder {
  color: #9ca3af;
}

/* ---- Shop grid ---- */

.shop-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 24px);
}

@media (max-width: 1024px) {
  .shop-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}

@media (max-width: 420px) {
  .shop-grid { grid-template-columns: 1fr; }
}

[data-product-card][hidden] { display: none; }

/* FeaturedProductCard relies on a square .ug-product-img wrapper. The homepage
 * sets that via #template--…__ug-product-list .ug-product-img rules; outside
 * the homepage we need to provide the same sizing or the card collapses. */
.shop-grid .ug-product-img,
.product-recommended__grid .ug-product-img {
  width: 100%;
  padding-bottom: 100%;
  position: relative;
}

.shop-grid .ug-product-img > img,
.product-recommended__grid .ug-product-img > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8%;
}

.shop-empty {
  margin: 32px 0 0;
  padding: 32px;
  text-align: center;
  color: var(--ug-muted);
  background: var(--ug-bg-soft);
  border: 1px solid var(--ug-line);
  border-radius: var(--ug-radius-md);
}

/* ---- Breadcrumb (legacy / detail page reuses) ---- */

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
  color: var(--ug-muted);
  font-size: 14px;
}

/* ---- Responsive shop tools ---- */

@media (max-width: 640px) {
  .shop-page__head {
    grid-template-columns: 1fr;
  }
  .shop-page__count {
    grid-column: 1;
  }
  .shop-tools {
    grid-template-columns: 1fr;
  }
}
