/* ===== Crestline Shop (QA fixture) =====
   Builds on style.css — reuses CSS vars, .btn, .container, .form-group, header/footer. */

.shop-hero {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-mid) 100%);
  color: var(--white);
  padding: 56px 0 48px;
}
.shop-hero h1 { color: var(--white); margin-bottom: 8px; }
.shop-hero p { color: rgba(255, 255, 255, 0.85); max-width: 60ch; }

.shop-section { padding: 40px 0 80px; }

.shop-breadcrumb {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 18px;
}
.shop-breadcrumb a { color: var(--green-mid); text-decoration: none; }
.shop-breadcrumb a:hover { text-decoration: underline; }

/* ===== Toolbar: search + count ===== */
.shop-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.shop-search-wrap { flex: 1 1 280px; max-width: 420px; }
#shop-search {
  width: 100%;
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
}
#shop-search:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(28, 166, 196, 0.12);
}
.shop-count { color: var(--text-light); font-size: 0.9rem; }

/* ===== Category filter ===== */
.shop-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 26px;
}
.filter-chip {
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.filter-chip:hover { border-color: var(--cyan); }
.filter-chip.active {
  background: var(--green-mid);
  border-color: var(--green-mid);
  color: var(--white);
}

/* ===== Product grid ===== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 22px;
}
.product-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}
.product-card:hover {
  border-color: rgba(28, 166, 196, 0.55);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.product-card a.card-link { text-decoration: none; color: inherit; display: block; }
.product-thumb {
  position: relative;
  background: var(--canvas);
  border-bottom: 1px solid var(--line);
}
.product-thumb img { display: block; width: 100%; height: 180px; object-fit: cover; }
.product-cat-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--white);
  background: rgba(24, 49, 40, 0.78);
}
.product-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.product-title { font-size: 1rem; font-weight: 600; margin-bottom: 6px; line-height: 1.35; }
.product-short { color: var(--text-light); font-size: 0.85rem; line-height: 1.5; margin-bottom: 12px; flex: 1; }
.product-price-row { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.product-price { font-size: 1.25rem; font-weight: 700; color: var(--green-dark); }
.product-rrp { font-size: 0.85rem; color: var(--text-muted); text-decoration: line-through; }
.product-card .btn { width: 100%; text-align: center; }

/* ===== Stock badges (honest) ===== */
.stock-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}
.stock-in { background: var(--success-bg); color: var(--success-color); }
.stock-low { background: var(--warning-bg); color: var(--warning-color); }
.stock-out { background: var(--danger-bg); color: var(--danger-color); }

.shop-empty {
  text-align: center;
  color: var(--text-light);
  padding: 60px 0;
  font-size: 1rem;
}

/* ===== Product detail ===== */
.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 40px;
  align-items: start;
}
.detail-image {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--canvas);
}
.detail-image img { display: block; width: 100%; height: auto; }
.detail-info h1 { font-size: 1.9rem; margin-bottom: 10px; }
.detail-sku { color: var(--text-muted); font-size: 0.82rem; margin-bottom: 14px; }
.detail-price-row { display: flex; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.detail-price { font-size: 2rem; font-weight: 700; color: var(--green-dark); }
.detail-rrp { font-size: 1rem; color: var(--text-muted); text-decoration: line-through; }
.detail-desc { color: var(--text-light); margin: 18px 0; line-height: 1.7; }

.detail-buy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin: 22px 0;
}
.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.qty-stepper button {
  width: 40px;
  height: 44px;
  border: none;
  background: var(--white);
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--green-dark);
}
.qty-stepper button:hover { background: var(--green-pale); }
.qty-stepper input {
  width: 48px;
  height: 44px;
  border: none;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: center;
  font-size: 1rem;
  font-family: inherit;
}
#add-to-cart { padding: 12px 32px; }
#add-to-cart:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.attr-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  font-size: 0.92rem;
}
.attr-table caption {
  text-align: left;
  font-weight: 600;
  color: var(--green-dark);
  margin-bottom: 8px;
}
.attr-table th,
.attr-table td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
}
.attr-table th { width: 45%; color: var(--text-light); font-weight: 500; }
.attr-table td { font-weight: 600; }

.detail-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 18px;
  font-size: 0.85rem;
  color: var(--text-light);
}
.detail-meta-row span strong { color: var(--text); }

/* ===== Related / comparison ===== */
.related-block { margin-top: 64px; }
.related-block h2 { margin-bottom: 18px; }

/* ===== Cart ===== */
.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 0.9fr);
  gap: 32px;
  align-items: start;
}
.cart-items { display: flex; flex-direction: column; gap: 14px; }
.cart-item {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 16px;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px;
}
.cart-item img { width: 88px; height: 70px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.cart-item-title { font-weight: 600; font-size: 0.95rem; }
.cart-item-title a { color: inherit; text-decoration: none; }
.cart-item-title a:hover { color: var(--green-mid); }
.cart-item-sku { color: var(--text-muted); font-size: 0.78rem; }
.cart-item-controls { display: flex; align-items: center; gap: 14px; }
.cart-item-line { font-weight: 700; color: var(--green-dark); white-space: nowrap; }
.cart-remove {
  background: none;
  border: none;
  color: var(--danger-color);
  cursor: pointer;
  font-size: 0.82rem;
  text-decoration: underline;
}
.cart-summary {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: sticky;
  top: 90px;
}
.cart-summary h2 { font-size: 1.2rem; margin-bottom: 16px; }
.summary-row { display: flex; justify-content: space-between; padding: 8px 0; color: var(--text-light); font-size: 0.92rem; }
.summary-row.total {
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding-top: 14px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}
#checkout { width: 100%; text-align: center; margin-top: 16px; }
#checkout:disabled { opacity: 0.55; cursor: not-allowed; }

/* ===== Checkout / enquiry form ===== */
.checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr);
  gap: 32px;
  align-items: start;
}
.checkout-note {
  background: var(--cyan-soft);
  border: 1px solid rgba(28, 166, 196, 0.3);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.88rem;
  color: var(--text);
  margin-bottom: 22px;
}
.order-lines {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.order-line {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}
.order-line:last-of-type { border-bottom: none; }

/* ===== Confirmation ===== */
.confirm-card {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 48px 32px;
  box-shadow: var(--shadow);
}
.confirm-tick {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--success-bg);
  color: var(--success-color);
  display: flex;
  align-items: center;
  justify-content: center;
}
.confirm-tick svg { width: 34px; height: 34px; }
.confirm-ref {
  display: inline-block;
  margin: 12px 0 20px;
  padding: 8px 18px;
  background: var(--green-pale);
  border-radius: var(--radius);
  font-weight: 700;
  color: var(--green-dark);
  letter-spacing: 0.04em;
}

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .product-detail,
  .cart-layout,
  .checkout-layout { grid-template-columns: 1fr; }
  .cart-summary { position: static; }
}
@media (max-width: 520px) {
  .cart-item { grid-template-columns: 64px 1fr; }
  .cart-item img { width: 64px; height: 56px; }
  .cart-item-line { grid-column: 2; }
}
