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

html {
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  overflow-x: hidden;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: 16px;
}

@media (min-width: 768px) {
  .container {
    padding-inline: 24px;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-header);
  transition: box-shadow var(--duration-med) var(--ease-out), background var(--duration-med) var(--ease-out);
  overflow: visible;
}

.site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-card);
}

.site-header__inner {
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.site-header__top {
  display: grid;
  gap: 10px;
  align-items: center;
  padding-block: 10px 8px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas:
    "logo cart toggle"
    "search search search"
    "hotlines hotlines hotlines";
}

.header-cart {
  grid-area: cart;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  color: var(--color-text);
  border-radius: var(--radius-sm, 8px);
  transition: background var(--duration-fast) var(--ease-out);
}

.header-cart:hover {
  background: var(--color-surface, #f4f4f5);
}

.header-cart .icon {
  width: 22px;
  height: 22px;
}

.header-cart__badge {
  position: absolute;
  top: 4px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  color: #fff;
  background: var(--color-accent);
  border-radius: 999px;
  pointer-events: none;
}

@media (min-width: 768px) {
  .site-header__top {
    grid-template-columns: auto minmax(200px, 1fr) auto auto;
    grid-template-areas: "logo search cart hotlines";
    gap: 16px 20px;
    padding-block: 16px 12px;
  }
}

.logo {
  grid-area: logo;
  min-width: 0;
}

.logo__text {
  display: block;
  font-size: clamp(1.2rem, 4vw, 1.75rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  text-transform: lowercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logo__dot {
  color: var(--color-brand);
}

.search-form {
  grid-area: search;
  display: flex;
  align-items: stretch;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  overflow: hidden;
  background: var(--color-surface);
  box-shadow: inset 0 1px 2px rgba(24, 24, 27, 0.04);
  transition:
    border-color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}

.search-form:focus-within {
  border-color: var(--color-accent-line);
  box-shadow:
    inset 0 1px 2px rgba(24, 24, 27, 0.04),
    0 0 0 3px var(--color-accent-soft);
}

.search-form__input {
  flex: 1;
  min-width: 0;
  border: 0;
  padding: 11px 18px;
  font: inherit;
  background: transparent;
  outline: none;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
}

.search-form__input:focus,
.search-form__input:focus-visible {
  outline: none;
  box-shadow: none;
}

.search-form__input::-webkit-search-decoration,
.search-form__input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.search-form__btn {
  border: 0;
  background: var(--color-ink);
  color: #fff;
  padding: 0 18px;
  cursor: pointer;
  min-width: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-spring);
}

.search-form__btn .icon {
  width: 20px;
  height: 20px;
}

.search-form__btn:hover {
  background: var(--color-ink-hover);
}

.search-form__btn:active {
  transform: scale(0.97);
}

.hotlines {
  grid-area: hotlines;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  font-size: 13px;
  min-width: 0;
  width: 100%;
}

.hotlines__item {
  min-height: 40px;
  flex: 1 1 calc(50% - 5px);
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-btn);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  transition:
    border-color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}

.hotlines__item:hover {
  border-color: var(--color-accent-line);
  box-shadow: var(--shadow-card);
  transform: translateY(-1px);
}

.hotlines__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--color-bg);
  color: var(--color-ink);
  flex-shrink: 0;
  border: 1px solid var(--color-border);
}

.hotlines__icon .icon {
  width: 16px;
  height: 16px;
}

.hotlines__body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.25;
  font-size: 12px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .hotlines {
    width: auto;
  }

  .hotlines__item {
    flex: 0 1 auto;
    min-height: 44px;
    gap: 10px;
    padding: 8px 14px;
  }

  .hotlines__icon {
    width: 36px;
    height: 36px;
  }

  .hotlines__icon .icon {
    width: 18px;
    height: 18px;
  }

  .hotlines__body {
    font-size: 13px;
    gap: 2px;
    white-space: normal;
  }
}

.hotlines__label {
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.nav-toggle {
  grid-area: toggle;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-btn);
  background: #fff;
  cursor: pointer;
}

@media (min-width: 1024px) {
  .nav-toggle {
    display: none;
  }
}

