:root {
  --color-primary: #5B9B8A;
  --color-text: #2D3E4F;
  --color-cream: #F9F8F6;
  --color-wine: #8B3A3A;
  --color-yellow: #E8C547;
  --color-white: #FFFFFF;
  --color-border: #E7E1DB;
  --shadow-soft: 0 16px 36px rgba(45, 62, 79, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--color-cream);
  color: var(--color-text);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.6;
}

body.modal-open {
  overflow: hidden;
}

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

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

button,
input,
select {
  font: inherit;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

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

.header-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: min(100% - 2rem, 1120px);
  margin: 0 auto;
  padding: 1rem 0;
}

.logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-decoration: none;
}

.main-nav {
  width: 100%;
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1rem;
  list-style: none;
}

.nav-link {
  display: inline-flex;
  padding: 0.35rem 0.1rem;
  color: var(--color-text);
  font-size: 0.95rem;
  font-weight: 700;
}

.nav-link:hover,
.nav-link:focus {
  color: var(--color-primary);
}

.hero {
  position: relative;
  display: grid;
  min-height: 78vh;
  place-items: center;
  overflow: hidden;
  background-image: url("images/hero-bg.png");
  background-attachment: fixed;
  background-position: center;
  background-size: cover;
  text-align: center;
}

.hero::after {
  position: absolute;
  inset: 0;
  content: "";
  background: rgba(45, 62, 79, 0.48);
}

.hero-background {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(100% - 2rem, 820px);
  color: var(--color-white);
}

.hero-title {
  margin: 0 0 1.5rem;
  font-size: clamp(2.25rem, 12vw, 4.75rem);
  line-height: 1.05;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.85rem 1.5rem;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
  text-align: center;
  transition: transform 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.button-primary {
  background: var(--color-primary);
  color: var(--color-white);
  box-shadow: 0 12px 26px rgba(91, 155, 138, 0.28);
}

.button-primary:hover,
.button-primary:focus {
  background: #4D8778;
  transform: translateY(-2px);
}

.button-large {
  min-height: 3.8rem;
  padding: 1rem 2.25rem;
  font-size: 1.12rem;
}

.section-container,
.footer-container {
  width: min(100% - 2rem, 1120px);
  margin: 0 auto;
}

.section-narrow {
  max-width: 780px;
}

.catalog,
.benefits,
.how-to-use,
.order-section {
  padding: 4rem 0;
}

.catalog,
.how-to-use,
.order-section {
  background: var(--color-cream);
}

.benefits {
  background: var(--color-white);
}

.centered-section {
  text-align: center;
}

.section-title {
  margin: 0 0 1.5rem;
  color: var(--color-text);
  font-size: clamp(2rem, 8vw, 3rem);
  line-height: 1.1;
  text-align: center;
}

.section-intro {
  margin: 0 auto 1.5rem;
  max-width: 680px;
  font-size: 1.08rem;
}

.product-grid {
  display: grid;
  gap: 1.5rem;
}

.product-card {
  overflow: hidden;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.product-card:nth-child(1) {
  border-top: 5px solid var(--color-primary);
}

.product-card:nth-child(2) {
  border-top: 5px solid var(--color-wine);
}

.product-card:nth-child(3) {
  border-top: 5px solid var(--color-yellow);
}

.product-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #EDE9E2;
  object-fit: cover;
}

.product-content {
  padding: 1.35rem;
}

.product-title {
  margin: 0 0 0.5rem;
  color: var(--color-primary);
  font-size: 1.45rem;
  line-height: 1.2;
}

.product-card:nth-child(2) .product-title {
  color: var(--color-wine);
}

.product-card:nth-child(3) .product-title {
  color: #B89824;
}

.product-description,
.product-benefit {
  margin: 0 0 1rem;
}

.product-benefit {
  margin-bottom: 0;
}

.product-subtitle {
  margin: 1rem 0 0.35rem;
  color: var(--color-text);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ingredient-list,
.benefit-list,
.feature-list,
.location-list,
.social-list {
  list-style: none;
}

.ingredient-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-size: 0.85rem;
}

.ingredient-list li {
  padding: 0.25rem 0.6rem;
  background: var(--color-cream);
  border-radius: 999px;
}

.benefit-list {
  display: grid;
  gap: 0.35rem;
  font-size: 0.9rem;
}

.benefit-list li {
  position: relative;
  padding-left: 1rem;
}

.benefit-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.35rem;
  height: 0.35rem;
  background: var(--color-primary);
  border-radius: 50%;
}

.feature-list,
.steps-list {
  display: grid;
  gap: 0.75rem;
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
  font-size: 1.05rem;
}

.steps-list {
  list-style-position: inside;
}

.order-section {
  text-align: center;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(45, 62, 79, 0.62);
}

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

.modal {
  width: min(100%, 760px);
  max-height: min(92vh, 820px);
  overflow: hidden;
  background: var(--color-white);
  border-radius: 8px;
  box-shadow: 0 28px 70px rgba(45, 62, 79, 0.28);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--color-primary);
  color: var(--color-white);
}

.modal-title {
  margin: 0;
  font-size: 1.25rem;
}

.modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: var(--color-white);
  cursor: pointer;
  font-size: 1.75rem;
  line-height: 1;
}

.modal-frame {
  width: 100%;
  height: min(72vh, 680px);
  border: 0;
}

.site-footer {
  background: var(--color-primary);
  color: var(--color-white);
  padding: 3rem 0;
}

