:root {
  --primary: #0b0f19;
  --secondary: #00d4ff;
  --accent: #ff3d71;
  --success: #13c98a;
  --warning: #ffd166;
  --bg: #f6f7fb;
  --white: #ffffff;
  --gray: #667085;
  --light: #e6e8ef;
  --ink: #111827;
  --shadow: 0 18px 60px rgba(15, 23, 42, 0.12);
  --radius: 8px;
  --transition: all 0.22s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-hero {
  min-height: 680px;
  color: var(--white);
  background:
    radial-gradient(circle at 10% 20%, rgba(0, 212, 255, 0.34), transparent 28%),
    radial-gradient(circle at 82% 18%, rgba(255, 61, 113, 0.34), transparent 24%),
    linear-gradient(145deg, #070a12 0%, #101928 58%, #191124 100%);
  position: relative;
  overflow: hidden;
}

.site-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 160px;
  background: linear-gradient(to bottom, transparent, rgba(246, 247, 251, 1));
  pointer-events: none;
}

.topbar {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: relative;
  z-index: 2;
}

.brand,
.topbar-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  font-weight: 800;
}

.brand {
  gap: 12px;
  font-size: 1.05rem;
  letter-spacing: 0;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--primary);
  background: linear-gradient(135deg, var(--secondary), var(--warning));
}

.topbar-link {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.88);
}

.hero-grid {
  min-height: 560px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 480px);
  align-items: center;
  gap: 48px;
  position: relative;
  z-index: 1;
}

.eyebrow {
  color: var(--secondary);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 12px;
}

.hero-copy h1 {
  max-width: 760px;
  font-size: clamp(3rem, 8vw, 6.8rem);
  line-height: 0.9;
  font-weight: 950;
  text-transform: lowercase;
}

.hero-lead {
  max-width: 640px;
  margin-top: 24px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 1.16rem;
}

.hero-actions,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-actions {
  margin-top: 30px;
}

.btn {
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
}

.btn-buy {
  color: var(--primary);
  background: linear-gradient(135deg, var(--warning), var(--secondary));
  box-shadow: 0 12px 30px rgba(0, 212, 255, 0.22);
}

.btn-buy:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(0, 212, 255, 0.32);
}

.btn-more {
  color: var(--white);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.product-card .btn-more {
  color: var(--ink);
  background: #eef2f7;
  border-color: #e5e7eb;
}

.hero-slider {
  min-height: 420px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
}

.banner-slide {
  display: none;
  min-height: 320px;
}

.banner-slide.active {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 12px;
}

.banner-img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: auto;
}

.promo-badge {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--white);
  background: var(--accent);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.banner-slide h2 {
  font-size: clamp(1.7rem, 4vw, 2.7rem);
  line-height: 1.05;
}

.banner-slide p {
  color: rgba(255, 255, 255, 0.78);
}

.hero-link {
  color: var(--secondary);
  font-weight: 900;
  text-decoration: none;
}

.banner-dots {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}

.banner-dots button {
  width: 34px;
  height: 6px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  cursor: pointer;
}

.banner-dots button.active {
  background: var(--secondary);
}

.search-section {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 18px 0;
  background: rgba(246, 247, 251, 0.86);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(14px);
}

.search-box {
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr auto;
  gap: 10px;
}

.search-box select,
.search-box input,
.search-box button {
  min-height: 48px;
  border-radius: var(--radius);
  font: inherit;
}

.search-box select,
.search-box input {
  width: 100%;
  border: 1px solid #d7dce6;
  background: var(--white);
  color: var(--ink);
  padding: 0 14px;
  outline: none;
}

.search-box select:focus,
.search-box input:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.14);
}

.search-box button {
  border: 0;
  padding: 0 24px;
  color: var(--white);
  background: var(--primary);
  font-weight: 850;
  cursor: pointer;
}

.products-section,
.ads-section {
  padding: 64px 0;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 28px;
}

.section-heading h2 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.05;
}

.empty-state {
  padding: 28px;
  border: 1px dashed #cfd6e3;
  border-radius: var(--radius);
  color: var(--gray);
  text-align: center;
  background: var(--white);
}

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

