/* ============================================================
   ARROW X — asosiy stil fayli
   Rang sxemasi: qorong'i yashil-qora fon + orange urg'u
   ============================================================ */

:root {
  --bg-dark: #0e1a15;
  --bg-dark-2: #16241d;
  --bg-dark-3: #1c2c23;
  --accent-orange: #e8622e;
  --accent-orange-bright: #f07040;
  --text-light: #f5f4f0;
  --text-muted: #a9b3ac;
  --bg-page: #f7f6f3;
  --card-bg: #ffffff;
  --radius: 12px;
}

/* ===== UMUMIY YASHIRISH KLASSI ===== */
.hidden {
  display: none !important;
}

/* ===== UMUMIY ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
}

body {
  background: var(--bg-page);
  color: #1a1a1a;
}

/* ===== HEADER ===== */
.header {
  background: var(--bg-dark);
  color: var(--text-light);
  position: sticky;
  top: 0;
  z-index: 100;
}

.toast-container {
  position: fixed;
  right: 20px;
  bottom: 90px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 2000;
  pointer-events: none;
}

.toast {
  min-width: 260px;
  max-width: 340px;
  padding: 14px 18px;
  border-radius: 14px;
  background: rgba(15, 23, 20, 0.96);
  color: #fff;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
  border-left: 4px solid var(--accent-orange-bright);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  font-size: 14px;
  line-height: 1.5;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.hide {
  opacity: 0;
  transform: translateY(12px);
}

.toast-success {
  border-left-color: #2ecc71;
}

.toast-error {
  border-left-color: #e74c3c;
}

.toast-info {
  border-left-color: #3498db;
}

.connect-text {
color: white;
}


.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  gap: 16px;
  flex-wrap: wrap;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  white-space: nowrap;
}

.logo-img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 6px;
}

.logo-text {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text-light);
}

.logo-accent {
  color: var(--accent-orange-bright);
}

.search-wrapper {
  flex: 1;
  min-width: 200px;
}

#searchInput {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: none;
  font-size: 15px;
  background: var(--bg-dark-2);
  color: var(--text-light);
}

#searchInput::placeholder {
  color: var(--text-muted);
}

.header-icons {
  display: flex;
  gap: 10px;
}

.icon-btn {
  background: var(--bg-dark-2);
  border: none;
  color: var(--text-light);
  padding: 8px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 16px;
  position: relative;
  transition: background 0.15s, transform 0.1s;
}

.icon-btn:hover {
  background: var(--bg-dark-3);
}

.icon-btn:active {
  transform: scale(0.95);
}

.cart-count {
  background: var(--accent-orange-bright);
  color: #fff;
  border-radius: 50%;
  font-size: 12px;
  padding: 1px 6px;
  margin-left: 4px;
}

/* ===== KATEGORIYALAR ===== */
.categories {
  display: flex;
  gap: 10px;
  padding: 10px 20px;
  overflow-x: auto;
  background: var(--bg-dark-2);
}

.category-btn {
  background: transparent;
  border: 1px solid #3a463e;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: 0.2s;
  font-size: 14px;
}

.category-btn:hover {
  border-color: var(--accent-orange-bright);
  color: var(--accent-orange-bright);
}

.category-btn.active {
  background: var(--accent-orange-bright);
  color: #fff;
  border-color: var(--accent-orange-bright);
  font-weight: 600;
}

/* ===== HERO (LANDING) ===== */
.hero {
  background: var(--bg-dark);
  color: var(--text-light);
  padding: 60px 24px;
  text-align: left;
  position: relative;
  overflow: hidden;
}

.hero-label {
  color: var(--accent-orange-bright);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 3px;
  margin-bottom: 16px;
}

.hero-title {
  font-size: 42px;
  font-weight: 800;
  line-height: 1.15;
  max-width: 700px;
  margin-bottom: 18px;
}

.hero-accent {
  color: var(--accent-orange-bright);
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 16px;
  max-width: 560px;
  line-height: 1.6;
  margin-bottom: 28px;
}

