/**
 * Beyazlar Gıda — responsive katman
 * Masaüstü (≥1280px): mevcut tasarım korunur; kurallar yalnızca alt kırılımlarda devreye girer.
 */

/* ─── Laptop (1024px – 1279px) ─── */
@media (max-width: 1279px) {
  .bg-page-shell .bg-inner,
  .bg-page-shell .bg-section-inner {
    padding-inline: 2.5rem !important;
  }

  .bg-page-shell .px-16 {
    padding-left: 2.5rem !important;
    padding-right: 2.5rem !important;
  }

  .bg-page-shell main .grid-cols-5 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .bg-page-shell main .grid-cols-4 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .bg-page-shell main .grid-cols-6 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .bg-site-footer .grid-cols-5 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .bg-site-footer .col-span-2 {
    grid-column: span 2;
  }
}

/* ─── Tablet (768px – 1023px) ─── */
@media (max-width: 1023px) {
  .bg-page-shell .bg-inner,
  .bg-page-shell .bg-section-inner {
    padding-inline: 1.5rem !important;
  }

  .bg-page-shell .px-16 {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
  }

  .bg-page-shell main .grid-cols-5,
  .bg-page-shell main .grid-cols-4,
  .bg-page-shell main .grid-cols-3,
  .bg-page-shell main .grid-cols-6 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bg-page-shell main .grid-cols-2 {
    grid-template-columns: minmax(0, 1fr);
  }

  .bg-site-footer .grid-cols-5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bg-site-footer .col-span-2 {
    grid-column: span 2;
  }

  .bg-page-shell main section > .bg-section-inner > .flex.gap-10,
  .bg-page-shell main section > .bg-section-inner > .flex.gap-12,
  .bg-page-shell main section > .bg-section-inner > .flex.gap-14,
  .bg-page-shell main section > .bg-section-inner > .flex.gap-16,
  .bg-page-shell main .bg-section-inner > .flex.gap-10,
  .bg-page-shell main .bg-section-inner > .flex.gap-12,
  .bg-page-shell main .bg-section-inner > .flex.gap-14,
  .bg-page-shell main .flex.gap-10:not(.flex-wrap),
  .bg-page-shell main .flex.gap-12:not(.flex-wrap),
  .bg-page-shell main .flex.gap-14.items-start {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 1.5rem !important;
  }

  .bg-page-shell .bg-section-inner.flex.items-center.justify-between,
  .bg-page-shell .relative.z-10.bg-section-inner.flex.items-center.justify-between {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1.5rem;
    min-height: 0 !important;
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
  }

  .bg-page-shell main .rounded-2xl.overflow-hidden.flex,
  .bg-page-shell main .rounded-2xl.flex[style*='min-height'] {
    flex-direction: column !important;
    min-height: 0 !important;
  }

  .bg-page-shell main .w-1\/2 {
    width: 100% !important;
    min-height: 200px !important;
  }

  .bg-page-shell main .flex.gap-4:not(.flex-wrap) {
    flex-direction: column;
  }

  .bg-brand-showcase-card {
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100%;
  }

  .bg-page-shell .grid.grid-cols-2.gap-4 {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .bg-page-shell main .flex.items-end.justify-between {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 1.25rem;
  }

  .bg-hero-carousel {
    --bg-hero-height: auto;
    min-height: 0;
  }

  .bg-hero-carousel > .relative.z-10.flex,
  .bg-hero-carousel > .relative.z-10.bg-section-inner.flex {
    flex-direction: column !important;
    align-items: stretch !important;
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
  }

  .bg-hero-carousel [style*="flex: 0 0 520px"],
  .bg-hero-carousel [style*="520px"] {
    flex: 1 1 auto !important;
    width: 100% !important;
    max-width: none !important;
  }

  .bg-hero-slide-nav {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-top: 0.75rem;
    flex-direction: row !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.25rem;
  }

  .bg-hero-slide-nav .bg-hero-brand-card {
    flex: 0 0 min(280px, 85vw);
    scroll-snap-align: start;
  }

  .bg-hero-carousel .absolute.inset-0[style*="linear-gradient"] {
    background: linear-gradient(
      to bottom,
      rgba(20, 26, 16, 0.92) 0%,
      rgba(20, 26, 16, 0.75) 55%,
      rgba(20, 26, 16, 0.55) 100%
    ) !important;
  }

  .bg-page-shell .text-5xl {
    font-size: 2.35rem !important;
    line-height: 1.12 !important;
  }

  .bg-page-shell .text-4xl {
    font-size: 2rem !important;
  }

  [data-bg-product-gallery] {
    width: 100% !important;
    max-width: 100% !important;
    flex-direction: column !important;
  }

  [style*="width: 580px"],
  [style*="width: 440px"],
  [style*="width: 380px"],
  [style*="width: 280px"],
  [style*="width: 200px"] {
    width: 100% !important;
    max-width: 100% !important;
  }

  .bg-brand-detail-hero .flex.items-center.justify-between,
  .bg-page-shell main .flex.gap-14.items-center {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .bg-brands-nav-panel .flex.items-center.gap-6 {
    flex-direction: column;
    align-items: stretch;
  }

  .bg-brands-nav-panel .w-px.bg-border.self-stretch {
    display: none;
  }

  .bg-product-track > a,
  .bg-product-track > .bg-product-card {
    flex: 0 0 calc(50% - 0.625rem);
    min-width: 200px;
  }

  .bg-scroll-btn--prev {
    left: 0.25rem;
  }

  .bg-scroll-btn--next {
    right: 0.25rem;
  }

  .bg-page-shell [data-bg-faq-list] {
    width: 100%;
  }

  .bg-contact-side-panel {
    width: 100% !important;
  }

  aside.w-72,
  .bg-page-shell aside.w-72 {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Derlemede olmayan lg:/md: utility sınıfları */
  .bg-page-shell [class*='lg:flex-nowrap'],
  .bg-page-shell [class*='md:flex-nowrap'] {
    flex-wrap: wrap !important;
  }

  .bg-page-shell [class*='lg:block'].hidden {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 220px;
    margin-top: 1rem;
  }

  .bg-page-shell [class*='md:border-r'] {
    border-right: none !important;
  }

  .bg-page-shell [class*='md:py-0'] {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
  }

  .bg-page-shell [class*='md:border-b-0'] {
    border-bottom: 1px solid var(--color-border) !important;
  }
}

/* ─── Mobile (≤767px) ─── */
@media (max-width: 767px) {
  .bg-page-shell .bg-inner,
  .bg-page-shell .bg-section-inner {
    padding-inline: 1rem !important;
  }

  .bg-page-shell .px-16 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .bg-page-shell main .grid-cols-5,
  .bg-page-shell main .grid-cols-4,
  .bg-page-shell main .grid-cols-3,
  .bg-page-shell main .grid-cols-2,
  .bg-page-shell main .grid-cols-6,
  .bg-page-shell main .bg-section-inner.grid-cols-3 {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  /* Ana sayfa hero: mobilde minimum yükseklik ve okunabilir boşluk */
  .bg-hero-carousel > .relative.z-10.flex {
    padding-top: 1.75rem !important;
    padding-bottom: 1.75rem !important;
  }

  .bg-hero-carousel .flex.items-center.gap-3 {
    flex-wrap: wrap;
  }

  .bg-page-shell main > div.px-16 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .bg-site-footer .grid-cols-5,
  .bg-site-footer .col-span-2 {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-column: span 1 !important;
  }

  .bg-site-footer .border-t.flex.items-center.justify-between {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 1rem;
  }

  .bg-site-footer .border-t .flex.gap-5 {
    flex-direction: column;
    gap: 0.5rem;
  }

  .bg-page-shell .text-5xl {
    font-size: 1.85rem !important;
  }

  .bg-page-shell .text-4xl {
    font-size: 1.65rem !important;
  }

  .bg-page-shell .text-3xl {
    font-size: 1.45rem !important;
  }

  .bg-page-shell main section .flex.gap-4:not(.flex-wrap) {
    flex-direction: column;
  }

  .bg-page-shell main .flex.items-center.gap-0 {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .bg-page-shell main .flex.items-center.gap-0 > .flex-1 {
    width: 100% !important;
    border-right: none !important;
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 0 !important;
  }

  .bg-page-shell main .flex.items-center.gap-0 > .flex-1:last-child {
    border-bottom: none;
  }

  .bg-page-shell main .flex.items-center.gap-0 > .flex-1.px-8 {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .bg-product-track > a,
  .bg-product-track > .bg-product-card {
    flex: 0 0 82%;
    min-width: 0;
  }

  .bg-hero-slide-nav .bg-hero-brand-card {
    flex: 0 0 88vw;
  }

  .bg-page-shell [data-bg-faq-filters] {
    gap: 0.5rem !important;
  }

  .bg-page-shell [data-bg-faq-filters] .bg-faq-filter {
    font-size: 0.6875rem;
    padding: 0.35rem 0.65rem;
  }

  .bg-page-shell .grid.grid-cols-2.gap-3 {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .bg-product-detail-tab {
    font-size: 0.75rem;
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  .bg-page-shell main .overflow-x-auto.flex,
  .bg-page-shell main .flex.flex-nowrap {
    flex-wrap: wrap;
  }
}

/* ─── Header: mobil menü ─── */
.bg-mobile-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin: 0;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 8px);
  background: var(--color-background);
  color: var(--color-foreground);
  cursor: pointer;
  flex-shrink: 0;
}

.bg-mobile-menu-toggle:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.bg-mobile-nav-drawer {
  display: none;
  border-top: 1px solid var(--color-border);
  background: var(--color-background);
  box-shadow: 0 12px 28px rgba(20, 26, 16, 0.1);
}

.bg-mobile-nav-drawer.is-open {
  display: block;
}

.bg-mobile-nav-drawer__inner {
  padding: 1rem 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.bg-mobile-nav-drawer a,
.bg-mobile-nav-drawer button.bg-mobile-nav-brands-toggle {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.65rem 0;
  font-size: 0.9375rem;
  color: var(--color-foreground);
  text-decoration: none;
  border: none;
  background: none;
  font-family: inherit;
  cursor: pointer;
}

.bg-mobile-nav-drawer a.text-muted-foreground,
.bg-mobile-nav-drawer .text-muted-foreground {
  color: var(--color-muted-foreground);
}

.bg-mobile-nav-drawer .bg-mobile-nav-sub {
  padding-left: 0.75rem;
  border-left: 2px solid var(--color-border);
  margin: 0.25rem 0 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.bg-mobile-nav-drawer .bg-mobile-nav-sub a {
  font-size: 0.875rem;
  padding: 0.45rem 0;
}

.bg-mobile-nav-cta {
  margin-top: 0.75rem;
  text-align: center !important;
  padding: 0.75rem 1rem !important;
  border-radius: var(--radius-md, 8px);
  background: var(--color-primary) !important;
  color: var(--color-primary-foreground) !important;
  font-weight: 500;
}

@media (max-width: 1023px) {
  .bg-header-bar {
    height: auto !important;
    min-height: 56px;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .bg-header-nav-desktop,
  .bg-header-cta-desktop {
    display: none !important;
  }

  .bg-mobile-menu-toggle {
    display: inline-flex;
  }

  .bg-site-header.is-mobile-nav-open .bg-brands-nav-panel {
    display: none !important;
  }

  .bg-site-header.is-mobile-nav-open .bg-brands-nav-panel[hidden] {
    display: none !important;
  }
}

@media (min-width: 1024px) {
  .bg-mobile-nav-drawer {
    display: none !important;
  }
}

/* Laptop+: header bar yüksekliği korunur */
@media (min-width: 1024px) {
  .bg-header-bar {
    height: 64px;
  }
}

/* Masaüstü (≥1280px): grid ve padding'e dokunma */
@media (min-width: 1280px) {
  .bg-page-shell main .grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bg-page-shell main .grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .bg-page-shell main .grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .bg-page-shell main .grid-cols-6 {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .bg-page-shell main .grid-cols-5,
  .bg-site-footer .grid-cols-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .bg-site-footer .col-span-2 {
    grid-column: span 2;
  }
}
