/* ==========================================
   iPhoneShop — Стилі
   ========================================== */
:root {
  --bg: #0a0a0a;
  --bg2: #111111;
  --bg3: #181818;
  --border: #222222;
  --border2: #2e2e2e;
  --white: #f0ece3;
  --muted: #777777;
  --accent: #ff4c1f;
  --gold: #ffb347;
  --green: #3ecf6e;
  --red: #ff4444;
  --radius: 10px;
  --radius-lg: 14px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Golos Text', sans-serif;
  background: var(--bg);
  color: var(--white);
  font-size: 15px;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 1.2rem; }

h1, h2, h3, .ub { font-family: 'Unbounded', sans-serif; }

/* ---- NAVBAR ---- */
.navbar {
  background: rgba(10,10,10,.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: .7rem 0;
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.nav-logo {
  font-family: 'Unbounded', sans-serif;
  font-size: .9rem;
  font-weight: 900;
  color: var(--white);
  white-space: nowrap;
}
.nav-logo span { color: var(--accent); }
.nav-cats {
  display: flex;
  gap: .2rem;
  flex: 1;
  flex-wrap: wrap;
}
.nav-cat {
  font-size: 12px;
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 99px;
  transition: color .15s, background .15s;
}
.nav-cat:hover, .nav-cat.active { color: var(--white); background: var(--bg3); }
.nav-actions { display: flex; align-items: center; gap: .8rem; }
.nav-link {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color .15s;
}
.nav-link:hover { color: var(--white); }
.admin-link { color: var(--gold) !important; }
.cart-btn {
  position: relative;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 7px 14px;
  border-radius: 99px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  transition: opacity .15s;
  text-decoration: none;
}
.cart-btn:hover { opacity: .88; }
.cart-count {
  background: #fff;
  color: var(--accent);
  border-radius: 99px;
  font-size: 10px;
  font-weight: 900;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* ---- HERO ---- */
.hero {
  text-align: center;
  padding: 4rem 1rem 3rem;
  border-bottom: 1px solid var(--border);
}
.hero-tag {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-family: 'Unbounded', sans-serif;
  padding: 3px 16px;
  border-radius: 99px;
  margin-bottom: 1.2rem;
  letter-spacing: .08em;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -.02em;
  margin-bottom: .7rem;
}
.hero h1 em { color: var(--accent); font-style: normal; }
.hero p { color: var(--muted); max-width: 480px; margin: 0 auto 2rem; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 13px;
  font-family: 'Unbounded', sans-serif;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: opacity .15s, transform .12s;
  text-decoration: none;
}
.btn:hover { opacity: .88; transform: translateY(-1px); }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-secondary { background: var(--bg3); color: var(--white); border: 1px solid var(--border2); }
.btn-ghost { background: transparent; color: var(--white); border: 1px solid var(--border2); }
.btn-green { background: var(--green); color: #0a0a0a; }
.btn-sm { font-size: 11px; padding: 7px 14px; font-family: 'Golos Text', sans-serif; font-weight: 600; }

/* ---- STATS ---- */
.stats-bar {
  display: flex;
  border-bottom: 1px solid var(--border);
}
.stat {
  flex: 1;
  padding: 1.2rem .5rem;
  text-align: center;
  border-right: 1px solid var(--border);
}
.stat:last-child { border-right: none; }
.stat-n { font-family: 'Unbounded', sans-serif; font-size: 1.4rem; font-weight: 900; color: var(--gold); }
.stat-l { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* ---- FILTERS ---- */
.catalog-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.5rem 0 1rem;
}
.filters { display: flex; gap: 7px; flex-wrap: wrap; flex: 1; }
.f-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 5px 16px;
  border-radius: 99px;
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
  font-family: 'Golos Text', sans-serif;
}
.f-btn:hover, .f-btn.on {
  border-color: var(--accent);
  color: var(--white);
  background: rgba(255,76,31,.1);
}
.sort-sel {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--white);
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-family: 'Golos Text', sans-serif;
  cursor: pointer;
  outline: none;
}

/* ---- PRODUCT GRID ---- */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
  padding-bottom: 3rem;
}
.product-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: border-color .18s, transform .18s;
  display: flex;
  flex-direction: column;
}
.product-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.product-card.is-hot { border-color: rgba(255,76,31,.35); }
.card-img-wrap { position: relative; }
.card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: #161616;
  display: block;
}
.card-hot-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-family: 'Unbounded', sans-serif;
  padding: 2px 9px;
  border-radius: 99px;
  font-weight: 700;
}
.card-stock-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,.6);
  color: var(--muted);
  font-size: 9px;
  padding: 2px 9px;
  border-radius: 99px;
}
.card-body { padding: .85rem; flex: 1; display: flex; flex-direction: column; }
.card-name {
  font-family: 'Unbounded', sans-serif;
  font-size: .65rem;
  font-weight: 700;
  margin-bottom: .3rem;
  line-height: 1.3;
}
.card-spec { font-size: 11px; color: var(--muted); margin-bottom: .8rem; line-height: 1.4; flex: 1; }
.card-battery { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; color: var(--green); margin-bottom: .5rem; }
.card-prices { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: .7rem; }
.p-old { font-size: 11px; color: var(--muted); text-decoration: line-through; }
.p-new { font-family: 'Unbounded', sans-serif; font-size: .9rem; font-weight: 900; color: var(--gold); }
.p-disc { font-size: 9px; background: #1a2e00; color: #7dd03f; padding: 2px 7px; border-radius: 99px; font-weight: 600; }
.add-to-cart {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--white);
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-family: 'Golos Text', sans-serif;
  transition: all .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.add-to-cart:hover { background: var(--accent); border-color: var(--accent); }
.out-of-stock { opacity: .5; cursor: not-allowed; }

/* ---- PRODUCT PAGE ---- */
.product-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  padding: 2rem 0 3rem;
}
@media (max-width: 700px) { .product-layout { grid-template-columns: 1fr; } }
.product-gallery img {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: #161616;
  max-height: 420px;
  object-fit: contain;
}
.product-info .pi-tag {
  display: inline-block;
  font-size: 10px;
  border: 1px solid var(--border2);
  color: var(--muted);
  padding: 2px 10px;
  border-radius: 99px;
  margin-bottom: .8rem;
}
.product-info h1 { font-size: 1.5rem; margin-bottom: .5rem; }
.product-info .pi-spec { color: var(--muted); font-size: 13px; margin-bottom: 1.2rem; }
.pi-price-row { display: flex; align-items: center; gap: 12px; margin-bottom: 1.5rem; flex-wrap: wrap; }
.pi-price-new { font-family: 'Unbounded', sans-serif; font-size: 1.8rem; font-weight: 900; color: var(--gold); }
.pi-price-old { font-size: 1rem; color: var(--muted); text-decoration: line-through; }
.pi-features { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 1.5rem; }
.pi-feat {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .6rem .8rem;
  font-size: 12px;
}
.pi-feat strong { display: block; font-size: 10px; color: var(--muted); margin-bottom: 2px; font-weight: 500; }
.pi-desc { color: var(--muted); font-size: 13px; line-height: 1.7; margin-bottom: 1.5rem; }
.pi-add-btn { width: 100%; padding: 14px; font-size: 14px; border-radius: 10px; margin-bottom: .7rem; }