.footer-container {
  display: grid;
  gap: 2rem;
}

.footer-title {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}

.contact-info,
.location-list,
.social-list {
  display: grid;
  gap: 0.4rem;
  font-style: normal;
}

.footer-link {
  color: var(--color-white);
}

.footer-link:hover,
.footer-link:focus {
  color: var(--color-yellow);
}

.footer-note {
  color: rgba(255, 255, 255, 0.78);
}

.form-page {
  min-height: 100vh;
  background: var(--color-cream);
}

.dashboard-page {
  min-height: 100vh;
  background: var(--color-cream);
}

.dashboard-shell {
  width: min(100% - 2rem, 1180px);
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.dashboard-logo {
  justify-content: flex-start;
}

.dashboard-title {
  margin: 0.35rem 0 0;
  font-size: clamp(2rem, 8vw, 3.2rem);
  line-height: 1.05;
}

.dashboard-login,
.dashboard-content {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  padding: 1.25rem;
}

.dashboard-login {
  max-width: 460px;
}

.dashboard-panel-title {
  margin: 0 0 1rem;
  font-size: 1.35rem;
}

.dashboard-login-form,
.dashboard-toolbar {
  display: grid;
  gap: 1rem;
}

.dashboard-refresh {
  align-self: end;
}

.button-secondary {
  background: var(--color-white);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.button-secondary:hover,
.button-secondary:focus {
  transform: translateY(-2px);
}

.dashboard-summary {
  display: grid;
  gap: 1rem;
  margin: 1.25rem 0;
}

.dashboard-breakdown {
  display: grid;
  gap: 1rem;
  margin: 0 0 1.25rem;
}

.summary-card {
  padding: 1rem;
  background: var(--color-cream);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.breakdown-card {
  padding: 1rem;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.breakdown-title {
  margin: 0 0 0.85rem;
  font-size: 1rem;
  line-height: 1.2;
}

.breakdown-list {
  display: grid;
  gap: 0.65rem;
}

.breakdown-row {
  display: grid;
  gap: 0.15rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--color-border);
}

.breakdown-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.breakdown-row span {
  font-weight: 800;
}

.breakdown-row strong {
  color: var(--color-primary);
  font-size: 1.15rem;
  line-height: 1.1;
}

.breakdown-row small,
.breakdown-empty {
  color: rgba(45, 62, 79, 0.72);
}

.breakdown-empty {
  margin: 0;
}

.summary-label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
}

.summary-value {
  display: block;
  font-size: 1.65rem;
  line-height: 1.1;
}

.dashboard-message {
  min-height: 1.5rem;
  margin: 1rem 0;
  font-weight: 700;
}

.dashboard-message.is-error {
  color: var(--color-wine);
}

.dashboard-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.dashboard-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  background: var(--color-white);
}

.dashboard-table th,
.dashboard-table td {
  padding: 0.9rem;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: top;
}

.dashboard-table th {
  background: var(--color-cream);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dashboard-table td strong,
.dashboard-table td span {
  display: block;
}

.dashboard-empty {
  text-align: center;
}

.status-pill {
  display: inline-flex;
  width: fit-content;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: var(--color-border);
  font-size: 0.82rem;
  font-weight: 800;
}

.status-approved {
  background: rgba(91, 155, 138, 0.18);
  color: #2F6F60;
}

.status-pending,
.status-in_process {
  background: rgba(232, 197, 71, 0.28);
  color: #745D08;
}

.status-rejected,
.status-cancelled {
  background: rgba(139, 58, 58, 0.15);
  color: var(--color-wine);
}

.form-shell {
  width: min(100% - 2rem, 680px);
  margin: 0 auto;
  padding: 2rem 0;
}

.form-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  padding: 1.5rem;
}

.form-title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.8rem, 8vw, 2.5rem);
  line-height: 1.1;
}

.form-intro {
  margin: 0 0 1.5rem;
}

.order-form {
  display: grid;
  gap: 1rem;
}

.form-field,
.checkbox-group,
.quantity-group {
  display: grid;
  gap: 0.4rem;
}

.form-label,
.checkbox-group legend,
.quantity-group legend {
  font-weight: 800;
}

.form-input,
.form-select {
  width: 100%;
  min-height: 3rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-white);
  color: var(--color-text);
}

.checkbox-group {
  margin: 0;
  padding: 0;
  border: 0;
}

.quantity-group {
  margin: 0;
  padding: 0;
  border: 0;
}

.quantity-grid {
  display: grid;
  gap: 0.75rem;
}

.checkbox-list {
  display: grid;
  gap: 0.5rem;
}

.checkbox-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.checkbox-option input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--color-primary);
}

.form-message {
  display: none;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  background: #EAF4F1;
  color: var(--color-text);
  font-weight: 800;
}

.form-message.is-visible {
  display: block;
}

.form-message.is-error {
  background: #F6E7E7;
  color: var(--color-wine);
}

.wallet-container {
  min-height: 4rem;
}

@media (min-width: 640px) {
  .header-container {
    gap: 1.25rem;
  }

  .nav-list {
    gap: 1.5rem;
  }

  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .footer-container {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .form-card {
    padding: 2rem;
  }

  .quantity-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-toolbar {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .dashboard-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-breakdown {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .header-container {
    position: relative;
    min-height: 82px;
    justify-content: center;
  }

  .logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }

  .main-nav {
    width: 100%;
  }

  .nav-list {
    justify-content: space-between;
  }

  .nav-item:nth-child(2) {
    margin-right: 140px;
  }
}