.nav-toggle__bar {
  display: block;
  height: 2px;
  width: 20px;
  margin-inline: auto;
  background: var(--color-text);
}

.site-header__nav {
  border-top: 1px solid var(--color-border);
  padding-block: 0;
  background: var(--color-surface);
  overflow: visible;
}

.site-nav {
  padding: 0;
  overflow: visible;
}

@media (max-width: 1023px) {
  .site-nav {
    display: none;
  }

  .site-nav.is-open {
    display: block;
    padding-bottom: 8px;
  }

  .site-nav.is-open > .nav-menu {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 2px;
  }

  .site-nav.is-open .nav-menu--sub {
    display: none;
  }

  .site-nav.is-open .nav-menu__item--has-children.is-nav-open > .nav-menu--sub {
    display: flex;
  }
}

.nav-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  min-width: 0;
}

.nav-menu--sub {
  list-style: none;
  margin: 0;
  padding: 0;
  flex-direction: column;
  gap: 2px;
}

@media (max-width: 1023px) {
  .nav-menu--sub {
    padding-left: 12px;
    margin-top: 4px;
    width: 100%;
  }
}

.nav-menu__item {
  position: relative;
}

.nav-menu__item a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.nav-menu__item a:hover {
  background: var(--color-bg-alt);
  color: var(--color-accent-hover);
}

.nav-menu__item--depth-1 > a {
  font-weight: 600;
}

@media (min-width: 1024px) {
  .site-nav {
    overflow: visible;
  }

  .nav-menu {
    flex-wrap: wrap;
    gap: 0;
    overflow: visible;
    padding-block: 0;
  }

  .site-header__nav > .nav-menu > .nav-menu__item > a {
    font-weight: 500;
    font-size: 13px;
    letter-spacing: 0.01em;
    padding: 10px clamp(7px, 0.75vw, 11px);
    border-radius: 0;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    min-height: 44px;
    transition: color 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
  }

  @media (min-width: 1280px) {
    .site-header__nav > .nav-menu > .nav-menu__item > a {
      padding: 11px 13px;
    }
  }

  .site-header__nav > .nav-menu > .nav-menu__item > a:hover,
  .site-header__nav > .nav-menu > .nav-menu__item:focus-within > a {
    background: transparent;
    border-bottom-color: var(--color-brand);
    color: var(--color-text);
  }

  .nav-menu__item--has-children {
    position: relative;
  }

  /* Vùng nối chuột từ mục cha xuống dropdown (tránh mất hover) */
  .nav-menu__item--has-children::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 10px;
    z-index: 109;
  }

  .nav-menu--sub {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 240px;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    box-shadow: var(--shadow-card-hover);
    z-index: 120;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(6px);
    transition:
      opacity 0.18s var(--ease-out),
      transform 0.18s var(--ease-out),
      visibility 0.18s;
  }

  .nav-menu--sub .nav-menu--sub {
    top: -6px;
    left: calc(100% + 4px);
    margin-left: 0;
  }

  .nav-menu__item--has-children:hover > .nav-menu--sub,
  .nav-menu__item--has-children:focus-within > .nav-menu--sub,
  .nav-menu__item--has-children.is-nav-open > .nav-menu--sub {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nav-menu--sub .nav-menu__item a {
    border-radius: 8px;
    font-size: 13px;
    min-height: 40px;
    padding: 8px 12px;
  }

  .nav-menu--sub .nav-menu__item a:hover {
    background: var(--color-accent-soft);
    color: var(--color-text);
  }

  .nav-menu__item--has-children > a {
    position: relative;
    padding-right: 22px;
  }

  .nav-menu__item--has-children > a::after {
    content: "";
    position: absolute;
    right: 8px;
    top: 50%;
    width: 0;
    height: 0;
    margin-top: -2px;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    opacity: 0.55;
  }

  .nav-menu--sub .nav-menu__item--has-children > a::after {
    right: 10px;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 5px solid currentColor;
    border-right: 0;
    margin-top: -4px;
  }
}

/* Main — block spacing 15px (--space-block) */
.site-main {
  min-height: 40vh;
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
}

.site-main > :last-child {
  padding-bottom: var(--space-block);
}

