/* === css/base/reset.css === */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  min-height: 100vh;
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body:not(.admin-body) {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
  border: none;
  background: none;
  outline: none;
}

button {
  cursor: pointer;
}

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

ul,
ol {
  list-style: none;
}

table {
  border-collapse: collapse;
}

h1, h2, h3, h4, h5, h6 {
  font-size: inherit;
  font-weight: inherit;
}



/* === css/base/variables.css === */
:root {
  /* --- Colors --- */
  --color-bg:             #F6F6F6;
  --color-white:          #FFFFFF;
  --color-black:          #000000;
  --color-gray-light:     #F5F5F5;
  --color-gray-border:    #E1E1E1;
  --color-gray-divider:   #F0F0F0;
  --color-primary:        #E41616;
  --color-red-dot:        #FF0000;
  --color-gold:           #DBBF23;
  --color-green:          #54DB23;
  --color-green-toggle:   #59E326;
  --color-icon:           #33363F;
  --color-dark:           #242424;
  --color-link:           #0077FF;
  --color-overlay:        rgba(0, 0, 0, 0.32);
  --color-overlay-dark:   rgba(0, 0, 0, 0.64);
  --color-inactive:       rgba(255, 255, 255, 0.64);

  /* --- Typography --- */
  --font-primary:    'Google Sans', sans-serif;
  --font-badge:      'Google Sans', sans-serif;

  --fw-regular:  400;
  --fw-medium:   500;
  --fw-semibold: 600;
  --fw-bold:     700;
  --fw-black:    900;

  --fs-xs:   10px;
  --fs-sm:   12px;
  --fs-base: 14px;
  --fs-md:   16px;
  --fs-lg:   20px;
  --fs-xl:   24px;
  --fs-2xl:  32px;

  --lh-7:    7px;
  --lh-8:    8px;
  --lh-9:    9px;
  --lh-10:   10px;
  --lh-11:   11px;
  --lh-12:   12px;
  --lh-13:   13px;
  --lh-14:   14px;
  --lh-15:   15px;
  --lh-16:   16px;
  --lh-17:   17px;
  --lh-18:   18px;
  --lh-19:   19px;
  --lh-23:   23px;

  /* --- Spacing scale --- */
  --sp-2:  2px;
  --sp-4:  4px;
  --sp-5:  5px;
  --sp-6:  6px;
  --sp-8:  8px;
  --sp-10: 10px;
  --sp-12: 12px;
  --sp-14: 14px;
  --sp-16: 16px;
  --sp-24: 24px;
  --sp-32: 32px;
  --sp-48: 48px;

  /* --- Border Radii --- */
  --radius-xs:    6px;
  --radius-sm:    12px;
  --radius-md:    16px;
  --radius-lg:    18px;
  --radius-xl:    24px;
  --radius-2xl:   28px;
  --radius-3xl:   32px;
  --radius-pill:  100px;

  /* --- Shadows --- */
  --shadow-bottom-bar:  0px -4px 24px 0px rgba(0, 0, 0, 0.12);
  --shadow-card:        0px 4px 16px 0px rgba(0, 0, 0, 0.08);
  --shadow-toggle:      4px 0px 16px 0px rgba(0, 0, 0, 0.08);

  /* --- Strokes --- */
  --border-chip:         1px dashed var(--color-gray-border);
  --border-chip-active:  1px solid #777777;
  --border-field:        1px solid var(--color-gray-light);
  --border-divider:      1px dashed var(--color-black);

  /* --- Layout --- */
  --max-width-mobile:  440px;
  --max-width-desktop: 1000px;
  --panel-left-width:  540px;
  --panel-right-width: 420px;
}


/* === css/base/typography.css === */
body {
  font-family: var(--font-primary);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh);
  color: var(--color-black);
}

.text-xs   { font-size: var(--fs-xs); }
.text-sm   { font-size: var(--fs-sm); }
.text-base { font-size: var(--fs-base); }
.text-md   { font-size: var(--fs-md); }
.text-lg   { font-size: var(--fs-lg); }
.text-xl   { font-size: var(--fs-xl); }

.font-regular  { font-weight: var(--fw-regular); }
.font-medium   { font-weight: var(--fw-medium); }
.font-semibold { font-weight: var(--fw-semibold); }
.font-bold     { font-weight: var(--fw-bold); }
.font-black    { font-weight: var(--fw-black); }

