:root {
  --bg: #0a0a0f;
  --surface: #141420;
  --surface-soft: #1d1d2c;
  --ink: #f4f4fb;
  --ink-soft: #c6c7d9;
  --brand: #7c2aff;
  --brand-dark: #3a1977;
  --danger: #dd3a53;
  --border: #2d2f45;
  --ok: #7fdd8c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: radial-gradient(circle at 15% 10%, #241140, transparent 40%),
    radial-gradient(circle at 80% 90%, #230e33, transparent 45%), var(--bg);
  font-family: "Space Grotesk", sans-serif;
  position: relative;
  overflow-x: hidden;
}

.bg-shape {
  position: fixed;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.3;
  z-index: -1;
}

.bg-shape-a {
  top: -120px;
  right: -100px;
  background: #6f2df7;
}

.bg-shape-b {
  bottom: -160px;
  left: -120px;
  background: #1a8f7d;
}

.topbar {
  max-width: 1240px;
  margin: 0 auto;
  padding: 2rem clamp(0.9rem, 2vw, 1.2rem) 1.2rem;
  display: flex;
  gap: 1rem;
  align-items: end;
  justify-content: space-between;
}

.social-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.eyebrow {
  margin: 0;
  color: var(--ink-soft);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.store-logo {
  width: clamp(140px, 23vw, 220px);
  height: auto;
  display: block;
  margin-bottom: 0.45rem;
}

h1 {
  margin: 0.2rem 0;
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(2rem, 6vw, 4.2rem);
  letter-spacing: 0.03em;
  line-height: 0.92;
}

.slogan {
  margin: 0;
  font-size: 1rem;
  color: var(--ink-soft);
}

.layout {
  max-width: 1240px;
  margin: 0 auto;
  padding: 1rem clamp(0.9rem, 2vw, 1.2rem) 2rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 1rem;
}

.catalog-section,
.cart-section,
.admin-panel,
.product-card {
  background: color-mix(in srgb, var(--surface) 85%, #000 15%);
  border: 1px solid var(--border);
  border-radius: 18px;
}

.catalog-section {
  padding: 1rem;
}

.info-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.pill {
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.search-row {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.search-input {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  border-radius: 12px;
  padding: 0.1rem 0.65rem;
}

.search-input input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--ink);
  padding: 0.75rem 0.2rem;
  font-size: 0.95rem;
}

.search-input input:focus {
  outline: none;
}

.search-icon {
  width: 20px;
  height: 20px;
  fill: var(--ink-soft);
}

.btn {
  border: none;
  cursor: pointer;
  border-radius: 12px;
  padding: 0.74rem 0.95rem;
  font-weight: 700;
  font-family: inherit;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.18s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  color: white;
  background: linear-gradient(130deg, var(--brand) 0%, #4f20a3 100%);
  box-shadow: 0 8px 30px rgba(124, 42, 255, 0.25);
}

.btn-outline {
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--border);
}

.btn-ghost {
  color: var(--ink);
  background: #232338;
}

.btn-danger {
  color: #fff;
  background: #812437;
}

.admin-panel {
  margin-bottom: 1rem;
  padding: 1rem;
}

.admin-panel h2,
.cart-section h2 {
  margin-top: 0;
  font-size: 1.25rem;
}

.admin-panel p {
  margin-top: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.admin-form input,
.product-controls select,
.product-controls input {
  width: 100%;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: #11111c;
  color: var(--ink);
  padding: 0.64rem 0.7rem;
  font-family: inherit;
}

.file-input-wrap {
  border-radius: 9px;
  border: 1px solid var(--border);
  background: #11111c;
  color: var(--ink-soft);
  padding: 0.5rem 0.7rem;
  font-size: 0.84rem;
}

.file-input-wrap input {
  margin-top: 0.35rem;
}

.admin-form button {
  grid-column: span 2;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 0.8rem;
}

.products-pagination {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.page-btn {
  min-width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #1a1b2a;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.page-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.product-card {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.media-trigger {
  width: 100%;
  padding: 0;
  border: none;
  border-radius: 12px;
  background: transparent;
  cursor: default;
  overflow: hidden;
}

.media-trigger.has-photo {
  cursor: zoom-in;
}

.jersey-art {
  height: 130px;
  border-radius: 12px;
  background: linear-gradient(160deg, #6f2df7 0%, #1a1a2e 40%, #000 100%);
  position: relative;
  overflow: hidden;
}

.jersey-photo {
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
  transition: height 0.25s ease, transform 0.25s ease, object-fit 0.2s ease;
}

.product-card:hover .media-trigger.has-photo .jersey-photo,
.product-card.expanded .media-trigger.has-photo .jersey-photo {
  height: 280px;
  object-fit: contain;
  transform: scale(1.01);
  background: #0c0c13;
}

.jersey-art::before,
.jersey-art::after {
  content: "";
  position: absolute;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}

.jersey-art::before {
  top: -15px;
  left: -10px;
}

.jersey-art::after {
  bottom: -20px;
  right: -5px;
}

.product-main .team {
  margin: 0;
  color: var(--ok);
  font-weight: 700;
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.product-main .model {
  margin: 0.2rem 0;
  font-size: 1.05rem;
}

.product-main .price {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.product-main .stock {
  margin: 0.3rem 0 0;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.product-controls {
  display: grid;
  grid-template-columns: 1fr 80px;
  gap: 0.5rem;
}

.product-controls label {
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.product-controls .add-cart-btn {
  grid-column: span 2;
}

.admin-card-controls {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem;
}

.cart-section {
  padding: 1rem;
  align-self: start;
  position: sticky;
  top: 0.8rem;
}

.cart-note {
  margin-top: -0.4rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.cart-items {
  display: grid;
  gap: 0.55rem;
  margin: 0.9rem 0;
}

.cart-item {
  border: 1px solid var(--border);
  background: #10101a;
  border-radius: 10px;
  padding: 0.58rem;
}

.cart-item-top {
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
}

.cart-item p {
  margin: 0.1rem 0;
  font-size: 0.86rem;
  color: var(--ink-soft);
}

.cart-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  border-top: 1px solid var(--border);
}

.full {
  width: 100%;
  margin-top: 0.45rem;
}

.hidden {
  display: none;
}

.empty-msg {
  grid-column: 1 / -1;
  width: 100%;
  color: var(--ink-soft);
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 88px;
  text-align: center;
  font-size: 0.92rem;
}

.site-footer {
  max-width: 1240px;
  margin: 0.8rem auto 1.2rem;
  padding: 1rem clamp(0.9rem, 2vw, 1.2rem) 0;
}

.site-footer p {
  margin: 0;
  padding: 0.95rem 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, rgba(124, 42, 255, 0.12), rgba(20, 20, 32, 0.5));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.9rem;
}

.footer-left,
.footer-right {
  white-space: nowrap;
}

.footer-right {
  text-align: right;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .cart-section {
    position: static;
  }
}

@media (max-width: 620px) {
  .topbar {
    flex-direction: column;
    align-items: start;
  }

  .social-actions {
    width: 100%;
  }

  .social-actions .btn {
    flex: 1;
  }

  .search-row {
    flex-direction: column;
  }

  .admin-form {
    grid-template-columns: 1fr;
  }

  .admin-form button {
    grid-column: auto;
  }

  .product-controls {
    grid-template-columns: 1fr;
  }

  .product-controls .add-cart-btn {
    grid-column: auto;
  }

  .product-card.expanded .media-trigger.has-photo .jersey-photo {
    height: 240px;
  }
}

@media (max-width: 420px) {
  .store-logo {
    width: 160px;
  }

  .product-card {
    padding: 0.65rem;
  }

  .site-footer p {
    font-size: 0.82rem;
    padding: 0.85rem 0.75rem;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
  }

  .footer-left,
  .footer-right {
    white-space: normal;
    text-align: center;
  }
}