.home-section {
  padding-top: var(--space-block);
  padding-bottom: 0;
  background: var(--color-surface);
}

.home-hero + .home-section,
.home-section + .home-section,
.product-page + .home-section,
.product-page + section.home-section {
  padding-top: var(--space-block);
}

.home-section__head {
  margin-bottom: var(--space-head-bottom);
  padding-bottom: 0;
  border-bottom: none;
}

.home-section--alt {
  background: var(--color-bg);
}

.home-section__title {
  margin: 0;
  font-size: clamp(1.4rem, 2.8vw, 1.875rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--color-text);
}

.home-section__title::before {
  content: "";
  flex-shrink: 0;
  width: 32px;
  height: 3px;
  border-radius: 2px;
  background: var(--color-brand);
}

.page-title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin: 0 0 var(--space-head-bottom);
}

.search-result-msg {
  margin: 0 0 var(--space-block);
  font-size: 0.9375rem;
  color: var(--color-text-muted);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-block);
}

@media (min-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  .product-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.product-card {
  background: var(--color-surface);
  border-radius: var(--radius-card);
  border: 1px solid var(--color-border);
  box-shadow: none;
  overflow: hidden;
  transition:
    transform var(--duration-med) var(--ease-out),
    box-shadow var(--duration-med) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-card__link {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  color: inherit;
}

.product-card:hover {
  transform: translateY(-5px);
  border-color: transparent;
  box-shadow: var(--shadow-card-hover);
}

.product-card__media {
  position: relative;
  aspect-ratio: 1;
  background: linear-gradient(180deg, #fafafa 0%, #f4f4f5 100%);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.product-card__media img,
.product-card__img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.35s var(--ease-out);
}

.product-card__img.is-fallback {
  width: auto;
  height: auto;
  max-width: 52%;
  max-height: 52%;
  object-fit: contain;
  opacity: 0.75;
  filter: grayscale(0.15);
}

.product-card:hover .product-card__img:not(.is-fallback) {
  transform: scale(1.04);
}

.product-card__badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--color-sale);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 8px;
  letter-spacing: 0.02em;
}

.product-card__price--sale {
  color: var(--color-sale);
}

.product-card__title {
  margin: 0;
  padding: 10px 10px 0;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--color-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.product-card__prices {
  padding: 8px 10px 12px;
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: baseline;
}

@media (min-width: 768px) {
  .product-card__title {
    padding: 14px 14px 0;
    font-size: 13px;
  }

  .product-card__prices {
    padding: 10px 14px 16px;
    gap: 6px 10px;
  }
}

.product-card__price {
  font-weight: 700;
  font-size: 15px;
  color: var(--color-price);
}

.product-card__price--old {
  font-size: 13px;
  font-weight: 400;
  color: var(--color-text-muted);
  text-decoration: line-through;
}

/* Empty state trang chính (PLP, tìm kiếm) — GLOBAL §1.7 ngoại lệ; không dùng cho block tùy chọn homepage */
.product-empty {
  color: var(--color-text-muted);
  margin: 0;
  padding: var(--space-block);
  text-align: center;
  background: var(--color-surface);
  border-radius: var(--radius-card);
  border: 1px dashed var(--color-border);
}

.site-footer {
  background: var(--color-ink);
  color: rgba(255, 255, 255, 0.9);
  padding-block: var(--space-block);
}

.site-footer__inner {
  text-align: center;
}

.site-footer__line {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.72);
}

.site-footer__line:last-child {
  margin-bottom: 0;
}

/* Home hero + USP */
.home-hero {
  padding-top: var(--space-block);
  padding-bottom: 0;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.home-hero__inner {
  display: grid;
  gap: var(--space-block);
}

@media (min-width: 768px) {
  .home-hero__inner {
    grid-template-columns: 1.05fr 1fr;
    align-items: center;
    gap: var(--space-block);
  }
}

.home-hero__eyebrow {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-brand);
}

.home-hero__title {
  margin: 0 0 14px;
  font-size: clamp(1.75rem, 4.2vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.12;
  color: var(--color-text);
}

.home-hero__subtitle {
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
  color: var(--color-text-muted);
  max-width: 40ch;
}

.home-usp {
  list-style: none;
  margin: 0;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  background: var(--color-bg);
  border-radius: calc(var(--radius-card) + 4px);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-card);
  min-width: 0;
}

@media (min-width: 768px) {
  .home-usp {
    padding: 22px;
    gap: 14px;
  }
}

.home-usp__item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  min-width: 0;
  border-radius: var(--radius-btn);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  transition: transform var(--duration-fast) var(--ease-spring), box-shadow var(--duration-fast) var(--ease-out);
}

