/* ======================================================================
   BASE — общая структура, ресет, переключатель тем.
   Цвета и типографика задаются в themes.css через body.theme-*
   ====================================================================== */

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  transition: background 0.3s ease, color 0.3s ease;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* === THEME SWITCHER === */
.theme-switcher {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 8px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ts-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  font-family: 'Inter', system-ui, sans-serif;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.ts-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.ts-btn.active {
  background: #fff;
  color: #000;
  border-color: #fff;
  font-weight: 700;
}

/* === HEADER === */
.site-header {
  padding: 18px 0;
  border-bottom: 1px solid rgba(127, 127, 127, 0.15);
}

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

.logo {
  font-size: 20px;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: -0.02em;
  color: inherit;
}

/* === NAV === */
.site-nav {
  display: flex;
  gap: 20px;
  align-items: center;
}

.nav-link {
  color: #ffffff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: opacity 0.15s ease;
}

.nav-link:hover,
.nav-link.active {
  color: #fff;
}

.cart-link {
  position: relative;
  color: inherit;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.cart-badge {
  position: absolute;
  top: -8px;
  right: -10px;
  background: #ff3b30;
  color: white;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* === HERO === */
.hero {
  text-align: center;
  padding: 48px 0 36px;
}

.hero h1 {
  font-size: clamp(22px, 4vw, 34px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

/* === CATALOG GRID === */
.catalog {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
  padding-bottom: 24px;
}

.card {
  border-radius: 18px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  transform: translateY(-2px);
}

.card-tile {
  border-radius: 14px;
  padding: 20px 22px;
  position: relative;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--tile-color, #5a5a5a);
  color: #ffffff;
}

.card-tile .apple {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.card-tile .nominal {
  position: absolute;
  top: 18px;
  right: 22px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.card-tile .label {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-top: auto;
}

.card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 8px 4px;
}

.card-price {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.card-btn {
  background: #1a1a1a;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.card-btn:hover { background: #333; }

.card-btn.in-cart {
  background: #34c759;
}

.catalog-footer {
  text-align: center;
  padding: 24px 0 48px;
  font-size: 18px;
  font-weight: 600;
}

/* === FOOTER === */
.site-footer {
  margin-top: auto;
  padding: 24px 0;
  border-top: 1px solid rgba(127, 127, 127, 0.15);
  font-size: 13px;
  opacity: 0.7;
}

.site-footer p { margin-bottom: 4px; }
.site-footer a { color: inherit; text-decoration: underline; }

/* === RESPONSIVE === */
@media (max-width: 600px) {
  .container { padding: 0 16px; }
  .hero { padding: 32px 0 24px; }
  .catalog { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .card { padding: 10px; }
  .card-tile { padding: 14px; min-height: 130px; }
  .card-tile .nominal { font-size: 18px; top: 12px; right: 14px; }
  .card-tile .apple { width: 18px; height: 18px; }
  .card-tile .label { font-size: 13px; }
  .card-bottom {
    padding: 10px 4px 2px;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
  }
  .card-price { font-size: 18px; text-align: center; }
  .card-btn { width: 100%; padding: 9px; font-size: 13px; }
  .ts-btn { font-size: 11px; padding: 4px 9px; }
}
