/* ===================== VARIABLES ===================== */
:root {
  --color-bg: #ffffff;
  --color-text: #1a1a1a;
  --color-text-muted: #6b6b6b;
  --color-accent: #e4131e;
  --color-border: #e5e5e5;
  --color-border-strong: #d9d9d9;

  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --header-height: 76px;
  --max-width: 1180px;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-pill: 999px;
}

/* ===================== RESET ===================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

fieldset {
  border: none;
}

/* ===================== HEADER ===================== */
.header {
  width: 100%;
  border-bottom: 1px solid var(--color-border);
}

.header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  height: var(--header-height);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.header__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header__logo-icon {
  width: 32px;
  height: 32px;
}

.header__logo-text {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--color-accent);
}

.header__nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.header__link {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
}

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

/* ===================== MAIN ===================== */
.main {
  flex: 1;
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 56px 32px;
}

.product {
  width: 100%;
  max-width: var(--max-width);
  display: flex;
  gap: 64px;
  align-items: flex-start;
}

/* --- Gallery --- */
.product__gallery {
  flex: 1 1 50%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafafa;
  border-radius: var(--radius-md);
}

.product__image {
  width: 100%;
  max-width: 480px;
  height: auto;
  object-fit: contain;
}

/* --- Info --- */
.product__info {
  flex: 1 1 50%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding-top: 8px;
}

.product__badge {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 12px;
}

.product__title {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 16px;
}

.product__price {
  margin-bottom: 32px;
}

.product__price-line {
  font-size: 16px;
  color: var(--color-text);
  line-height: 1.6;
}

/* --- Option groups --- */
.option-group {
  margin-bottom: 24px;
}

.option-group__label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

.option-group__options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Pill radio (type / size) */
.pill-radio {
  position: relative;
  display: inline-flex;
}

.pill-radio input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.pill-radio__box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  background: #fff;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.pill-radio input:checked+.pill-radio__box {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: #fdeceb;
}

.pill-radio input:focus-visible+.pill-radio__box {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.pill-radio input:hover+.pill-radio__box {
  border-color: var(--color-accent);
}

/* Size options are slightly smaller / fixed width */
.option-group__options--size .pill-radio__box {
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
}

/* Color radio (swatch circles) */
.color-radio {
  position: relative;
  display: inline-flex;
}

.color-radio input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.color-radio__swatch {
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.color-radio input:checked+.color-radio__swatch {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--color-accent);
}

.color-radio input:focus-visible+.color-radio__swatch {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* --- CTA button --- */
.cta-button {
  margin-top: 8px;
  width: 100%;
  max-width: 360px;
  height: 56px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: background 0.15s ease, transform 0.05s ease;
}

.cta-button:hover {
  background: #c50f19;
}

.cta-button:active {
  transform: translateY(1px);
}

.cta-button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* ===================== FOOTER ===================== */
.footer {
  width: 100%;
  border-top: 1px solid var(--color-border);
  margin-top: auto;
}

.footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 32px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.footer__requisites {
  font-size: 12px;
  line-height: 1.6;
  color: var(--color-text-muted);
}

.footer__link {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
}

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

/* ===================== RESPONSIVE (< 768px) ===================== */
@media (max-width: 768px) {
  .header__inner {
    padding: 0 16px;
    height: 64px;
  }

  .header__logo-text {
    font-size: 16px;
  }

  .header__nav {
    gap: 16px;
  }

  .header__link {
    font-size: 12px;
  }

  .main {
    padding: 24px 16px;
  }

  .product {
    flex-direction: column;
    gap: 24px;
  }

  .product__gallery {
    width: 100%;
    order: 1;
  }

  .product__image {
    max-width: 100%;
  }

  .product__info {
    order: 2;
    width: 100%;
    padding-top: 0;
  }

  .product__title {
    font-size: 22px;
  }

  .product__price {
    margin-bottom: 24px;
  }

  .cta-button {
    max-width: 100%;
  }

  .footer__inner {
    flex-direction: column;
    padding: 20px 16px;
    gap: 12px;
  }
}

/* ===================== GALLERY PAGE ===================== */

.gallery-grid {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;

    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

.gallery-item {
    flex: 1 1 260px;
    max-width: calc(25% - 18px);

    overflow: hidden;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background: #fff;

    transition: transform .2s ease, box-shadow .2s ease;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,.08);
}

.gallery-item img {
    display: block;
    width: 100%;
    height: auto;
}
/* Планшет */
@media (max-width: 1000px) {
    .gallery-item {
        max-width: calc(50% - 12px);
    }
}

/* Телефон */
@media (max-width: 640px) {
    .gallery-item {
        max-width: 100%;
        flex-basis: 100%;
    }
}