@media (min-width: 768px) {
  .home-usp__item {
    gap: 12px;
    padding: 14px;
  }
}

.home-hero.is-visible .home-usp__item {
  animation: usp-rise var(--duration-med) var(--ease-out) backwards;
}

.home-hero.is-visible .home-usp__item:nth-child(1) {
  animation-delay: 0.05s;
}

.home-hero.is-visible .home-usp__item:nth-child(2) {
  animation-delay: 0.12s;
}

.home-hero.is-visible .home-usp__item:nth-child(3) {
  animation-delay: 0.19s;
}

.home-hero.is-visible .home-usp__item:nth-child(4) {
  animation-delay: 0.26s;
}

@keyframes usp-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.home-usp__item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}

.home-usp__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--color-brand-soft);
  color: var(--color-brand);
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .home-usp__icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }
}

.home-usp__icon .icon {
  width: 22px;
  height: 22px;
}

.home-usp__text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.home-usp__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

.home-usp__desc {
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.4;
}

/* Scroll reveal (GLOBAL §1.3 — transform + opacity) */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity var(--duration-slow) var(--ease-out),
    transform var(--duration-slow) var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.home-section .product-card {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity var(--duration-med) var(--ease-out),
    transform var(--duration-med) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out);
  transition-delay: calc(var(--stagger, 0) * 80ms);
}

.home-section.is-visible .product-card {
  opacity: 1;
  transform: translateY(0);
}

.icon {
  flex-shrink: 0;
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  .reveal,
  .home-section .product-card {
    opacity: 1;
    transform: none;
  }

  .product-card:hover {
    transform: none;
  }

  .home-usp__item:hover {
    transform: none;
  }

  .home-hero.is-visible .home-usp__item {
    animation: none;
  }
}

/* Product detail (F002) */
.product-page.container {
  padding-top: var(--space-block);
  padding-bottom: 0;
}

.product-page__grid {
  display: grid;
  gap: var(--space-block);
  min-width: 0;
}

.product-page__grid > * {
  min-width: 0;
  max-width: 100%;
}

@media (min-width: 768px) {
  .product-page__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }
}

.product-gallery__main.product-card__media {
  border-radius: var(--radius-card);
  border: 1px solid var(--color-border);
  background: #fff;
  padding: 0;
}

.product-gallery__thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: var(--space-block) 0 0;
  padding: 0;
  list-style: none;
}

.product-gallery__thumb {
  width: 72px;
  height: 72px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius-sm, 8px);
  background: #fff;
  cursor: pointer;
  overflow: hidden;
}

.product-gallery__thumb.is-active {
  border-color: var(--color-accent);
}

.product-gallery__thumb-media.product-card__media {
  width: 100%;
  height: 100%;
  padding: 0;
  background: #fff;
  border-radius: 0;
}

.product-summary__title {
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  line-height: 1.25;
  margin: 0 0 12px;
}

.product-summary__prices {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 12px;
  margin-bottom: var(--space-block);
}

.product-summary__price {
  font-size: 1.35rem;
  font-weight: 600;
}

.product-summary__price--sale {
  color: var(--color-accent);
}

