/* ============================================================
   DON KEBAB — Main Page Styles
   ============================================================
   Компоненты, используемые только на главной странице (index.html).
   Порядок:
   1. Component: promo-card
   2. Component: category-nav
   3. Component: section-badge / menu-section
   4. Component: product-card (unified + featured)
   5. Mobile nav (header__nav--mobile)
   6. Media Queries
   ============================================================ */


/* ==========================================================
   1. Component: promo-card
   ========================================================== */
.promo-section {
  padding: 0 0 0 var(--space-sm);
}

.promo-scroll {
  display: flex;
  gap: var(--space-sm);
  padding: 0 var(--space-sm);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.promo-scroll::-webkit-scrollbar {
  display: none;
}

.promo-card {
  flex: 0 0 75%;
  min-width: 280px;
  max-width: 320px;
  aspect-ratio: 280 / 199;
  border-radius: var(--radius-2xl);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  overflow: hidden;
  scroll-snap-align: start;
  cursor: pointer;
  transition: transform var(--transition-base);
}

.promo-card--yellow {
  background: linear-gradient(180deg, rgba(255, 190, 0, 0.5) 0%, #FFBE00 100%);
}

.promo-card--red {
  background: linear-gradient(180deg, rgba(225, 60, 38, 0.7) 0%, #E13C26 100%);
}

.promo-card__title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-white);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.promo-card__subtitle {
  font-size: var(--font-size-sm);
  color: rgba(255, 255, 255, 0.85);
  margin-top: var(--space-xs);
}

.promo-card__image {
  position: absolute;
  top: 50%;
  right: -10%;
  transform: translateY(-50%);
  width: 60%;
  opacity: 0.9;
}


/* ==========================================================
   2. Component: category-nav
   ========================================================== */
.category-nav {
  padding: var(--space-md) 0;
}

.category-nav__list {
  display: flex;
  gap: var(--space-sm);
  padding: 0 var(--space-sm);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.category-nav__list::-webkit-scrollbar {
  display: none;
}

.category-nav__item {
  flex: 0 0 auto;
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-pill);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
  background: var(--color-gray-200);
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.category-nav__item:hover {
  background: var(--color-gray-300);
  color: var(--color-text);
}

.category-nav__item.is-active {
  background: var(--color-primary);
  color: var(--color-white);
}


/* ==========================================================
   3. Component: section-badge / menu-section
   ========================================================== */
.menu-section {
  padding: var(--space-sm) 0;
  scroll-margin-top: calc(var(--home-sections-offset, 0px) + var(--space-sm));
}

.section-badge {
  display: inline-flex;
  align-items: center;  
  margin: var(--space-md) 0 0 var(--space-md);  
  color: var(--color-gray-800);
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);  
}

/* Hide badge on mobile for stacked (is_stacked) groups */
.section-badge--hide-mobile {
  display: none;
}


/* ==========================================================
   4. Component: product-card (unified)
   ========================================================== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
  padding: 0 var(--space-sm) var(--space-md);
}



/* Stacked variant: single-column on mobile, horizontal cards */
.products-grid--stacked {
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

.product-card {
  display: flex;
  flex-direction: column;
  background: var(--color-bg-card);
  overflow: hidden;
  cursor: pointer;
  height: 100%;
  padding: 0;
  position: relative;
}

/* ---------- Badge: кол-во добавленных штук ---------- */
.product-card__reset {
  position: absolute;
  top: var(--space-md);
  left: var(--space-md);
  z-index: 4;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.product-card__reset img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.product-card__badge {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  z-index: 3;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--color-primary, #E13C26);
  color: var(--color-white, #fff);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;  
}

.product-card__image {
  width: 100%;
  aspect-ratio: auto;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.product-card__image img {
  width: 100%;
  height: auto;
  max-width: none;
  object-fit: contain;
  transition: transform var(--transition-slow);
}

.product-card__image--placeholder {
  background: var(--color-gray-200);
  color: var(--color-gray-500);
  font-size: 2rem;
}

.product-card__body {
  /* padding: var(--space-sm) var(--space-sm2) 0; */
  padding: var(--space-sm) var(--space-md) 0 var(--space-md);
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-card__name {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  line-height: var(--line-height-tight);
  margin-bottom: var(--space-sm3);
  text-transform: lowercase;
}
.product-card__name::first-letter {
  text-transform: uppercase;
}

.product-card__desc {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-regular);
  color: var(--color-text-secondary);
  line-height: var(--line-height-tight);
  margin-bottom: var(--space-sm2);
}

.product-card__weights {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
  white-space: nowrap;
}

.product-card__weights span + span {
  color: var(--color-text-hint);
}

.product-card__footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: auto;
  gap: var(--space-sm);
}

.product-card__price {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  white-space: nowrap;
}

/* ---------- Stacked: horizontal cards on mobile ---------- */
.products-grid--stacked .product-card:not(.product-card--featured) {
  flex-direction: row;
  align-items: flex-start;
  gap: var(--space-sm);
}

.products-grid--stacked .product-card:not(.product-card--featured) .product-card__image {
  flex: 0 0 40%;
  max-width: 260px;
  border-radius: var(--radius-md);
  aspect-ratio: auto;
}

.products-grid--stacked .product-card:not(.product-card--featured) .product-card__body {
  padding: var(--space-xs) var(--space-md) 0 var(--space-xs);
}

.products-grid--stacked .product-card:not(.product-card--featured) .product-card__name {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-xs);
}

/* ==========================================================
   4b. Modifier: product-card--featured (hero card)
   ========================================================== */
.product-card--featured {
  grid-column: 1 / -1;
  position: relative;
  background: linear-gradient(180deg, #e76554 0%, #e1422c 100%);
  border-radius: var(--radius-xl);
  min-height: 320px;
  box-shadow: var(--shadow-md);
  flex-direction: column;
  justify-content: flex-end;
}

.product-card--featured .product-card__image {
  position: relative;  
  aspect-ratio: auto;
}

.product-card--featured .product-card__image img {
  object-fit: contain;
}

.product-card--featured .product-card__body {
  position: relative;
  z-index: 2;
  margin-top: auto;
  padding: 0 var(--space-md) var(--space-sm3);
}

.product-card--featured .product-card__name {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-white);
  margin-bottom: var(--space-xs);
}

.product-card--featured .product-card__desc {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: var(--space-xs);
}

.product-card--featured .product-card__weights span {
  color: rgba(255, 255, 255, 0.5);
}

.product-card--featured .product-card__weights span:first-child {
  color: var(--color-white);
  font-weight: var(--font-weight-semibold);
}

.product-card--featured .product-card__price {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: var(--color-white);
}


/* ==========================================================
   5. Mobile nav (header__nav--mobile, under promo-section)
   ========================================================== */
.header__nav--mobile {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-md) var(--space-sm);
  position: sticky;
  top: var(--home-mobile-sticky-top, 0px);
  z-index: calc(var(--z-header) - 1);
  background: var(--color-white);  
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.header__nav--mobile::-webkit-scrollbar {
  display: none;
}

.header__nav--mobile .header__nav-link {
  flex: 0 0 auto;
  padding: var(--space-xs2) var(--space-sm3);
  border-radius: var(--radius-pill);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
  background: transparent;  
  white-space: nowrap;
  transition: all var(--transition-fast);
  text-decoration: none;  
}

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

.header__nav--mobile .header__nav-link.is-active {
  background: var(--color-gray-200);
  color: var(--color-text);  
}


/* ==========================================================
   6. Media Queries
   ========================================================== */

/* Tablet: ≥ 569px */
@media screen and (min-width: 569px) {
  .promo-section {
    padding: 0;
  }

  .promo-card {
    flex: 0 0 45%;
    max-width: 380px;
  }

  /* Tablet uses the same card layout as desktop, but fewer columns */
  .products-grid,
  .products-grid--stacked {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-md);
    padding: var(--space-md) 0;
  }

  .product-card__image,
  .products-grid--stacked .product-card:not(.product-card--featured) .product-card__image,
  .product-card--featured .product-card__image {
    width: 100%;
    height: auto;
    aspect-ratio: auto;
  }

  .products-grid--stacked .product-card:not(.product-card--featured) {
    flex-direction: column;
    gap: 0;
    padding-bottom: var(--space-md);
    border-radius: var(--radius-xl);
    border: 2px solid transparent;
  }

  .product-card:not(.product-card--featured) {
    padding-bottom: var(--space-md);
    border-radius: var(--radius-xl);
    border: 2px solid transparent;
  }

  .product-card:not(.product-card--featured):hover,
  .product-card--featured:hover {
    box-shadow: 0 0 6px #DADADA;
  }

  .products-grid--stacked .product-card:not(.product-card--featured) .product-card__image {
    flex: none;
    max-width: none;
  }

  .products-grid--stacked .product-card:not(.product-card--featured) .product-card__body {
    padding: var(--space-sm) var(--space-md) 0;
  }

  .product-card__name,
  .products-grid--stacked .product-card:not(.product-card--featured) .product-card__name {
    font-size: var(--font-size-2xl);
  }

  .products-grid--stacked .product-card:not(.product-card--featured) .product-card__desc {
    font-size: var(--font-size-sm);
  }

  .products-grid--stacked .product-card:not(.product-card--featured) .product-card__price {
    font-size: var(--font-size-base);
  }

  .product-card--featured {
    grid-column: auto;
    position: static;
    min-height: auto;
    padding-bottom: var(--space-md);
    border-radius: var(--radius-xl);
    box-shadow: none;
  }

  .product-card--featured .product-card__image img {
    object-fit: contain;
  }

  .product-card--featured .product-card__body {
    position: static;
    margin-top: 0;
    padding: var(--space-sm) var(--space-md) 0;
  }

  .product-card--featured .product-card__name {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-medium);
    color: var(--color-white);
  }

  .product-card--featured .product-card__desc {
    color: var(--color-white);
    opacity: 1;
  }

  .product-card--featured .product-card__weights {
    color: var(--color-white);
  }

  .product-card--featured .product-card__weights span:first-child {
    color: var(--color-white);
    font-weight: var(--font-weight-medium);
  }

  .product-card--featured .product-card__price {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
    color: var(--color-white);
  }

  .section-badge--hide-mobile {
    display: inline-flex;
  }
}

/* Desktop: ≥ 1024px */
@media screen and (min-width: 1024px) {
  /* Hide mobile nav on desktop */
  .header__nav--mobile {
    display: none;
  }

  .promo-card {
    flex: 0 0 280px;
  }

  .category-nav__list {
    padding: 0 var(--space-xl);
    justify-content: center;
  }

  /* ---- Desktop grid: more columns than tablet ---- */
  .products-grid,
  .products-grid--stacked {
    grid-template-columns: repeat(4, 1fr);
  }

  .section-badge {
    margin: var(--space-2xl) 0 var(--space-xl) 0;
  }

  /* Restore badge visibility on tablet+ for stacked groups */
  .section-badge--hide-mobile {
    display: inline-flex;
  }
}


/* (product modal styles moved to product_modal.css) */