.text-primary { color: var(--color-primary); }
.text-muted   { color: var(--color-gray-border); }
.text-link    { color: var(--color-link); }
.text-green   { color: var(--color-green); }
.text-gold    { color: var(--color-gold); }
.text-white   { color: var(--color-white); }

.text-center  { text-align: center; }
.text-right   { text-align: right; }

.font-logo {
  font-family: var(--font-logo);
}

.font-badge {
  font-family: var(--font-badge);
}

.section-title {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  padding: var(--sp-16);
}


/* === css/base/utilities.css === */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden {
  display: none !important;
}

.flex       { display: flex; }
.flex-col   { flex-direction: column; }
.flex-wrap  { flex-wrap: wrap; }
.items-center    { align-items: center; }
.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }

.gap-2  { gap: var(--sp-2); }
.gap-4  { gap: var(--sp-4); }
.gap-6  { gap: var(--sp-6); }
.gap-8  { gap: var(--sp-8); }
.gap-10 { gap: var(--sp-10); }
.gap-12 { gap: var(--sp-12); }
.gap-16 { gap: var(--sp-16); }
.gap-24 { gap: var(--sp-24); }

.p-4  { padding: var(--sp-4); }
.p-8  { padding: var(--sp-8); }
.p-12 { padding: var(--sp-12); }
.p-16 { padding: var(--sp-16); }
.px-16 { padding-left: var(--sp-16); padding-right: var(--sp-16); }
.py-8  { padding-top: var(--sp-8); padding-bottom: var(--sp-8); }
.py-16 { padding-top: var(--sp-16); padding-bottom: var(--sp-16); }

.m-auto { margin: auto; }
.mt-8   { margin-top: var(--sp-8); }
.mt-16  { margin-top: var(--sp-16); }
.mt-24  { margin-top: var(--sp-24); }
.mb-8   { margin-bottom: var(--sp-8); }
.mb-16  { margin-bottom: var(--sp-16); }

.w-full { width: 100%; }

.rounded-sm  { border-radius: var(--radius-sm); }
.rounded-md  { border-radius: var(--radius-md); }
.rounded-lg  { border-radius: var(--radius-lg); }
.rounded-xl  { border-radius: var(--radius-xl); }
.rounded-pill { border-radius: var(--radius-pill); }

.opacity-0   { opacity: 0; }
.opacity-50  { opacity: 0.5; }
.opacity-100 { opacity: 1; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bg-white { background-color: var(--color-white); }
.bg-light { background-color: var(--color-gray-light); }
.bg-dark  { background-color: var(--color-dark); }
.bg-primary { background-color: var(--color-primary); }

.relative { position: relative; }
.absolute { position: absolute; }
.sticky   { position: sticky; }
.fixed    { position: fixed; }

.overflow-hidden { overflow: hidden; }
.overflow-auto   { overflow: auto; }

.transition {
  transition: all 0.2s ease;
}


/* === css/layouts/grid.css === */
.main {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);

  width: 100%;
  max-width: var(--max-width-desktop);
  margin: 0 auto;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-8);
}

.addon-grid {
  display: flex;
  gap: var(--sp-8);
  overflow-x: auto;
  padding: 0 var(--sp-16);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.addon-grid::-webkit-scrollbar {
  display: none;
}

.rose-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-8);
  padding: 0 var(--sp-16);
}

.section-padding {
  padding: 0 var(--sp-16);
}

@media (min-width: 769px) {

  .main--single {
    display: block;
  }

  .panel--sticky {
    position: sticky;
    top: 108px;
    align-self: flex-start;
  }

  .product-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-12);
    padding: 0;
  }

  .rose-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-12);
    padding: 0;
  }
}

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


/* === css/layouts/responsive.css === */
@media (max-width: 900px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .rose-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 769px) {
  .mobile-only {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }
}


/* === css/components/header.css === */
/* ─── Header Wrapper (sticky block — единый белый блок) ─── */
.header-wrap {
  position: sticky;
  top: 0;

  width: 100%;
  max-width: var(--max-width-desktop);
  margin: 0 auto;
  padding-top: env(safe-area-inset-top, 0px);

  background: var(--color-white);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  
  overflow: hidden;
  z-index: 100;

  box-shadow: 0px 4px 24px 0px rgba(0, 0, 0, 0);
  transition: box-shadow 0.3s ease;
}

.header-wrap--scrolled {
  box-shadow: 0px 4px 24px 0px rgba(0, 0, 0, 0.12);
}