.product-summary__price--old {
  font-size: 1rem;
  font-weight: 400;
  color: var(--color-muted, #6b7280);
  text-decoration: line-through;
}

.product-summary__badge {
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  background: var(--color-accent);
  padding: 2px 8px;
  border-radius: 999px;
}

.product-policy {
  margin-bottom: var(--space-block);
  padding: 14px;
  border-radius: var(--radius-card);
  background: var(--color-surface, #f8fafc);
  border: 1px solid var(--color-border);
}

.product-policy__title {
  font-size: 1rem;
  margin: 0 0 8px;
}

.product-policy__list {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.9375rem;
}

.product-stock--out {
  font-weight: 600;
  color: #b45309;
}

.product-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (min-width: 480px) {
  .product-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  font: inherit;
  font-weight: 600;
  border-radius: var(--radius-sm, 8px);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-out), opacity var(--duration-fast);
}

.btn--primary {
  background: var(--color-accent);
  color: #fff;
}

.btn--secondary {
  background: #fff;
  border-color: var(--color-border);
  color: var(--color-text);
}

.btn--block {
  width: 100%;
}

.product-actions__form {
  margin: 0;
}

.product-description {
  margin-top: var(--space-block);
  padding-top: 0;
  border-top: 1px solid var(--color-border);
  min-width: 0;
  max-width: 100%;
}

.product-description__title {
  font-size: 1.25rem;
  margin: var(--space-block) 0 var(--space-block);
}

.product-description__body {
  font-size: 0.9375rem;
  line-height: 1.7;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

.product-description__body img,
.product-description__body video,
.product-description__body iframe {
  max-width: 100%;
  height: auto;
}

.product-description__body table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.flash {
  padding: 10px 14px;
  border-radius: var(--radius-sm, 8px);
  margin-bottom: var(--space-block);
  font-size: 0.9375rem;
}

.flash--success {
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
}

.flash--error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
}

.buy-dialog {
  width: min(100% - 32px, 420px);
  max-height: calc(100vh - 32px);
  padding: 0;
  border: none;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

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

.buy-dialog__form {
  padding: 20px;
}

.buy-dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.buy-dialog__title {
  margin: 0;
  font-size: 1.125rem;
}

.buy-dialog__close {
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
}

.field {
  display: block;
  margin-bottom: 14px;
  border: none;
  padding: 0;
}

.field__label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 6px;
}

.field__hint {
  display: block;
  font-size: 0.8125rem;
  color: var(--color-muted, #6b7280);
  margin-bottom: 6px;
  line-height: 1.45;
}

.field__input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  font: inherit;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm, 8px);
}

.field__textarea {
  min-height: 88px;
  resize: vertical;
}

.radio {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.9375rem;
  cursor: pointer;
}

.bank-info {
  margin: 12px 0 16px;
  padding: 12px;
  background: var(--color-surface, #f8fafc);
  border-radius: var(--radius-sm, 8px);
  font-size: 0.875rem;
}

.bank-info__line {
  margin: 0 0 4px;
}

.category-page.home-section {
  padding-top: var(--space-block);
  padding-bottom: 0;
}

.category-empty {
  padding: var(--space-block) 0;
  text-align: center;
}

.category-empty__text {
  margin-bottom: var(--space-block);
}

.category-page__title,
.cart-page__title,
.checkout-page__title,
.checkout-success__title {
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  margin: 0 0 var(--space-head-bottom);
}

.category-page__count {
  margin: 0 0 var(--space-head-bottom);
  font-size: 0.9375rem;
  color: var(--color-muted, #6b7280);
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: var(--space-head-bottom);
  font-size: 0.9375rem;
}

.pagination__link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm, 8px);
}

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

.pagination__status {
  color: var(--color-muted, #6b7280);
}

.cart-page,
.checkout-page {
  padding-top: var(--space-block);
  padding-bottom: 0;
}

.cart-empty {
  padding: var(--space-block) 0;
  text-align: center;
}

.cart-empty__text {
  margin-bottom: var(--space-block);
}

.cart-form {
  min-width: 0;
  max-width: 100%;
}

.cart-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: var(--space-head-bottom);
  max-width: 100%;
}

.cart-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.cart-table th,
.cart-table td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.cart-table th {
  text-align: left;
  font-weight: 600;
  font-size: 0.875rem;
}

.cart-table__link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  min-width: 0;
}

.cart-table__media {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  padding: 0;
  aspect-ratio: 1;
  border-radius: var(--radius-sm, 8px);
  border: 1px solid var(--color-border);
  overflow: hidden;
  background: #fff;
}

.cart-table__media .product-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-table__name {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.4;
  font-weight: 500;
}