/* ---- CART ---- */
.cart-layout { display: grid; grid-template-columns: 1fr 340px; gap: 1.5rem; padding: 2rem 0 3rem; }
@media (max-width: 800px) { .cart-layout { grid-template-columns: 1fr; } }
.cart-item {
  display: flex;
  gap: 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 10px;
  align-items: center;
}
.ci-img {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 8px;
  background: #161616;
  flex-shrink: 0;
}
.ci-info { flex: 1; min-width: 0; }
.ci-name { font-family: 'Unbounded', sans-serif; font-size: .62rem; font-weight: 700; margin-bottom: 3px; }
.ci-spec { font-size: 11px; color: var(--muted); margin-bottom: .5rem; }
.qty-ctrl { display: flex; align-items: center; gap: 8px; }
.qty-btn {
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--white);
  width: 28px; height: 28px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .15s;
}
.qty-btn:hover { border-color: #555; }
.ci-price { font-family: 'Unbounded', sans-serif; font-size: .9rem; font-weight: 900; color: var(--gold); white-space: nowrap; }
.ci-remove { background: transparent; border: none; color: var(--muted); cursor: pointer; font-size: 1.1rem; padding: 4px; transition: color .15s; }
.ci-remove:hover { color: var(--red); }

.cart-summary {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  position: sticky;
  top: 80px;
  height: fit-content;
}
.cs-title { font-family: 'Unbounded', sans-serif; font-size: .75rem; font-weight: 700; margin-bottom: 1rem; }
.cs-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: .5rem; }
.cs-total { display: flex; justify-content: space-between; padding-top: .8rem; border-top: 1px solid var(--border); font-family: 'Unbounded', sans-serif; font-size: .85rem; font-weight: 700; color: var(--gold); margin: .5rem 0 1rem; }
.checkout-btn { width: 100%; padding: 13px; font-size: 13px; border-radius: 9px; }