.product-card {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  background: var(--white);
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
  transition: var(--transition);
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.img-wrap {
  height: 230px;
  display: block;
  position: relative;
  overflow: hidden;
  color: var(--white);
  background: linear-gradient(135deg, #111827, #243b53);
  text-decoration: none;
}

.img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.product-card:hover .img-wrap img {
  transform: scale(1.06);
}

.img-wrap .promo-badge {
  position: absolute;
  left: 12px;
  top: 12px;
}

.no-image {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  font-weight: 950;
  text-transform: lowercase;
}

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

.category {
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.product-card h3 {
  font-size: 1.16rem;
  line-height: 1.25;
  margin-bottom: 8px;
}

.desc {
  color: var(--gray);
  font-size: 0.94rem;
  flex: 1;
}

.price {
  margin: 16px 0;
  font-size: 1.55rem;
  font-weight: 950;
}

.product-card .actions .btn {
  flex: 1;
}

.ads-section {
  background: #111827;
  color: var(--white);
}

.ads-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.ad-card {
  min-height: 170px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(255,255,255,0.1), rgba(255,255,255,0.04));
  text-decoration: none;
  transition: var(--transition);
}

.ad-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 212, 255, 0.5);
}

.ad-card img {
  width: 100%;
  height: 86px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 14px;
}

.ad-card h3 {
  font-size: 1.2rem;
  margin-bottom: 6px;
}

.ad-card p {
  color: rgba(255, 255, 255, 0.72);
}

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(5, 8, 15, 0.72);
}

.modal-overlay.open {
  display: flex;
}

.modal {
  width: min(860px, 100%);
  max-height: 90vh;
  overflow: auto;
  position: relative;
  border-radius: 14px;
  background: var(--white);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.86);
  color: var(--white);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

.product-detail {
  width: min(960px, calc(100% - 32px));
  margin: 34px auto;
  overflow: hidden;
  border-radius: 14px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.product-detail .gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  background: var(--light);
}

.product-detail .gallery img {
  width: 100%;
  height: 260px;
  object-fit: cover;
}

.product-detail .gallery img:first-child {
  grid-column: 1 / -1;
  height: 380px;
}

.product-detail .info {
  padding: 28px;
}

.product-detail h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.05;
}

.meta {
  color: var(--gray);
  margin: 10px 0;
}

.price-lg {
  font-size: 2rem;
  font-weight: 950;
  margin-bottom: 18px;
}

footer {
  padding: 28px 0;
  color: rgba(255, 255, 255, 0.78);
  background: #070a12;
}

.footer-inner,
.footer-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

footer a {
  color: var(--secondary);
  text-decoration: none;
  font-weight: 800;
}

.admin-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.admin-header {
  background: var(--primary);
  color: var(--white);
  padding: 20px 0;
  margin-bottom: 30px;
}

.admin-header .container,
.admin-nav,
.admin-table .actions,
.inline-delete {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-header .container {
  justify-content: space-between;
}

.admin-nav a {
  color: var(--white);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
}

.admin-nav a:hover,
.admin-nav a.active {
  background: rgba(255, 255, 255, 0.12);
}

.admin-form,
.admin-table,
.login-card {
  background: var(--white);
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
}

.admin-form {
  max-width: 680px;
  padding: 24px;
  margin-bottom: 30px;
}

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

.admin-form label,
.login-card label {
  display: block;
  font-weight: 800;
  margin-bottom: 6px;
}

.admin-form input,
.admin-form textarea,
.admin-form select,
.login-card input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid #d7dce6;
  border-radius: 8px;
  font: inherit;
}

.btn-submit,
.btn-login,
.btn-edit,
.btn-delete {
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-submit,
.btn-login,
.btn-edit {
  color: var(--white);
  background: var(--primary);
}

.btn-delete {
  color: var(--white);
  background: #dc2626;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
}

.admin-table th,
.admin-table td {
  padding: 12px;
  border-bottom: 1px solid #eef0f5;
  text-align: left;
  vertical-align: middle;
}

.admin-table th {
  color: var(--white);
  background: var(--primary);
}

.flash {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 18px;
  font-weight: 700;
}

.flash-success {
  color: #075e43;
  background: #dff8ef;
}

.flash-error {
  color: #8a1224;
  background: #ffe4e9;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: linear-gradient(145deg, #070a12, #101928);
}

.login-card {
  width: min(420px, 100%);
  padding: 32px;
}

.login-card h1 {
  margin-bottom: 22px;
  text-align: center;
}

.btn-login {
  width: 100%;
  min-height: 46px;
}

@media (max-width: 860px) {
  .site-hero {
    min-height: auto;
    padding-bottom: 72px;
  }

  .hero-grid,
  .search-box,
  .ads-grid {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    min-height: auto;
    padding: 34px 0 70px;
  }

  .hero-slider {
    min-height: 360px;
  }

  .product-detail .gallery,
  .product-detail .gallery img:first-child {
    display: block;
  }
}

@media (max-width: 520px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px 0;
  }

  .hero-copy h1 {
    font-size: 3rem;
  }

  .hero-actions,
  .actions,
  .footer-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .products-section,
  .ads-section {
    padding: 42px 0;
  }
}