.cart-qty-input {
  width: 72px;
  max-width: 100%;
  min-height: 44px;
  padding: 8px;
  font: inherit;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm, 8px);
}

.cart-table__stock {
  display: block;
  font-size: 0.75rem;
  color: var(--color-muted, #6b7280);
  margin-top: 4px;
}

.cart-table__price,
.cart-table__amount {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cart-summary {
  display: flex;
  flex-direction: column;
  gap: var(--space-block);
  align-items: stretch;
  padding: 14px;
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
}

.cart-summary__totals {
  margin: 0;
  width: 100%;
}

@media (min-width: 641px) {
  .cart-summary {
    align-items: flex-end;
    padding: 16px 0 0;
    border: none;
    border-radius: 0;
    background: transparent;
  }

  .cart-summary__totals {
    max-width: 360px;
  }
}

.cart-summary__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  font-size: 1.0625rem;
  font-weight: 600;
  margin: 0;
}

.cart-summary__row dt,
.cart-summary__row dd {
  margin: 0;
}

.cart-summary__row dd {
  font-variant-numeric: tabular-nums;
}

.cart-summary__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.cart-summary__actions .btn {
  width: 100%;
}

@media (min-width: 641px) {
  .cart-summary__actions {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
    width: auto;
    max-width: 360px;
    gap: 12px;
  }

  .cart-summary__actions .btn {
    width: auto;
    flex: 0 1 auto;
  }
}

.checkout-page__grid {
  display: grid;
  gap: var(--space-block);
}

@media (min-width: 768px) {
  .checkout-page__grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.checkout-order {
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface, #f8fafc);
}

.checkout-order__title {
  margin: 0 0 12px;
  font-size: 1.125rem;
}

.checkout-order__list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}

.checkout-order__item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9375rem;
  min-width: 0;
}

.checkout-order__item > :first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.checkout-order__item > :last-child {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.checkout-order__total {
  font-size: 1.0625rem;
  margin: 0 0 12px;
}

.checkout-form {
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: #fff;
}

.checkout-success {
  padding-top: var(--space-block);
  padding-bottom: 0;
  text-align: center;
}

.checkout-success__lead {
  margin: 0 0 var(--space-head-bottom);
}

@media (max-width: 640px) {
  .cart-table-wrap {
    overflow: visible;
  }

  .cart-table,
  .cart-table tbody {
    display: block;
    width: 100%;
  }

  .cart-table thead {
    display: none;
  }

  .cart-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px 12px;
    align-items: start;
    width: 100%;
    margin: 0 0 12px;
    padding: 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    background: var(--color-surface);
    box-sizing: border-box;
  }

  .cart-table tr:last-child {
    margin-bottom: 0;
  }

  .cart-table td {
    display: block;
    border: none;
    padding: 0;
    min-width: 0;
    max-width: 100%;
  }

  .cart-table__product {
    grid-column: 1 / -1;
  }

  .cart-table__link {
    align-items: flex-start;
  }

  .cart-table__media {
    width: 64px;
    height: 64px;
  }

  .cart-table__name {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.9375rem;
  }

  .cart-table__price,
  .cart-table__amount,
  .cart-table__qty {
    white-space: normal;
  }

  .cart-table__price::before,
  .cart-table__amount::before,
  .cart-table__qty::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--color-muted, #6b7280);
  }

  .cart-table__qty {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
  }

  .cart-table__qty::before {
    flex: 1 0 100%;
    margin-bottom: 0;
  }

  .cart-qty-input {
    width: 88px;
  }

  .cart-table__stock {
    margin-top: 0;
  }

  .cart-table__amount {
    text-align: right;
    font-weight: 600;
  }

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

  .home-section__title {
    font-size: 1.25rem;
    gap: 10px;
  }

  .home-section__title::before {
    width: 20px;
  }

  .search-form__input {
    padding: 10px 14px;
  }

  .search-form__btn {
    padding: 0 14px;
    min-width: 44px;
  }
}

@media (max-width: 360px) {
  .home-usp {
    grid-template-columns: 1fr;
  }

  .hotlines__item {
    flex: 1 1 100%;
  }

  .product-grid {
    gap: 10px;
  }

  .container {
    padding-inline: 12px;
  }
}
