/*
 * Бренд-версія "blago Івано-Франківськ".
 * Палітра підібрана під референс blagodeveloper.com: лаймовий акцент
 * #c1f500, майже чорний текст #191919, шрифт Manrope.
 */

:root {
  --bg: #f4f3f1;
  --surface: #ffffff;
  --surface-muted: #edebe8;
  --text: #191919;
  --text-muted: #737272;
  --primary: #191919;
  --primary-dark: #000000;
  --accent: #c1f500;
  --accent-soft: #effcc4;
  --accent-ink: #3c4a00;
  --success: #4b7300;
  --success-soft: #effcc4;
  --border: #e5e3df;
  --shadow: 0 4px 16px rgba(25, 25, 25, 0.08);
  --shadow-hover: 0 10px 28px rgba(25, 25, 25, 0.14);
  --radius: 14px;
  --radius-sm: 8px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141414;
    --surface: #1c1c1c;
    --surface-muted: #262626;
    --text: #f3f3f1;
    --text-muted: #9a9a9a;
    --primary: #f3f3f1;
    --primary-dark: #ffffff;
    --accent: #c1f500;
    --accent-soft: #2b3400;
    --accent-ink: #e4ff8a;
    --success: #c1f500;
    --success-soft: #2b3400;
    --border: #2e2e2e;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.6);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Manrope", -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.brand__logo {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
}

.brand__location {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tab {
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab:hover {
  border-color: var(--accent);
  color: var(--text);
}

.tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--primary-dark);
}

/* Toolbar */

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 220px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.toolbar__count {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

/* Grid */

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
  border-color: var(--accent);
}

.card__image-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--surface-muted);
}

.card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card__body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.card__collection {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 700;
}

.card__descr {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.card__colors {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  outline: 1px solid var(--border);
  cursor: pointer;
  padding: 0;
  background-size: cover;
  background-position: center;
}

.swatch:hover,
.swatch.active {
  outline: 2px solid var(--accent);
}

/* Modal */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}

.modal-overlay[hidden] {
  display: none;
}

.modal {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  max-width: 880px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 0;
  box-shadow: var(--shadow-hover);
}

.modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  box-shadow: var(--shadow);
  z-index: 2;
}

.modal__gallery {
  background: var(--surface-muted);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal__main-image-wrap {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
}

.modal__main-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.modal__thumbnails {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.modal__thumbnails img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  background: var(--surface);
  border-radius: 6px;
  cursor: pointer;
  opacity: 0.6;
  border: 2px solid transparent;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}

.modal__thumbnails img:hover {
  opacity: 0.9;
}

.modal__thumbnails img.active {
  opacity: 1;
  border-color: var(--accent);
}

.modal__info {
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
}

.modal__collection {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 700;
}

.modal__title {
  margin: 4px 0 16px;
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}

.modal__specs {
  margin: 0 0 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal__specs div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border);
  font-size: 13px;
}

.modal__specs dt {
  color: var(--text-muted);
}

.modal__specs dd {
  margin: 0;
  font-weight: 700;
  color: var(--text);
  text-align: right;
}

.modal__link {
  margin-top: auto;
  align-self: flex-start;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.modal__link:hover {
  color: var(--accent-ink);
}

@media (max-width: 640px) {
  .modal {
    grid-template-columns: 1fr;
  }
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 60px 20px;
  font-size: 15px;
}

@media (max-width: 480px) {
  .site-header__inner {
    padding: 12px 16px;
  }

  .page {
    padding: 16px;
  }
}
