/* ==========================================================================
   Strategist Network — Storefront styles
   Primary:   #0d6efd
   Secondary: #ffffff
   ========================================================================== */

:root {
  --primary: #0d6efd;
  --primary-dark: #0b5ed7;
  --primary-tint: #eaf2ff;
  --ink: #14181f;
  --ink-soft: #4b5563;
  --line: #e3e7ee;
  --bg: #ffffff;
  --bg-subtle: #f7f9fc;
  --radius: 10px;
  --font-display: 'Manrope', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --shadow-modal: 0 24px 60px rgba(13, 30, 66, 0.24);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Buttons ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 22px;
  border-radius: 8px;
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-outline {
  background: transparent;
  border-color: var(--primary);
  color: var(--primary);
}
.btn-outline:hover { background: var(--primary-tint); }

.btn-sm { padding: 9px 16px; font-size: 0.875rem; }
.btn-block { width: 100%; }

/* ---- Header --------------------------------------------------------------- */

.site-header {
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  z-index: 20;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.header-nav a {
  text-decoration: none;
  font-weight: 500;
  color: var(--ink-soft);
}
.header-nav a:hover { color: var(--primary); }

/* ---- Hero ------------------------------------------------------------------ */

.hero {
  padding: 88px 0 64px;
  background:
    radial-gradient(700px 320px at 85% -10%, var(--primary-tint), transparent);
}

.hero-inner { max-width: 660px; }

.hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 4vw, 2.85rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
}

.hero-sub {
  font-size: 1.08rem;
  color: var(--ink-soft);
  margin: 0 0 28px;
  max-width: 54ch;
}

/* ---- Advert space ----------------------------------------------------------- */

.advert {
  background: var(--bg-subtle);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.advert-inner {
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.advert-label {
  font-weight: 600;
  font-size: 0.72rem;
  color: var(--primary);
  background: var(--primary-tint);
  padding: 3px 9px;
  border-radius: 5px;
  flex-shrink: 0;
}

/* ---- Catalog ------------------------------------------------------------ */

.catalog { padding: 64px 0 96px; }

.catalog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 32px;
}

.catalog-head h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.6rem;
  margin: 0;
  letter-spacing: -0.01em;
}

.per-page-control {
  font-size: 0.9rem;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 8px;
}

.per-page-control select {
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 6px 10px;
  border-radius: 7px;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
.per-page-control select:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 24px;
}

.product-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #fff;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.product-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.product-card-image {
  aspect-ratio: 4 / 3;
  background: var(--bg-subtle);
  overflow: hidden;
}

.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card-image.no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9aa4b2;
  font-size: 0.85rem;
}

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

.product-card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

.product-card-desc {
  color: var(--ink-soft);
  font-size: 0.9rem;
  margin: 0 0 14px;
  flex-grow: 1;
}

.product-card-price {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--primary);
  font-size: 1.05rem;
  margin: 0 0 14px;
}

.product-card-actions {
  display: flex;
  gap: 10px;
}

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

/* ---- Skeleton loading state --------------------------------------------- */

.skeleton {
  background: linear-gradient(90deg, var(--bg-subtle) 25%, #eef1f6 37%, var(--bg-subtle) 63%);
  background-size: 400% 100%;
  animation: skeleton-shine 1.4s ease infinite;
  border-radius: var(--radius);
  height: 320px;
}

@keyframes skeleton-shine {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.empty-state {
  text-align: center;
  color: var(--ink-soft);
  padding: 48px 0;
}

/* ---- Pagination ----------------------------------------------------------- */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border-radius: 7px;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}

.page-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }

.page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-ellipsis {
  color: var(--ink-soft);
  padding: 0 4px;
}

/* ---- Modal --------------------------------------------------------------- */

.modal[hidden] { display: none; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

.modal-dialog {
  position: relative;
  background: #fff;
  border-radius: 14px;
  max-width: 880px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow-modal);
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(20, 24, 31, 0.06);
  color: var(--ink);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover { background: rgba(20, 24, 31, 0.12); }

.modal-gallery {
  background: var(--bg-subtle);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-gallery-main {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  background: #eef1f6;
}

.modal-gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-prev { left: 10px; }
.gallery-next { right: 10px; }
.gallery-nav[hidden] { display: none; }

.modal-gallery-thumbs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.modal-gallery-thumbs img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.7;
}
.modal-gallery-thumbs img.active {
  border-color: var(--primary);
  opacity: 1;
}

.modal-body {
  padding: 32px 28px;
}

.modal-body h3 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
  margin: 6px 0 8px;
  letter-spacing: -0.01em;
}

.modal-price {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--primary);
  font-size: 1.2rem;
  margin: 0 0 16px;
}

.modal-description {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin: 0 0 26px;
  white-space: pre-line;
}

.btn-buy { width: 100%; padding: 13px; }

.btn-disabled {
  pointer-events: none;
  opacity: 0.5;
}

@media (max-width: 720px) {
  .modal-dialog { grid-template-columns: 1fr; }
  .modal-gallery-main { aspect-ratio: 4 / 3; }
}

/* ---- Footer --------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

/* ---- Admin panel shared styles ------------------------------------------ */

.admin-body {
  background: var(--bg-subtle);
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  margin: 0;
}

.admin-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}

.admin-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-shell { padding: 40px 0 80px; }

.admin-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 720px;
  margin: 0 auto;
}

.admin-card h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin: 0 0 6px;
}

.admin-card .subtitle {
  color: var(--ink-soft);
  margin: 0 0 28px;
  font-size: 0.92rem;
}

.field { margin-bottom: 20px; }

.field label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 6px;
}

.field .hint {
  font-weight: 400;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.field input[type="text"],
.field input[type="number"],
.field input[type="url"],
.field input[type="password"],
.field textarea {
  width: 100%;
  padding: 11px 13px;
  border-radius: 8px;
  border: 1.5px solid var(--line);
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: #fff;
  color: var(--ink);
}

.field input:focus-visible,
.field textarea:focus-visible {
  outline: none;
  border-color: var(--primary);
}

.field textarea { resize: vertical; min-height: 110px; }

.image-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.image-input-row input[type="file"] { flex-grow: 1; }

.remove-image-row {
  border: none;
  background: none;
  color: #dc3545;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
}

.alert {
  padding: 13px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 22px;
}
.alert-success { background: #e7f7ee; color: #146c43; border: 1px solid #b4e6c9; }
.alert-error   { background: #fdecec; color: #b02a37; border: 1px solid #f3bcbf; }

.products-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 36px;
  font-size: 0.9rem;
}
.products-table th,
.products-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.products-table th { color: var(--ink-soft); font-weight: 600; }

@media (max-width: 600px) {
  .admin-card { padding: 22px; }
}