/* ─── Main Header ─── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.header__logo {
  display: flex;
  align-items: center;
  flex-shrink: 1;
  height: 56px;
}

.header__logo-img {
  height: 18px;
  width: auto;
  display: block;
}

.header__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  position: relative;
  color: var(--color-icon);
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
}

.header__btn img {
  width: 32px;
  height: 32px;
}

.header__badge {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 20px;
  height: 20px;
  background: var(--color-primary);
  border: 2px solid var(--color-white);
  border-radius: 50%;
  font-size: var(--fs-sm);
  font-weight: var(--fw-black);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── Separator ─── */
.header__separator {
  height: 1px;
  background: var(--color-gray-light);
  margin: 0 var(--sp-12);
}

/* ─── Tabs ─── */
.header__tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-24);
  height: 48px;
}

.header__tab {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.32;
  text-decoration: none;
  transition: opacity 0.2s;
}

.header__tab--active {
  opacity: 1;
}

.header__tab-label {
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  line-height: var(--lh-14);
  color: var(--color-black);
  pointer-events: none;
}

.header__tab-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-black);
  flex-shrink: 0;
}

.header__tab--active .header__tab-dot {
  background: var(--color-red-dot);
}

/* ─── Inner Header ─── */
.header--inner {
  position: sticky;
  top: 0;
  z-index: 100;

  width: 100%;
  max-width: var(--max-width-desktop);
  margin: 0 auto;

  background: var(--color-white);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  overflow: hidden;
  padding-top: env(safe-area-inset-top, 0px);

  box-shadow: 0px 4px 24px 0px rgba(0, 0, 0, 0);
  transition: box-shadow 0.3s ease;
}

.header--inner--scrolled {
  box-shadow: 0px 4px 24px 0px rgba(0, 0, 0, 0.12);
}

.header--inner .header__title {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-8);
}

.header__title-icon {
  flex-shrink: 0;
  display: block;
  width: 24px;
  height: 24px;
}

.header__title-text {
  margin-bottom: -3px;
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  line-height: var(--lh-15);
  color: var(--color-black);
  white-space: nowrap;
}

.header__btn--action {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.header__btn-icon {
  display: block;
}

.header__spacer {
  width: 44px;
}

/* ─── Close Header (variety detail) ─── */
.header--close {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 10;
  background: transparent;
  pointer-events: none;
}

.header--close .header__btn--close {
  pointer-events: all;
  width: 36px;
  height: 36px;
  background: var(--color-white);
  border-radius: 50%;
  box-shadow: var(--shadow-card);
}

/* ─── Desktop ─── */
@media (min-width: 769px) {
  .header__logo-img {
    height: 22px;
  }
}

/* === css/components/buttons.css === */
/* ═══ Button system ═══
   Sizes:    default (h44), --sm (h32), --lg (h60)
   Shapes:   default (radius-md 16px), --pill (radius-pill 100px)
   Colors:   --primary (red), --secondary (gray), --outline (border), --dark (black)
   Layout:   --full (width 100%)

   «Большая красная кнопка» = .btn .btn--primary .btn--lg
   Всегда: h60, border-radius 30px.
*/

/* ─── Base ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-8);
  height: 44px;
  padding: 0 var(--sp-24);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-primary);
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
  text-decoration: none;
  box-sizing: border-box;
}

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

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ─── Sizes ─── */
.btn--sm {
  height: 32px;
  padding: 0 var(--sp-16);
  font-size: var(--fs-sm);
}

.btn--lg {
  height: 60px;
  padding: 0 var(--sp-32);
  border-radius: 30px;
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  line-height: var(--lh-14);
}

/* ─── Colors ─── */
.btn--primary {
  background: var(--color-primary);
  color: var(--color-white);
}

.btn--primary:hover:not(:disabled) {
  opacity: 0.9;
}

.btn--secondary {
  background: var(--color-gray-light);
  color: var(--color-black);
}

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

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

/* ─── Shapes ─── */
.btn--pill {
  border-radius: var(--radius-pill);
}

/* ─── Layout ─── */
.btn--full {
  width: 100%;
}


/* === css/components/skeleton.css === */
/* ─── Skeleton loading (shared) ─── */
.skeleton {
  position: relative;
  overflow: hidden;
  background: #f0f0f0;
  border-radius: var(--radius-sm);
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 25%, #e0e0e0 50%, transparent 75%);
  animation: skeleton-shimmer 1.5s infinite;
  will-change: transform;
}

@keyframes skeleton-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.skeleton--img {
  width: 100%;
  aspect-ratio: 1 / 1;
}

.skeleton--title {
  height: 20px;
  width: 70%;
  margin-bottom: var(--sp-8);
}

.skeleton--text {
  height: 14px;
  width: 100%;
  margin-bottom: var(--sp-6);
}

.skeleton--text-short {
  height: 14px;
  width: 50%;
  margin-bottom: var(--sp-6);
}

.skeleton--tag {
  height: 28px;
  width: 64px;
  border-radius: var(--radius-pill);
  display: inline-block;
}

.skeleton--tier {
  height: 16px;
  width: 100%;
  margin-bottom: var(--sp-8);
}

.skeleton--block {
  height: 120px;
  width: 100%;
  border-radius: var(--radius-md);
  margin-bottom: var(--sp-16);
}

.skeleton--btn {
  height: 56px;
  width: 56px;
  border-radius: 50%;
}


/* === css/components/bottom-sheet.css === */
/* ─── Bottom Sheet ─── */
.bsheet {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  visibility: hidden;
}

.bsheet--open {
  pointer-events: auto;
  visibility: visible;
}

/* Overlay */
.bsheet__overlay {
  position: absolute;
  inset: 0;
  background: var(--color-overlay);
  opacity: 0;
}

.bsheet--open .bsheet__overlay {
  opacity: 1;
}

.bsheet--animating .bsheet__overlay {
  transition: opacity 0.35s ease;
}

/* ─── Panel ─── */
.bsheet__panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  background: var(--color-white);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  transform: translateY(100%);
  will-change: transform;
  overflow: hidden;
}

