:root {
  --header-bg: #111723;
  --header-border: #202839;
  --text-main: #f2f6ff;
  --text-muted: #c6cedf;
  --control-bg: #0d131f;
  --control-border: #2a3244;
  --accent: #f3bf2c;
  --card-bg: #ffffff;
  --card-border: #eef1f5;
  --bg-light: #f5f6fa;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background: #f0f2f5;
  color: #222a38;
}

.product-container {
  max-width: 1260px;
  margin: 0 auto;
  padding: 12px;
}

.breadcrumb {
  font-size: 14px;
  color: #707a8f;
  margin-bottom: 12px;
}

.breadcrumb a {
  color: #707a8f;
  text-decoration: none;
}

.breadcrumb span {
  margin: 0 8px;
}

/* Product Header */
.product-header {
  background: white;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}

.product-header-img {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  object-fit: cover;
}

.product-header-info h1 {
  margin: 0 0 4px;
  font-size: 18px;
  color: #1a202c;
}

.product-badges {
  display: flex;
  gap: 6px;
  margin-bottom: 4px;
}

.badge {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  color: #00b67a;
  background: #e6f7f0;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 600;
}

.product-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #707a8f;
}

.rating {
  color: #f3bf2c;
  font-weight: 700;
}

/* Main Content Grid */
.product-main-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 12px;
  align-items: start;
}

/* Items Grid */
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.item-card {
  background: white;
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  position: relative;
}

.item-card:hover {
  border-color: #f3bf2c;
  transform: translateY(-2px);
}

.item-card.active {
  border-color: #f3bf2c;
  background: #fffdf5;
}

.item-card img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 12px;
}

.item-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #2d3748;
}

.item-price-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.current-price {
  color: #ff8a00;
  font-size: 18px;
  font-weight: 700;
}

.original-price {
  color: #a0aec0;
  font-size: 13px;
  text-decoration: line-through;
}

.discount-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #fff5f5;
  color: #f56565;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Sidebar / Order Form */
.order-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 0;
}

@media (min-width: 1025px) {
  .order-sidebar {
    margin-top: 18px;
  }
}

.order-card {
  background: white;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}

.order-card h3 {
  margin: 0 0 12px;
  font-size: 16px;
  color: #2d3748;
}

.input-group {
  margin-bottom: 16px;
}

.input-group label {
  display: block;
  font-size: 13px;
  color: #707a8f;
  margin-bottom: 6px;
}

.input-group input {
  width: 100%;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  outline: none;
  font-size: 14px;
}

.qty-selector {
  display: flex;
  align-items: center;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  width: fit-content;
  overflow: hidden;
}

.qty-btn {
  padding: 8px 16px;
  background: #f7fafc;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: #4a5568;
}

.qty-input {
  width: 50px;
  text-align: center;
  border: none;
  border-left: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  font-weight: 600;
}

.price-summary {
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid #edf2f7;
}

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.total-label {
  font-size: 14px;
  color: #707a8f;
}

.total-amount {
  font-size: 24px;
  font-weight: 800;
  color: #ff8a00;
}

.buy-btn {
  width: 100%;
  padding: 12px;
  background: #f3bf2c;
  border: none;
  border-radius: 8px;
  color: #1a202c;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.2s;
}

.buy-btn:hover {
  filter: brightness(0.95);
}

.security-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  color: #00b67a;
  margin-top: 8px;
}

@media (max-width: 1024px) {
  .product-main-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .order-sidebar {
    position: static;
    margin-top: 0;
    width: 100%;
  }
}

@media (max-width: 768px) {
  .product-container {
    padding: 12px var(--page-pad-x, 16px) 16px;
  }

  .product-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }

  .product-header-img {
    width: 100%;
    max-width: 180px;
    height: auto;
  }

  .product-header-info {
    width: 100%;
  }

  .product-stats {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .items-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .order-card {
    padding: 20px;
  }

  .input-group input,
  .qty-selector {
    width: 100%;
  }

  .qty-selector {
    justify-content: space-between;
  }
}

@media (max-width: 520px) {
  .items-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .item-card {
    padding: 8px 6px;
  }

  .item-card img {
    width: 44px;
    height: 44px;
    margin-bottom: 6px;
  }

  .item-name {
    font-size: 10px;
    margin-bottom: 4px;
    line-height: 1.25;
    min-height: 2.5em;
  }

  .current-price {
    font-size: 12px;
  }

  .original-price {
    font-size: 9px;
  }

  .product-container {
    padding-top: 11px;
    padding-left: var(--page-pad-x-sm, 12px);
    padding-right: var(--page-pad-x-sm, 12px);
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }

  .product-header {
    gap: 12px;
  }

  .product-header-info h1 {
    font-size: 22px;
  }

  .buy-btn {
    font-size: 15px;
  }

  .total-amount {
    font-size: 20px;
  }
}
