@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --white: #ffffff;
  --beige: #f5f0e8;
  --beige-light: #faf8f4;
  --green: #a8c5a0;
  --green-dark: #7a9e72;
  --green-darker: #5c7e56;
  --text: #1a1a1a;
  --text-secondary: #4a4a4a;
  --text-muted: #8a8a8a;
  --border: #e8e3da;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.08);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
  font-size: 16px;
}

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

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

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.logo span {
  color: var(--green-dark);
}

.nav {
  display: flex;
  gap: 2rem;
  font-size: 0.9375rem;
  font-weight: 500;
}

.nav a {
  color: var(--text-secondary);
  transition: color var(--transition);
  padding: 4px 0;
  position: relative;
}

.nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--green-dark);
  transition: width var(--transition);
}

.nav a:hover {
  color: var(--text);
}

.nav a:hover::after {
  width: 100%;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: var(--green-dark);
  color: var(--white);
}

.btn--primary:hover {
  background: var(--green-darker);
  box-shadow: 0 2px 8px rgba(122, 158, 114, 0.3);
}

.btn--outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}

.btn--outline:hover {
  border-color: var(--green-dark);
  color: var(--green-dark);
}

.btn--avito {
  background: #00aaff;
  color: var(--white);
}

.btn--avito:hover {
  background: #0090dd;
  box-shadow: 0 2px 8px rgba(0, 170, 255, 0.3);
}

/* Hero */
.hero {
  background: var(--beige);
  padding: 5rem 0 4.5rem;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  max-width: 680px;
  margin-inline: auto;
  color: var(--text);
}

.hero p {
  color: var(--text-secondary);
  font-size: 1.125rem;
  max-width: 520px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}

/* Sections */
.section {
  padding: 4rem 0;
}

.section__title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
  text-align: center;
  color: var(--text);
}

/* Products grid */
.products {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
}

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

.card__img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  width: 100%;
  background: var(--beige-light);
}

.card__body {
  padding: 1rem 1.25rem 1.25rem;
}

.card__name {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.375rem;
  color: var(--text);
}

.card__price {
  color: var(--green-dark);
  font-weight: 700;
  font-size: 1.125rem;
}

/* Benefits */
.benefits {
  background: var(--beige-light);
}

.benefits__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  text-align: center;
}

.benefit {
  padding: 1.5rem;
}

.benefit h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.benefit p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.benefit__icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  background: var(--green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
}

.benefit__icon svg {
  stroke: var(--white);
}

/* Delivery */
.delivery {
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
}

.delivery p {
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  font-size: 1rem;
  line-height: 1.6;
}

.delivery strong {
  color: var(--text);
}

/* Contacts */
.contacts {
  background: var(--beige-light);
}

.contacts__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

/* Footer */
.footer {
  padding: 1.75rem 0;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal.is-open {
  display: flex;
}

.modal__box {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 380px;
  width: 100%;
  text-align: center;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background var(--transition);
}

.modal__close:hover {
  background: var(--beige-light);
}

.modal__box h2 {
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
}

.modal__box p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.modal__links {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

/* Product page */
.product-page {
  padding: 2rem 0 4rem;
}

.product {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

.product__img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--beige-light);
}

.product__name {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.product__price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 1.25rem;
}

.product__desc {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-size: 1rem;
  line-height: 1.6;
}

.product__specs {
  margin-bottom: 1.5rem;
  font-size: 0.9375rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1rem;
}

.product__specs dt {
  font-weight: 600;
  color: var(--text-secondary);
}

.product__specs dd {
  color: var(--text);
}

.rod-sizes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 1.5rem;
}

.rod-size {
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
}

.rod-size:hover {
  border-color: var(--green);
}

.rod-size.is-active {
  border-color: var(--green-dark);
  background: var(--green-dark);
  color: var(--white);
}

.rod-hint {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.product-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin-bottom: 1.5rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color var(--transition);
}

.back-link:hover {
  color: var(--text);
}

/* Admin */
.admin {
  max-width: 640px;
  margin: 2rem auto;
  padding: 0 1rem 3rem;
}

.admin h1 {
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  font-weight: 700;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.form label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form input,
.form textarea {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9375rem;
  transition: border-color var(--transition);
}

.form input:focus,
.form textarea:focus {
  outline: none;
  border-color: var(--green-dark);
}

.form textarea {
  min-height: 80px;
  resize: vertical;
}

.rod-fieldset {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.rod-fieldset legend {
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 0 0.5rem;
  color: var(--text-secondary);
}

.rod-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.rod-check {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-weight: 400;
  cursor: pointer;
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.admin-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  background: var(--beige-light);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
}

.admin-item__info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.admin-item__thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--beige);
  flex-shrink: 0;
}

.admin-item__actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.admin-item .btn-edit,
.admin-item .btn-del {
  background: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
}

.admin-item .btn-edit {
  border: 1px solid var(--green-dark);
  color: var(--green-dark);
}

.admin-item .btn-edit:hover {
  background: var(--green-dark);
  color: var(--white);
}

.admin-item .btn-del {
  border: 1px solid #d44;
  color: #d44;
}

.admin-item .btn-del:hover {
  background: #d44;
  color: var(--white);
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  background: var(--beige-light);
  transition: all var(--transition);
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.dropzone:hover,
.dropzone.is-drag {
  border-color: var(--green-dark);
  background: var(--beige);
}

.dropzone__text {
  color: var(--text-muted);
  font-size: 0.9375rem;
  pointer-events: none;
}

.dropzone__preview {
  max-width: 100%;
  max-height: 200px;
  border-radius: var(--radius-sm);
  object-fit: contain;
}

.hidden {
  display: none !important;
}

.error {
  color: #d44;
  font-size: 0.875rem;
}

/* Nav toggle (mobile) */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  transition: all var(--transition);
  border-radius: 1px;
}

.nav-toggle.is-open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.is-open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.is-open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 1rem 24px 1.5rem;
    gap: 0;
  }

  .nav.is-open {
    display: flex;
  }

  .nav a {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
  }

  .nav a:last-child {
    border-bottom: none;
  }

  .products {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto;
  }

  .benefits__grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .product {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .hero {
    padding: 3rem 0 2.5rem;
  }

  .section {
    padding: 3rem 0;
  }

  .section__title {
    font-size: 1.5rem;
  }

  .header__inner {
    height: 56px;
  }

  .product-actions {
    flex-direction: column;
  }

  .product-actions .btn {
    width: 100%;
  }
}

@media (min-width: 769px) and (max-width: 960px) {
  .products {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}
