* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-image: url(/images/bg.png);
  background-size: cover;
  background-attachment: fixed;
  min-height: 100vh;
  padding: 20px;
}

/* ── Card ── */
.card {
  background: white;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  overflow: hidden;
  width: 100%;
}

.card-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 24px 20px;
}
.card-header h1 { font-size: 24px; margin-bottom: 4px; }
.card-header p  { font-size: 13px; opacity: 0.9; }

.card-body { padding: 24px 20px; }

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.2s;
}
.btn:hover    { filter: brightness(0.9); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary  { background: #667eea; color: white; }
.btn-danger   { background: #e53935; color: white; }
.btn-success  { background: #43a047; color: white; }
.btn-sm       { padding: 6px 12px; font-size: 13px; }
.btn-full     { width: 100%; display: block; }

/* ── Forms ── */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 600;
  color: #333;
}
.form-group input, .form-group select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 14px;
}
.form-group input:focus, .form-group select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102,126,234,0.15);
}

/* ── Alerts ── */
.alert { padding: 9px 12px; border-radius: 5px; font-size: 13px; margin-top: 8px; display: none; }
.alert.show      { display: block; }
.alert-error     { background: #ffebee; color: #c62828; }
.alert-success   { background: #e8f5e9; color: #2e7d32; }
.alert-warning   { background: #fff8e1; color: #f57f17; }

/* ── Tabs ── */
.tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.tab-btn {
  flex: 1;
  padding: 9px;
  border: none;
  background: #f0f0f0;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.tab-btn.active { background: #667eea; color: white; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── Nav bar ── */
.navbar {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.navbar a { color: white; text-decoration: none; font-weight: 600; font-size: 15px; }
.navbar-right { display: flex; align-items: center; gap: 14px; font-size: 13px; }

/* ── Device card ── */
.device-card {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 14px;
}
.device-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.device-name { font-size: 16px; font-weight: 700; }
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.badge-online  { background: #e8f5e9; color: #2e7d32; }
.badge-offline { background: #fafafa; color: #999; }

.device-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

/* ── Color swatches ── */
.color-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.swatch {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s;
}
.swatch:hover { transform: scale(1.2); }
.swatch.active { border-color: #333; }

/* ── Provision box ── */
.provision-box {
  border: 2px solid #667eea;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  margin-top: 20px;
}
.provision-box h3 { font-size: 15px; margin-bottom: 6px; }
.provision-box p  { font-size: 13px; color: #666; margin-bottom: 12px; }
.countdown { font-size: 40px; font-weight: bold; color: #667eea; margin: 8px 0; }

/* ── Utility ── */
.text-muted { color: #999; font-size: 12px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.center { text-align: center; }

/* Store */
.store-page {
  background: #f7f6f2;
  color: #17202a;
  padding: 0;
}
.store-header {
  min-height: 72px;
  padding: 0 6vw;
  background: #fff;
  border-bottom: 1px solid #dfe1df;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.store-brand { color: #17202a; text-decoration: none; letter-spacing: .16em; font-size: 16px; font-weight: 700; }
.store-nav, .store-actions { display: flex; align-items: center; gap: 26px; }
.store-nav a, .store-actions a { color: #17202a; text-decoration: none; font-size: 14px; }
.store-nav a.active, .cart-link.active { border-bottom: 1px solid #17202a; padding-bottom: 5px; }
.cart-link span { display: inline-flex; min-width: 19px; height: 19px; margin-left: 4px; padding: 0 5px; border: 1px solid #17202a; border-radius: 50%; align-items: center; justify-content: center; font-size: 11px; }
.shop-hero { min-height: 510px; display: grid; grid-template-columns: .9fr 1.1fr; background: #ebe8e2; }
.shop-hero-copy { padding: 100px 7vw; align-self: center; }
.eyebrow { color: #8d7964; font-size: 12px; font-weight: 700; letter-spacing: .1em; margin-bottom: 20px; }
.shop-hero h1, .product-detail h1, .success-page h1 { max-width: 620px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(42px, 5vw, 72px); font-weight: 400; line-height: 1.06; margin-bottom: 24px; }
.shop-hero-copy > p:not(.eyebrow) { max-width: 430px; color: #4e5558; line-height: 1.7; margin-bottom: 30px; }
.shop-hero-image { width: 100%; height: 100%; min-height: 510px; object-fit: cover; object-position: center; }
.store-button { display: inline-block; border: 1px solid #17202a; padding: 13px 19px; text-decoration: none; font-size: 14px; cursor: pointer; }
.store-button.dark { color: #fff; background: #17202a; }
.store-button:disabled { opacity: .45; cursor: not-allowed; }
.store-section { max-width: 1280px; margin: 0 auto; padding: 72px 6vw; }
.narrow-section { max-width: 1120px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; border-bottom: 1px solid #dfe1df; padding-bottom: 20px; margin-bottom: 28px; }
.section-heading h1, .section-heading h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: 38px; }
.sort-control { font-size: 13px; display: flex; align-items: center; gap: 10px; }
.sort-control select { border: 0; border-bottom: 1px solid #17202a; background: transparent; padding: 7px 2px; }
.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.product-card { background: #fff; border: 1px solid #dfe1df; }
.product-image-link { display: block; position: relative; background: #e6e2dc; }
.product-image { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; object-position: center; }
.product-label { position: absolute; top: 14px; left: 14px; padding: 6px 10px; color: #fff; background: #17202a; font-size: 11px; }
.product-card-body { min-height: 190px; padding: 20px; display: flex; flex-direction: column; justify-content: space-between; }
.product-card h3 { font-size: 18px; font-weight: 500; margin-bottom: 8px; }
.product-description { color: #697072; font-size: 14px; line-height: 1.5; }
.product-card-footer { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-top: 20px; }
.text-button, .remove-button, .back-link { border: 0; background: transparent; color: #17202a; text-decoration: none; cursor: pointer; font-size: 14px; padding: 0; }
.text-button span { margin-left: 12px; font-size: 20px; }
.store-status { color: #596164; padding: 22px 0; }
.store-status.error { color: #9d2d2d; }
.back-link { display: inline-block; margin-bottom: 30px; border-bottom: 1px solid #17202a; padding-bottom: 4px; }
.product-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7vw; align-items: center; }
.detail-image { width: 100%; max-height: 650px; object-fit: cover; border: 1px solid #dfe1df; }
.detail-copy h1 { font-size: clamp(42px, 5vw, 64px); }
.detail-price { font-size: 21px; margin-bottom: 25px; }
.detail-description { max-width: 470px; color: #596164; line-height: 1.7; margin-bottom: 18px; }
.stock-message { font-size: 14px; margin-bottom: 22px; }
.quantity-control { display: flex; align-items: center; gap: 15px; margin-bottom: 22px; font-size: 14px; }
.quantity-control input, .cart-item input { width: 70px; padding: 9px; border: 1px solid #aeb4b3; background: #fff; }
.cart-layout, .checkout-layout { display: grid; grid-template-columns: 1.5fr 1fr; gap: 50px; align-items: start; }
.cart-item { display: grid; grid-template-columns: 110px 1fr auto; gap: 20px; align-items: center; padding: 18px 0; border-bottom: 1px solid #dfe1df; }
.cart-item img { width: 110px; height: 110px; object-fit: cover; }
.cart-item h2, .order-summary h2, .checkout-form h2 { font-size: 17px; font-weight: 500; margin-bottom: 10px; }
.cart-item-copy p { margin-bottom: 14px; }
.cart-item-copy label { font-size: 13px; display: flex; align-items: center; gap: 9px; }
.remove-button { grid-column: 2; justify-self: start; color: #697072; }
.order-summary { background: #fff; border: 1px solid #dfe1df; padding: 25px; }
.order-summary > div { display: flex; justify-content: space-between; gap: 15px; padding: 10px 0; font-size: 14px; }
.summary-total { border-top: 1px solid #dfe1df; margin-top: 10px; padding-top: 18px !important; font-size: 17px !important; }
.full-width { display: block; width: 100%; text-align: center; margin-top: 20px; }
.empty-store, .success-page { max-width: 620px; margin: 80px auto; text-align: center; }
.empty-store h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: 34px; margin-bottom: 12px; }
.empty-store p, .success-page > p:not(.eyebrow):not(.order-number) { color: #596164; line-height: 1.6; margin-bottom: 25px; }
.checkout-form { background: #fff; border: 1px solid #dfe1df; padding: 28px; }
.checkout-form h2 + .form-grid { margin-bottom: 35px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid label { display: flex; flex-direction: column; gap: 7px; font-size: 13px; }
.form-grid label.wide { grid-column: 1 / -1; }
.form-grid input, .form-grid select { padding: 12px; border: 1px solid #aeb4b3; background: #fff; font: inherit; }
.form-note { color: #697072; font-size: 12px; line-height: 1.5; }
.order-number { color: #8d7964; margin-bottom: 28px; }
@media (max-width: 800px) {
  .store-header { padding: 16px 5vw; flex-wrap: wrap; }
  .store-nav { order: 3; width: 100%; justify-content: space-between; gap: 10px; }
  .shop-hero, .product-detail-grid, .cart-layout, .checkout-layout { grid-template-columns: 1fr; }
  .shop-hero-copy { padding: 65px 7vw; }
  .shop-hero-image { min-height: 320px; }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .product-grid { grid-template-columns: 1fr; }
  .section-heading { align-items: start; flex-direction: column; }
  .cart-item { grid-template-columns: 80px 1fr; }
  .cart-item img { width: 80px; height: 80px; }
  .cart-item > strong { grid-column: 2; }
  .remove-button { grid-column: 2; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid label.wide { grid-column: auto; }
}