.hero-cta {
  background: var(--accent-orange-bright);
  color: #fff;
  border: none;
  padding: 14px 26px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.hero-cta:hover {
  background: var(--accent-orange);
  transform: translateY(-1px);
}

/* ===== NEGA AYNAN BIZ / AFZALLIKLAR ===== */
.advantages {
  background: var(--bg-dark-2);
  color: var(--text-light);
  padding: 50px 24px;
}

.advantages-label {
  color: var(--accent-orange-bright);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 3px;
  text-align: center;
  margin-bottom: 8px;
}

.advantages-title {
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 34px;
}

.advantages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto;
}

.advantage-card {
  background: var(--bg-dark-3);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
}

.advantage-icon {
  font-size: 30px;
  margin-bottom: 12px;
}

.advantage-card h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

.advantage-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ===== ASOSIY QISM ===== */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px 90px;
}

.section-title {
  margin-bottom: 16px;
  font-size: 20px;
  font-weight: 700;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 18px;
}

.product-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(14,26,21,0.07);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 24px rgba(14,26,21,0.15);
}

.product-card:active {
  transform: translateY(-2px) scale(0.99);
}

.product-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: #eee;
}

/* ===== STATUS BADGE (rangli holat belgisi) ===== */
.card-status-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: bold;
  color: #fff;
  z-index: 2;
}

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: bold;
  color: #fff;
  width: fit-content;
}

.status-mavjud { background: #2e9e5b; }
.status-buyurtma { background: var(--accent-orange); }
.status-tugagan { background: #c0392b; }

.product-card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.product-card-name {
  font-size: 15px;
  font-weight: 600;
  min-height: 38px;
}

.product-card-category {
  font-size: 12px;
  color: #888;
}

.product-card-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-orange);
  margin-top: auto;
}

/* ===== KREATIV YUKLANISH ANIMATSIYASI (o'q nishonga tegadi) ===== */
.loading-wrapper {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 0 20px;
  gap: 14px;
}

.target-loader {
  width: 170px;
}

.target-loader-svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.target-ring-outer {
  fill: none;
  stroke: var(--bg-dark);
  stroke-width: 3;
  opacity: 0.85;
}

.target-ring-mid {
  fill: none;
  stroke: var(--accent-orange);
  stroke-width: 3;
  opacity: 0.85;
}

.target-ring-inner {
  fill: var(--accent-orange-bright);
}

.target-impact-ripple {
  fill: none;
  stroke: var(--accent-orange-bright);
  stroke-width: 2;
  transform-origin: 130px 60px;
  animation: ripple 1.6s ease-out infinite;
}

.arrow-group {
  animation: arrow-fly 1.6s ease-in-out infinite;
  transform-origin: 20px 60px;
}

.arrow-shaft {
  stroke: var(--bg-dark);
}

.arrow-head {
  fill: var(--bg-dark);
}

.arrow-fletching {
  stroke: var(--accent-orange);
  fill: none;
}

/* O'q chapdan nishonga qarab uchadi, urilgach yo'qoladi, so'ng
   (ko'rinmas holatda, opacity:0) boshlanish nuqtasiga qaytadi —
   shu bois sakrash/"teskari otilish" effekti bo'lmaydi. */
@keyframes arrow-fly {
  0%   { transform: translateX(-40px); opacity: 0; }
  18%  { opacity: 1; }
  62%  { transform: translateX(0); opacity: 1; }
  72%  { opacity: 0; }
  100% { transform: translateX(-40px); opacity: 0; }
}

@keyframes ripple {
  0%, 60% { r: 8; opacity: 0; }
  68% { opacity: 0.9; }
  100% { r: 24; opacity: 0; }
}

.loading-text-label {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
}

.skeleton-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 18px;
}