/* ---- FORMS ---- */
.form-section { max-width: 420px; margin: 2rem auto 3rem; }
.form-section h1 { font-size: 1.1rem; margin-bottom: .3rem; }
.form-sub { font-size: 13px; color: var(--muted); margin-bottom: 1.5rem; }
.form-tabs { display: flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; margin-bottom: 1.5rem; }
.form-tab {
  flex: 1; padding: 9px; background: transparent; border: none;
  color: var(--muted); cursor: pointer; font-size: 13px;
  font-family: 'Golos Text', sans-serif; transition: all .15s;
}
.form-tab.on { background: var(--accent); color: #fff; font-weight: 600; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; letter-spacing: .04em; }
.field input, .field textarea, .field select {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 13px;
  color: var(--white);
  font-size: 14px;
  font-family: 'Golos Text', sans-serif;
  outline: none;
  transition: border-color .15s;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 80px; }
.form-btn { width: 100%; padding: 11px; font-size: 13px; border-radius: 9px; margin-top: .3rem; }
.alert { padding: .75rem 1rem; border-radius: 8px; font-size: 13px; margin-bottom: 1rem; }
.alert-success { background: #0d2b1a; color: var(--green); border: 1px solid #1a4a2e; }
.alert-error { background: #2b0d0d; color: #ff6b6b; border: 1px solid #4a1a1a; }

/* ---- ACCOUNT ---- */
.account-layout { display: grid; grid-template-columns: 220px 1fr; gap: 1.5rem; padding: 2rem 0 3rem; }
@media (max-width: 700px) { .account-layout { grid-template-columns: 1fr; } }
.account-sidebar { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.2rem; height: fit-content; }
.user-avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--accent); display: flex; align-items: center; justify-content: center; font-family: 'Unbounded', sans-serif; font-size: .8rem; font-weight: 900; color: #fff; margin-bottom: .8rem; }
.user-name { font-weight: 600; margin-bottom: 2px; }
.user-email { font-size: 12px; color: var(--muted); margin-bottom: 1rem; }
.sidebar-links { display: flex; flex-direction: column; gap: 4px; }
.sidebar-link { font-size: 13px; color: var(--muted); padding: 7px 10px; border-radius: 7px; transition: all .15s; display: flex; align-items: center; gap: 7px; }
.sidebar-link:hover, .sidebar-link.on { background: var(--bg3); color: var(--white); }
.orders-list { display: flex; flex-direction: column; gap: 10px; }
.order-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.order-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; }
.order-id { font-family: 'Unbounded', sans-serif; font-size: .65rem; font-weight: 700; }
.order-status { font-size: 11px; padding: 2px 10px; border-radius: 99px; }
.status-new { background: #1a2035; color: #6699ff; }
.status-confirmed { background: #1a2e00; color: var(--green); }
.status-shipped { background: #2e1a00; color: var(--gold); }
.status-done { background: #0d2b1a; color: var(--green); }
.status-cancelled { background: #2b0d0d; color: #ff6b6b; }
.order-items-list { font-size: 12px; color: var(--muted); margin-bottom: .5rem; }
.order-total { font-family: 'Unbounded', sans-serif; font-size: .8rem; font-weight: 700; color: var(--gold); }

/* ---- REVIEWS ---- */
.reviews-section { padding: 2rem 0 3rem; border-top: 1px solid var(--border); margin-top: 2rem; }
.reviews-section h2 { font-size: .9rem; margin-bottom: 1.2rem; }
.reviews-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-bottom: 1.5rem; }
.review-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.rv-author { font-weight: 600; font-size: 13px; margin-bottom: 3px; }
.rv-stars { color: var(--gold); font-size: 12px; margin-bottom: .5rem; }
.rv-text { font-size: 12px; color: var(--muted); line-height: 1.6; }

/* ---- ADMIN ---- */
.admin-wrap { display: grid; grid-template-columns: 200px 1fr; min-height: 100vh; }
.admin-sidebar { background: var(--bg2); border-right: 1px solid var(--border); padding: 1.5rem 1rem; }
.admin-sidebar .nav-logo { display: block; margin-bottom: 2rem; font-size: .75rem; }
.admin-nav { display: flex; flex-direction: column; gap: 3px; }
.admin-nav a { font-size: 13px; color: var(--muted); padding: 8px 12px; border-radius: 7px; display: flex; align-items: center; gap: 8px; transition: all .15s; }
.admin-nav a:hover, .admin-nav a.on { background: var(--bg3); color: var(--white); }
.admin-content { padding: 1.5rem; }
.admin-title { font-family: 'Unbounded', sans-serif; font-size: .9rem; font-weight: 700; margin-bottom: 1.5rem; }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 2rem; }
.admin-stat { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.admin-stat .n { font-family: 'Unbounded', sans-serif; font-size: 1.4rem; font-weight: 900; color: var(--gold); }
.admin-stat .l { font-size: 11px; color: var(--muted); margin-top: 3px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: .04em; }
.data-table td { padding: .7rem .8rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg3); }
.table-wrap { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.table-actions { display: flex; gap: 6px; }

/* ---- TOAST ---- */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(60px);
  background: var(--bg2);
  border: 1px solid var(--border2);
  color: var(--white);
  padding: .6rem 1.4rem;
  border-radius: 99px;
  font-size: 13px;
  z-index: 300;
  transition: transform .3s;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ---- FOOTER ---- */
.footer { background: var(--bg2); border-top: 1px solid var(--border); padding: 2.5rem 0 0; margin-top: 3rem; }
.footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 3rem; margin-bottom: 2rem; }
@media (max-width: 600px) { .footer-inner { grid-template-columns: 1fr; } }
.footer-brand .nav-logo { margin-bottom: .7rem; }
.footer-brand p { font-size: 13px; color: var(--muted); line-height: 1.6; }
.footer-links { display: flex; gap: 2.5rem; flex-wrap: wrap; }
.fl-col { display: flex; flex-direction: column; gap: 6px; }
.fl-title { font-family: 'Unbounded', sans-serif; font-size: .6rem; font-weight: 700; color: var(--muted); letter-spacing: .06em; margin-bottom: 4px; }
.fl-col a { font-size: 13px; color: var(--muted); transition: color .15s; }
.fl-col a:hover { color: var(--white); }
.footer-bottom { border-top: 1px solid var(--border); padding: 1rem 0; font-size: 12px; color: var(--muted); }

/* ---- RESPONSIVE ---- */
@media (max-width: 600px) {
  .nav-cats { display: none; }
  .hero { padding: 2.5rem 1rem 2rem; }
  .hero h1 { font-size: 1.8rem; }
  .products-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* Utility */
.text-muted { color: var(--muted); }
.text-gold { color: var(--gold); }
.text-green { color: var(--green); }
.text-accent { color: var(--accent); }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.section-title { font-size: .85rem; font-weight: 700; margin-bottom: 1.2rem; }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty-state .big { font-size: 3rem; margin-bottom: 1rem; }