.bsheet--animating .bsheet__panel {
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1),
              top 0.35s cubic-bezier(0.32, 0.72, 0, 1),
              border-radius 0.25s ease;
}

/* ─── Fit mode ─── */
.bsheet--fit .bsheet__panel {
  top: auto !important;
  max-height: 86vh;
  max-height: 86dvh;
}

.bsheet--fit .bsheet__body {
  overflow-y: auto;
}

/* ─── Header ─── */
.bsheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0;
  flex-shrink: 0;
  background: var(--color-white);
  z-index: 5;
}

.bsheet__header-spacer {
  width: 48px;
  flex-shrink: 0;
}

.bsheet__title {
  flex: 1;
  margin-bottom: -3px;
  text-align: center;
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  line-height: var(--lh-15);
  color: var(--color-black);
}

.bsheet__close {
  width: 48px;
  height: 56px;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.bsheet__close img {
  pointer-events: none;
}

/* ─── Body ─── */
.bsheet__body {
  flex: 1;
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

/* ─── Footer ─── */
.bsheet__footer {
  flex-shrink: 0;
  padding: var(--sp-12) var(--sp-16);
  padding-bottom: calc(var(--sp-12) + env(safe-area-inset-bottom, 0px));
  background: var(--color-white);
}

.bsheet__footer--popup {
  border-top: none;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: var(--shadow-bottom-bar);
}

/* Body scroll lock */
body.sheet-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* ─── Mobile: expand to full screen ─── */
@media (max-width: 768px) {
  .bsheet--expanded .bsheet__panel {
    border-radius: 0;
  }

  .bsheet--expanded .bsheet__header {
    position: sticky;
    top: 0;
  }

  .bsheet--expanded .bsheet__body {
    overflow-y: auto;
  }
}

/* ─── Desktop: auto-fit with scroll ─── */
@media (min-width: 769px) {
  .bsheet__panel {
    max-width: 540px;
    margin: 0 auto;
    left: 0;
    right: 0;
    max-height: 86vh;
    max-height: 86dvh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  }

  .bsheet__header {
    position: sticky;
    top: 0;
  }

  .bsheet__body {
    overflow-y: auto;
  }
}


/* === css/components/toast.css === */
.toast-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-8);
  padding: var(--sp-12);
  pointer-events: none;
}

.toast {
  max-width: 440px;
  width: 100%;
  padding: var(--sp-14) var(--sp-16);
  border-radius: var(--radius-md);
  font-family: var(--font-primary);
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
  line-height: 1.4;
  color: var(--color-white);
  text-align: center;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.16);
}

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

.toast--info {
  background: var(--color-dark);
}

.toast--success {
  background: var(--color-dark);
}

.toast--error {
  background: var(--color-primary);
}

@media (max-width: 480px) {
  .toast {
    max-width: none;
  }
}
