/* ========== Shop public CSS ========== */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans Thai', sans-serif;
  background: #f5f5f7;
  color: #1d1d1f;
  line-height: 1.5;
}
a { color: #0066cc; text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: #6e6e73; }
.small { font-size: 0.85em; }
.error { color: #d70015; margin-top: 8px; min-height: 18px; }

/* Header */
.shop-header {
  background: #fff;
  border-bottom: 1px solid #d2d2d7;
  position: sticky;
  top: 0;
  z-index: 50;
}
.shop-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 20px;
}
.shop-logo {
  font-size: 1.3em;
  font-weight: bold;
  color: #1d1d1f;
}
.shop-nav {
  display: flex;
  gap: 18px;
  flex: 1;
  flex-wrap: wrap;
}
.shop-nav a {
  color: #424245;
  font-size: 0.95em;
}
.shop-user {
  display: flex;
  align-items: center;
  gap: 12px;
}
.shop-user-name { color: #424245; font-size: 0.9em; }
.shop-login-btn, .shop-cart-btn {
  padding: 6px 14px;
  background: #0066cc;
  color: #fff;
  border-radius: 18px;
  font-size: 0.9em;
}
.shop-login-btn:hover, .shop-cart-btn:hover {
  background: #0055aa;
  text-decoration: none;
  color: #fff;
}
.shop-link-btn {
  background: none;
  border: none;
  color: #0066cc;
  cursor: pointer;
  font-size: 0.85em;
}

/* Main */
.shop-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 20px;
  min-height: 60vh;
}

.shop-hero {
  text-align: center;
  padding: 40px 20px;
  background: linear-gradient(135deg, #4a9eff 0%, #0066cc 100%);
  color: #fff;
  border-radius: 12px;
  margin-bottom: 30px;
}
.shop-hero h1 { font-size: 2.5em; margin: 0 0 10px; }
.shop-hero p { margin: 0; font-size: 1.1em; opacity: 0.9; }

.shop-section { margin-bottom: 40px; }
.shop-section h1, .shop-section h2 { margin-top: 0; }

.breadcrumb {
  margin-bottom: 20px;
  color: #6e6e73;
  font-size: 0.9em;
}

/* Category grid */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.cat-card {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  display: block;
  color: #1d1d1f;
  transition: transform 0.15s, box-shadow 0.15s;
}
.cat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  text-decoration: none;
}
.cat-card img {
  width: 100%;
  height: 80px;
  object-fit: contain;
  margin-bottom: 8px;
}
.cat-icon {
  font-size: 3em;
  margin-bottom: 8px;
}
.cat-name {
  font-weight: 500;
}

/* Product grid */
.prod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 20px;
}
.prod-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  display: block;
  color: #1d1d1f;
  transition: transform 0.15s, box-shadow 0.15s;
}
.prod-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  text-decoration: none;
}
.prod-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}
.prod-noimg {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4em;
  background: #f0f0f3;
}
.prod-name {
  padding: 12px 14px 4px;
  font-weight: 500;
}
.prod-price {
  padding: 0 14px 14px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.price-thb { color: #34c759; font-weight: bold; }
.price-dia { color: #5ac8fa; font-weight: bold; }
.price-ig  { color: #ff9500; font-weight: bold; }

/* Product detail */
.prod-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  background: #fff;
  border-radius: 10px;
  padding: 30px;
}
@media (max-width: 720px) {
  .prod-detail { grid-template-columns: 1fr; }
}
.prod-detail-img img {
  width: 100%;
  border-radius: 8px;
}
.prod-noimg-big {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8em;
  background: #f0f0f3;
  border-radius: 8px;
}
.prod-detail-info h1 { margin-top: 0; }
.prod-desc { margin: 15px 0; color: #424245; }
.prod-price-big {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin: 20px 0;
  font-size: 1.5em;
}

.prod-options { margin: 20px 0; }
.opt-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid #d2d2d7;
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
}
.opt-row:has(input:checked) {
  border-color: #0066cc;
  background: #e3f2ff;
}
.opt-img { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; }
.opt-name { flex: 1; }
.opt-price { color: #34c759; font-weight: bold; }

.prod-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 20px;
}
.prod-actions select {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #d2d2d7;
  background: #fff;
  font-size: 1em;
}
.btn-buy {
  padding: 12px 24px;
  background: #0066cc;
  color: #fff;
  border: none;
  border-radius: 24px;
  font-size: 1em;
  cursor: pointer;
}
.btn-buy:hover { background: #0055aa; }
.btn-buy:disabled { background: #c7c7cc; cursor: not-allowed; }

/* Cart */
.wallet-info {
  background: #fff;
  padding: 14px 20px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 1.1em;
  border: 1px solid #d2d2d7;
}
.cart-list { display: flex; flex-direction: column; gap: 12px; }
.cart-item {
  background: #fff;
  border-radius: 10px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.cart-item img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
}
.prod-noimg-sm {
  width: 80px;
  height: 80px;
  background: #f0f0f3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2em;
  border-radius: 6px;
}
.cart-item-info { flex: 1; }
.cart-item-name { font-weight: 500; }
.btn-link {
  background: none;
  border: 1px solid #d2d2d7;
  color: #d70015;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
}
.btn-link:hover { background: #fff0f0; }

.cart-actions { text-align: center; margin-top: 30px; }

/* Login */
.login-section {
  max-width: 420px;
  margin: 40px auto;
  background: #fff;
  padding: 30px;
  border-radius: 10px;
}
.login-form label {
  display: block;
  margin: 15px 0;
  color: #424245;
  font-size: 0.9em;
}
.login-form input {
  width: 100%;
  padding: 10px;
  margin-top: 5px;
  border: 1px solid #d2d2d7;
  border-radius: 8px;
  font-size: 1em;
}
.login-form input:focus { outline: none; border-color: #0066cc; }
.login-form button[type="submit"] {
  width: 100%;
  margin-top: 15px;
}

/* Footer */
.shop-footer {
  text-align: center;
  padding: 30px 20px;
  border-top: 1px solid #d2d2d7;
  margin-top: 60px;
  color: #6e6e73;
  font-size: 0.85em;
}
