/* Reset */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: system-ui; background: #f6f7f9; }

.container { padding: 12px; }

/* Header */
.header-left {
  position: absolute;
  left: 15px;
}

.user-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  object-fit: cover;
  border: 2px solid #fff;
  transition: transform 0.2s;
  position: relative;
  top: -8px;
}

.user-icon:hover { transform: scale(1.1); }

/* User modal */
.user-modal {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  justify-content: center; align-items: center;
  z-index: 1000;
}

.user-modal-content {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  width: 90%;
  max-width: 360px;
  text-align: center;
  position: relative;
}

.close-user {
  position: absolute;
  top: 10px; right: 12px;
  cursor: pointer;
  font-size: 18px;
}

.avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin-bottom: 10px;
  object-fit: cover;
}

.user-orders {
  margin-top: 16px;
  max-height: 200px;
  overflow-y: auto;
}

.user-orders div {
  background: #f0f0f0;
  padding: 8px;
  border-radius: 10px;
  margin-bottom: 8px;
  font-size: 14px;
  text-align: left;
}

.order-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f0f0f0;
  padding: 8px;
  border-radius: 10px;
  margin-bottom: 8px;
  font-size: 14px;
}

.order-status {
  font-weight: 700;
  text-transform: capitalize;
}

/* Header */
.site-header {
  text-align: center;
  padding: 16px 0;
  background: linear-gradient(90deg, #ff7e5f, #feb47b);
  border-radius: 12px;
  margin-bottom: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.site-header h1 {
  font-size: 28px;
  color: #fff;
  font-weight: 700;
  letter-spacing: 1px;
}

/* Cart total */
.cart-total {
  font-size: 16px;
  font-weight: 700;
  margin-top: 12px;
  padding: 8px;
  background: #f0f0f0;
  border-radius: 12px;
  text-align: right;
  color: #000;
}

/* Banner */
.banner-slider {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  margin-bottom: 12px;
  padding-bottom: 8px;
}
.banner-slider img {
  min-width: 250px;
  max-width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 12px;
  flex-shrink: 0;
}
.banner-slider::-webkit-scrollbar { display: none; }

/* Product grid */
.product-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (min-width: 520px) {
  .product-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .product-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Product card */
.card {
  background: #fff;
  border-radius: 16px;
  padding: 10px;
  box-shadow: 0 4px 10px rgba(0,0,0,.06);
  transition: transform .2s;
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 6px 14px rgba(0,0,0,0.12);
}

.card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #f3f3f3;
  border-radius: 12px;
  display: block;
}

.card h4 { font-size: 14px; margin: 8px 0 4px; }
.card div { font-size: 13px; margin-bottom: 4px; }
.card button {
  width: 100%; padding: 8px; border-radius: 12px;
  border: none; background: #000; color: #fff;
  cursor: pointer; font-weight: 600;
}

/* Variant */
.variant { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.variant span { font-size: 12px; padding: 4px 8px; background: #eee; border-radius: 8px; cursor: pointer; }
.variant span.selected { background: #000; color: #fff; }

/* Load more button */
.load-more { 
  width: 100%; 
  margin: 14px 0; 
  padding: 10px; 
  border-radius: 14px; 
  border: none; 
  cursor: pointer;
  background: #000;
  color: #fff;
  font-weight: 600;
}

/* Cart sidebar */
.cart {
  position: fixed;
  top: 0;
  right: -100%;
  width: 80%;
  max-width: 400px;
  height: 100%;
  background: #fff;
  box-shadow: -4px 0 20px rgba(0,0,0,.2);
  padding: 16px;
  transition: right .3s;
  z-index: 999;
  display: flex;
  flex-direction: column;
}
.cart.open { right: 0; }
.cart h3 { margin-bottom: 12px; font-size: 18px; }
.cart #cartItems { flex: 1; overflow-y: auto; }
.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #eee;
}
.cart-item button {
  background: red; color: #fff; border: none; padding: 2px 6px; border-radius: 6px; cursor: pointer;
}

/* Cart toggle button */
.cart-btn {
  position: fixed;
  bottom: 16px;
  right: 16px;
  background: #000;
  color: #fff;
  padding: 16px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  z-index: 100;
}

/* Cart sidebar buttons */
.cart button {
  font-weight: 600;
  border: none;
  cursor: pointer;
  border-radius: 12px;
  padding: 10px 14px;
  margin-top: 12px;
  transition: transform 0.2s, box-shadow 0.2s;
}

/* Zakaz berish button */
.checkout-btn {
  background: #000;
  color: #fff;
  width: 100%;
  font-size: 16px;
}
.checkout-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

/* Yopish button */
.cart .close {
  background: #000;
  color: #fff;
  width: 100%;
  font-size: 16px;
}
.cart .close:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

/* Cart actions */
.cart-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.cart-actions button {
  flex: 1;
  padding: 10px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border: none;
}

/* Savatni bo'shatish tugmasi */
.clear-cart {
  background: #fff;
  color: #000;
  border: 1px solid #ccc;
}
.clear-cart:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* Product modal */
.product-modal {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.product-modal-content {
  background: #fff;
  border-radius: 20px;
  padding: 20px;
  width: 90%;
  max-width: 450px;
  text-align: center;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.close-product {
  position: absolute;
  top: 12px;
  right: 16px;
  cursor: pointer;
  font-size: 20px;
  font-weight: bold;
}

.modal-image-container {
  width: 100%;
  max-height: 60vh;
  overflow: hidden;
  border-radius: 16px;
  margin-bottom: 12px;
}

.modal-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.modal-price {
  font-weight: 700;
  font-size: 12px;
  margin: 10px 0;
}

.product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 12px;
  background: #f5f5f5;
}

.product-card h3 {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  margin: 8px 0 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card .price {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
}

.product-card .variants {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.product-card button {
  margin-top: auto;
  height: 40px;
  border-radius: 20px;
  font-size: 14px;
}

/* ============================================
   PAYMENT MODAL
   ============================================ */

.payment-modal {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  justify-content: center;
  align-items: center;
  z-index: 2500;
  overflow-y: auto;
  padding: 20px 0;
}

.payment-modal-content {
  background: #fff;
  border-radius: 20px;
  padding: 20px;
  width: 90%;
  max-width: 500px;
  position: relative;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.close-payment {
  position: absolute;
  top: 12px;
  right: 16px;
  cursor: pointer;
  font-size: 20px;
  font-weight: bold;
}

.payment-modal-content h3 {
  margin-bottom: 20px;
  font-size: 20px;
}

/* Form styles */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  font-family: system-ui;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #000;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.total-display {
  font-size: 18px;
  font-weight: 700;
  color: #000;
  background: #f0f0f0;
  padding: 10px;
  border-radius: 8px;
}

/* Form row (для MD/YY и CVV) */
.form-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
}

/* Payment buttons */
.payment-buttons {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.payment-buttons button {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.payment-buttons .checkout-btn {
  background: #000;
  color: #fff;
}

.payment-buttons .checkout-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

.payment-buttons .cancel-btn {
  background: #ddd;
  color: #000;
}

.payment-buttons .cancel-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* ============================================
   AGE MODAL
   ============================================ */

.age-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.age-box {
  background: #fff;
  width: 90%;
  max-width: 360px;
  border-radius: 16px;
  padding: 22px;
  text-align: left;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.age-box h2 {
  font-size: 20px;
  margin-bottom: 10px;
}

.age-info {
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 14px;
}

.age-box h3 {
  margin-bottom: 12px;
}

.age-buttons {
  display: flex;
  gap: 12px;
}

.age-buttons button {
  flex: 1;
  height: 42px;
  border-radius: 22px;
  border: none;
  font-size: 15px;
  cursor: pointer;
}

#yesAge {
  background: black;
  color: white;
}

#noAge {
  background: #ddd;
}

.age-warning {
  display: none;
  margin-top: 12px;
  color: red;
  font-size: 14px;
  font-weight: 500;
}

/* ===============================
   GAME MODAL
================================ */

.game-modal{
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 10000;
}

.game-modal iframe{
  width: 100%;
  height: 100%;
  border: none;
}
