/*
Theme Name: SHFO Watch
Theme URI: https://watch-showcase.ru
Author: SH Family Office
Description: Managed WordPress theme for the Watch Showcase marketplace.
Version: 1.0.0
Text Domain: shfo-watch
*/

:root {
  --bg: #f4f1eb;
  --surface: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --border: #dde4ef;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
  --container: 1380px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: linear-gradient(180deg, #fcfbf8 0%, #f5f1ea 100%);
  color: var(--text);
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select { font: inherit; }

.shfo-container {
  width: min(var(--container), calc(100vw - 40px));
  margin: 0 auto;
}

.shfo-site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.admin-bar .shfo-site-header { top: 32px; }

.shfo-site-header__inner {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.shfo-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.shfo-brand__mark {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.shfo-brand__title {
  display: block;
  font-size: 19px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.shfo-brand__sub {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.shfo-menu {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.shfo-menu a,
.shfo-site-nav > a {
  color: #334155;
  font-size: 15px;
  font-weight: 700;
  transition: color .18s ease;
}

.shfo-menu a:hover,
.shfo-site-nav > a:hover { color: var(--accent); }

.shfo-site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.shfo-menu-toggle {
  display: none;
  width: 46px;
  height: 46px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  border: 1px solid #d8dfeb;
  border-radius: 14px;
  background: rgba(255,255,255,.92);
  color: #0f172a;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(15,23,42,.06);
}

.shfo-menu-toggle span {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform .18s ease, opacity .18s ease;
}

.shfo-menu-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.shfo-menu-toggle.is-open span:nth-child(2) { opacity: 0; }
.shfo-menu-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.shfo-site-main { min-height: calc(100vh - 84px); }

.watch-marketplace { padding: 28px 0 44px; }

.watch-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.watch-eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
}

.watch-intro h1 {
  margin: 0;
  font-size: 42px;
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.watch-copy {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.watch-controls {
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(221,228,239,.9);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(280px, 2.6fr) minmax(160px, 1fr) minmax(170px, 1fr) minmax(120px, .8fr) minmax(120px, .8fr) 58px;
  gap: 10px;
}

.watch-filters-toggle,
.watch-filter-actions {
  display: none;
}

.watch-controls input,
.watch-controls select,
.watch-controls button {
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0 15px;
  border: 1px solid #d8dfeb;
  border-radius: 14px;
  background: #fff;
  color: #334155;
}

.watch-search { min-width: 0; }

#watchReset {
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 26px;
  color: #667085;
}

.watch-result-meta {
  margin-top: 18px;
  margin-bottom: 14px;
  color: var(--muted);
  font-weight: 700;
}

.watch-cards {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
}

.watch-card {
  background: rgba(255,255,255,.92);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(15,23,42,.08);
  display: flex;
  flex-direction: column;
}

.watch-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #eef2f7;
  overflow: hidden;
}

.watch-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.watch-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #94a3b8;
  font-weight: 800;
  font-size: 44px;
}

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

.watch-card h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.28;
}

.watch-meta {
  color: var(--muted);
  font-size: 13px;
}

.watch-price {
  margin-top: 4px;
  font-size: 18px;
  font-weight: 800;
}

.watch-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.watch-chip {
  padding: 5px 9px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.watch-more {
  margin-top: auto;
  min-height: 44px;
  border: 0;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.watch-more:hover { background: var(--accent-dark); }

.watch-empty {
  grid-column: 1 / -1;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: rgba(255,255,255,.85);
  color: var(--muted);
  text-align: center;
}

.watch-dialog {
  width: min(980px, calc(100vw - 24px));
  border: 0;
  border-radius: 24px;
  padding: 0;
  box-shadow: 0 24px 70px rgba(15,23,42,.25);
}

.watch-dialog::backdrop { background: rgba(15,23,42,.48); }

.watch-dialog__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 14px;
  background: rgba(255,255,255,.9);
  font-size: 24px;
  cursor: pointer;
}

.watch-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .9fr);
  gap: 24px;
  padding: 24px;
}

.watch-detail__image {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: #eef2f7;
  aspect-ratio: 1 / 1;
}

.watch-detail__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.watch-detail__gallery {
  min-width: 0;
}

.watch-gallery-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.9);
  box-shadow: 0 10px 28px rgba(15,23,42,.18);
  color: #0f172a;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
}

.watch-gallery-arrow--prev { left: 12px; }
.watch-gallery-arrow--next { right: 12px; }

.watch-gallery-count {
  position: absolute;
  left: 50%;
  bottom: 12px;
  z-index: 2;
  transform: translateX(-50%);
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15,23,42,.72);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.watch-thumbs {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.watch-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 12px;
  background: #eef2f7;
  overflow: hidden;
  cursor: pointer;
}

.watch-thumb.is-active {
  border-color: var(--accent);
}

.watch-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.watch-detail h2 {
  margin: 0 42px 10px 0;
  font-size: 30px;
  line-height: 1.12;
}

.watch-specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 18px 0;
}

.watch-spec {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.watch-spec span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 2px;
}

.watch-description {
  color: #334155;
  white-space: pre-wrap;
}

.watch-telegram {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
  padding: 0 18px;
  border-radius: 14px;
  background: #2aabee;
  color: #fff;
  font-weight: 800;
}

.shfo-page-shell { padding: 26px 0 42px; }