.skeleton-card {
  height: 260px;
  border-radius: var(--radius);
  background: linear-gradient(100deg, #ececec 30%, #f7f7f7 50%, #ececec 70%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  0% { background-position: 150% 0; }
  100% { background-position: -50% 0; }
}

/* ===== MODAL (umumiy) ===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(14,26,21,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #fff;
  border-radius: 16px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  position: relative;
}

.close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  background: #f0eeec;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.15s;
}

.close-btn:hover {
  background: #e5e2df;
}

/* ===== MAHSULOT TAFSILOTLARI ===== */
.product-detail {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.product-gallery {
  flex: 1;
  min-width: 260px;
}

.main-image {
  width: 100%;
  height: 320px;
  object-fit: cover;
  border-radius: var(--radius);
  background: #eee;
}

.thumbnail-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.thumbnail-row img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
}

.thumbnail-row img.active {
  border-color: var(--accent-orange-bright);
}

.product-info {
  flex: 1;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-category-tag {
  color: #888;
  font-size: 13px;
  text-transform: uppercase;
}

.product-price {
  font-size: 24px;
  font-weight: 800;
  color: var(--accent-orange);
}

.product-description {
  color: #444;
  line-height: 1.5;
}

.qty-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.qty-row input {
  width: 70px;
  padding: 6px;
  border: 1px solid #ccc;
  border-radius: 8px;
}

.btn-primary {
  background: var(--accent-orange-bright);
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-weight: 700;
  cursor: pointer;
  font-size: 15px;
  transition: background 0.15s, transform 0.1s;
}

.btn-primary:hover {
  background: var(--accent-orange);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.related-section {
  margin-top: 30px;
  border-top: 1px solid #eee;
  padding-top: 20px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-top: 12px;
}

/* ===== FORMALAR (auth, profil va h.k. — index.html'da ishlatiladi) ===== */
.admin-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 12px;
}

.admin-form h2 {
  margin-bottom: 4px;
}

.admin-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: #333;
}

.admin-form input,
.admin-form select,
.admin-form textarea {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
}

.auth-error {
  background: #fdecea;
  color: #c0392b;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 10px;
}

.auth-switch {
  font-size: 14px;
  color: #666;
  text-align: center;
}

.auth-switch a,
.forgot-password-link {
  color: var(--accent-orange);
  text-decoration: none;
  font-weight: 600;
}

.forgot-password-link {
  font-size: 13px;
  align-self: flex-end;
}

.profile-view {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0;
  font-size: 15px;
}

.profile-view strong {
  color: #555;
}

.profile-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--bg-dark);
  color: var(--text-light);
  padding: 40px 24px 20px;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 30px;
  max-width: 1100px;
  margin: 0 auto 30px;
}

.footer-tagline {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 10px;
  line-height: 1.5;
  max-width: 280px;
}

.footer-col h4 {
  font-size: 14px;
  margin-bottom: 12px;
  color: var(--text-light);
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-col li {
  color: var(--text-muted);
  font-size: 14px;
}

.footer-bottom {
  border-top: 1px solid #26362c;
  padding-top: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  max-width: 1100px;
  margin: 0 auto;
}

/* ===== MOBIL PASTKI NAVIGATSIYA (Uzum Market uslubida) ===== */
.bottom-nav {
  display: none; /* faqat mobil qurilmalarda ko'rinadi */
}

/* ===== RESPONSIV ===== */
@media (max-width: 600px) {
  .hero-title {
    font-size: 30px;
  }
  .product-detail {
    flex-direction: column;
  }
  .footer-top {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  body {
    padding-bottom: 64px; /* pastki nav bosib qolmasligi uchun joy */
  }

  /* Mobilda header'dagi buyurtmalar/profil/savatcha ikonkalari yashiriladi —
     ular endi faqat pastki navigatsiyada bo'ladi */
  .header-icons {
    display: none;
  }

  .header-top {
    flex-wrap: nowrap;
  }

  .hero {
    padding: 40px 20px;
  }

  .products-grid,
  .skeleton-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .product-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    object-fit: cover;
  }

  .skeleton-card {
    height: 0;
    padding-bottom: 100%;
  }

  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-dark);
    z-index: 150;
    padding: 6px 0 max(6px, env(safe-area-inset-bottom));
    box-shadow: 0 -2px 12px rgba(0,0,0,0.15);
  }

  .bottom-nav-btn {
    flex: 1;
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 0;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 11px;
    transition: color 0.15s;
  }

  .bottom-nav-btn.active {
    color: var(--accent-orange-bright);
  }

  #bbbb{
    width: 22px;
    height: 22px;
    flex: 1;
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 4px 0;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    transition: color 0.15s;

  }
  .bottom-nav-icon {
    width: 22px;
    height: 20px;
  }

  .bottom-nav-icon-wrapper {
    position: relative;
    display: inline-block;
  }

  .bottom-nav-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    background: var(--accent-orange-bright);
    color: #fff;
    font-size: 10px;
    border-radius: 50%;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
  }
}