.shfo-page-card {
  background: rgba(255,255,255,.74);
  border: 1px solid rgba(226,232,240,.9);
  border-radius: 28px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.shfo-page-card h1 {
  margin: 0 0 18px;
  font-size: 42px;
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.shfo-site-footer {
  padding: 26px 0 34px;
  color: #64748b;
  font-size: 14px;
}

.shfo-site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid rgba(148,163,184,.2);
  padding-top: 18px;
}

@media (max-width: 980px) {
  .watch-intro { align-items: start; flex-direction: column; }
  .watch-controls { grid-template-columns: 1fr 1fr; }
  .watch-search { grid-column: 1 / -1; }
  #watchReset { grid-column: 1 / -1; }
  .watch-detail { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .watch-marketplace { padding-top: 20px; }

  .watch-filters-toggle {
    position: sticky;
    top: 84px;
    z-index: 40;
    display: grid;
    place-items: center;
    min-height: 52px;
    margin-bottom: 14px;
    padding: 0 54px;
    border: 1px solid rgba(203, 213, 225, 0.95);
    border-radius: 18px;
    background: rgba(255,255,255,.96);
    color: #64748b;
    box-shadow: 0 8px 18px rgba(15,23,42,.05);
    backdrop-filter: blur(12px);
    font-size: 16px;
    font-weight: 800;
  }

  .watch-filters-toggle::before {
    content: "";
    position: absolute;
    left: 18px;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background-color: #f1f5f9;
    background-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
  }

  .watch-filters-toggle__label {
    min-width: 0;
    text-align: center;
  }

  .watch-filters-toggle__reset {
    position: absolute;
    right: 18px;
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border: 1px solid rgba(203,213,225,.85);
    border-radius: 999px;
    background: #f1f5f9;
    color: #64748b;
    line-height: 1;
  }

  .watch-filters-toggle__reset[hidden] {
    display: none !important;
  }

  body.watch-filters-open {
    overflow: hidden;
  }

  body.watch-filters-open .watch-filters-toggle {
    display: none;
  }

  .watch-controls {
    position: fixed;
    top: 74px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1090;
    width: 100%;
    max-width: none;
    display: grid;
    grid-template-columns: 1fr;
    align-content: start;
    gap: 10px;
    max-height: none;
    height: auto;
    margin: 0;
    padding: 16px 14px calc(218px + var(--shfo-mobile-bottom-gap, 16px));
    overflow: auto;
    border: 0;
    border-radius: 0;
    background: #f8fafc;
    box-shadow: none;
    transform: translateY(0);
    opacity: 1;
    transition: transform .24s ease, opacity .18s ease;
    -webkit-overflow-scrolling: touch;
  }

  .watch-controls.shfo-container {
    width: 100%;
    max-width: none;
    margin: 0;
  }

  .watch-controls.is-collapsed {
    display: grid;
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
  }

  .watch-controls input,
  .watch-controls select,
  .watch-controls button {
    height: 56px;
    border-radius: 18px;
    font-size: 16px;
  }

  #watchReset {
    display: none;
  }

  .watch-filter-actions {
    position: fixed;
    left: 0;
    right: 0;
    bottom: var(--shfo-mobile-bottom-gap, 16px);
    z-index: 1110;
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 10px 12px;
    background: rgba(248,250,252,.98);
    border-top: 1px solid rgba(203,213,225,.95);
    box-shadow: 0 -14px 34px rgba(15,23,42,.12);
  }

  .watch-controls.is-collapsed .watch-filter-actions {
    display: none;
  }

  .watch-filter-action {
    min-height: 48px;
    border: 0;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
  }

  .watch-filter-action--apply {
    background: var(--accent);
    color: #fff;
  }

  .watch-filter-action--reset {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
  }

  .watch-filter-action--hide {
    background: #e2e8f0;
    color: #0f172a;
  }
}

@media (max-width: 640px) {
  .admin-bar .shfo-site-header { top: 46px; }
  .shfo-container { width: min(var(--container), calc(100vw - 24px)); }
  .shfo-site-header__inner {
    position: relative;
    min-height: 74px;
  }

  .shfo-brand__title { font-size: 18px; }
  .shfo-menu-toggle { display: inline-flex; }

  .shfo-site-nav {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    display: grid;
    gap: 0;
    padding: 8px;
    border: 1px solid rgba(216,223,235,.95);
    border-radius: 20px;
    background: rgba(255,255,255,.98);
    box-shadow: 0 22px 55px rgba(15,23,42,.16);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .18s ease, visibility .18s ease, transform .18s ease;
  }

  .shfo-site-nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .shfo-menu {
    display: grid;
    gap: 0;
  }

  .shfo-menu a,
  .shfo-site-nav > a {
    display: flex;
    min-height: 46px;
    align-items: center;
    padding: 0 14px;
    border-radius: 14px;
    font-size: 15px;
  }

  .shfo-menu a:hover,
  .shfo-site-nav > a:hover {
    background: #f1f5f9;
  }

  .watch-intro h1 { font-size: 34px; }
  .watch-controls { grid-template-columns: 1fr; }
  .watch-cards { grid-template-columns: 1fr; }
  .watch-detail { padding: 14px; }
  .watch-detail h2 { font-size: 24px; }
  .watch-specs { grid-template-columns: 1fr; }
  .watch-thumbs { grid-template-columns: repeat(4, 1fr); }
  .shfo-site-footer__inner { align-items: start; flex-direction: column; }
}
