/**
 * Beyazoğlu catalog / commerce / footer layout.
 * app.css Tailwind build lacks responsive variants (lg:, flex-row, grid-cols-12).
 * These semantic rules restore desktop composition without rebuilding the Banani CSS.
 */

/* —— Interactive affordance —— */
button,
[type="button"],
[type="submit"],
[type="reset"],
a.bg-secondary,
a.bg-primary,
a.border,
.bg-secondary,
[data-bg-add-to-cart],
[data-bg-gallery-thumb],
select,
label[for],
summary {
  cursor: pointer;
}

a[href] {
  cursor: pointer;
}

button:disabled,
[aria-disabled="true"] {
  cursor: not-allowed;
}

/* —— Product detail: gallery | buy box —— */
.bg-pdp {
  width: 100%;
}

.bg-pdp__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
}

.bg-pdp__gallery {
  width: 100%;
  max-width: 28rem;
  margin-inline: auto;
}

.bg-pdp__media {
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 28rem;
}

.bg-pdp__buy {
  width: 100%;
  min-width: 0;
}

.bg-pdp__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.bg-pdp__trust {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.bg-pdp__related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

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

@media (min-width: 1024px) {
  .bg-pdp__grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 2.5rem;
  }

  .bg-pdp__gallery {
    max-width: none;
    margin-inline: 0;
    position: sticky;
    top: 1rem;
  }

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

/* —— Product detail tabs (below buy grid) —— */
.bg-pdp-tabs {
  margin-top: 2.5rem;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 1rem;
  background: var(--color-card, #fff);
  overflow: hidden;
}

.bg-pdp-tabs__list {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  background: var(--color-surface, #f8fafc);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.bg-pdp-tabs__tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--color-muted-foreground, #6b7280);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.875rem 1.25rem;
  white-space: nowrap;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.bg-pdp-tabs__tab:hover,
.bg-pdp-tabs__tab:focus-visible {
  color: var(--color-primary, #111827);
  outline: none;
  background: rgba(17, 24, 39, 0.03);
}

.bg-pdp-tabs__tab.is-active {
  color: var(--color-secondary, #c1121f);
  border-bottom-color: var(--color-secondary, #c1121f);
  background: var(--color-card, #fff);
}

.bg-pdp-tabs__panel {
  padding: 1.25rem 1.5rem 1.5rem;
}

.bg-pdp-tabs__panel[hidden] {
  display: none !important;
}

.bg-pdp-tabs__prose > *:first-child {
  margin-top: 0;
}

.bg-pdp-tabs__prose > *:last-child {
  margin-bottom: 0;
}

.bg-pdp-specs {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.bg-pdp-specs__row {
  display: grid;
  grid-template-columns: minmax(7rem, 12rem) minmax(0, 1fr);
  gap: 0.75rem 1.25rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  font-size: 0.875rem;
}

.bg-pdp-specs__row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.bg-pdp-specs__row:first-child {
  padding-top: 0;
}

.bg-pdp-specs__row dt {
  margin: 0;
  color: var(--color-muted-foreground, #6b7280);
  font-weight: 600;
}

.bg-pdp-specs__row dd {
  margin: 0;
  color: var(--color-primary, #111827);
  font-weight: 500;
}

.bg-pdp-fitment {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.bg-pdp-fitment li {
  position: relative;
  padding: 0.625rem 0.875rem 0.625rem 2rem;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 0.75rem;
  background: var(--color-surface, #f8fafc);
  font-size: 0.875rem;
  color: var(--color-primary, #111827);
}

.bg-pdp-fitment li::before {
  content: "";
  position: absolute;
  left: 0.75rem;
  top: 50%;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 999px;
  background: var(--color-secondary, #c1121f);
  transform: translateY(-50%);
}

.bg-pdp-docs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.bg-pdp-docs__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 0.75rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.bg-pdp-docs__link:hover,
.bg-pdp-docs__link:focus-visible {
  border-color: var(--color-secondary, #c1121f);
  background: rgba(193, 18, 31, 0.03);
  outline: none;
}

.bg-pdp-docs__title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-primary, #111827);
}

.bg-pdp-docs__meta {
  font-size: 0.75rem;
  color: var(--color-muted-foreground, #6b7280);
  flex-shrink: 0;
}

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

/* —— Category: sidebar + product panel —— */
.bg-catalog-layout {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.5rem;
  width: 100%;
}

.bg-catalog-sidebar {
  width: 100%;
  flex-shrink: 0;
}

.bg-catalog-main {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
}

.bg-product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  width: 100%;
}

@media (min-width: 1024px) {
  .bg-catalog-layout {
    flex-direction: row;
    align-items: flex-start;
    gap: 2rem;
  }

  .bg-catalog-sidebar {
    width: 16rem;
  }

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

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

/* Product cards fill grid cells evenly */
.bg-product-grid > [data-bg-product-card] {
  min-width: 0;
  height: 100%;
}

/* —— Markalar index harf grid'i (app.css'te responsive varyant yok) —— */
.bg-brand-index-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  width: 100%;
}

@media (min-width: 640px) {
  .bg-brand-index-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

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

/* —— WhatsApp sipariş modalı (şase no) —— */
.bg-wa-order-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.bg-wa-order-modal[hidden] {
  display: none;
}

.bg-wa-order-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

.bg-wa-order-modal__card {
  position: relative;
  width: 100%;
  max-width: 26rem;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
  animation: bg-wa-order-modal-in 180ms ease-out;
}

@keyframes bg-wa-order-modal-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .bg-wa-order-modal__card {
    animation: none;
  }
}

.bg-wa-order-modal__x {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--color-muted-foreground, #6b7280);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.bg-wa-order-modal__x:hover,
.bg-wa-order-modal__x:focus-visible {
  color: var(--color-primary, #111827);
}

/* JS aktifken sepet adet formunun manuel Güncelle düğmesi gizlenir */
.bg-js [data-bg-cart-qty-submit] {
  display: none;
}

/* Otomatik güncelleme sırasında satır soluklaşır */
.bg-cart-line[aria-busy="true"] {
  opacity: 0.5;
  pointer-events: none;
}

/* —— Cart line denser composition —— */
.bg-cart-line {
  align-items: center;
}

.bg-cart-line__media {
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 0.75rem;
  overflow: hidden;
}

@media (min-width: 640px) {
  .bg-cart-line__media {
    width: 6.5rem;
    height: 6.5rem;
  }
}

/* —— Footer: filled multi-column —— */
.bg-footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.bg-footer-brand {
  max-width: 22rem;
}

.bg-footer-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem 2rem;
}

.bg-footer-col__title {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  opacity: 0.95;
}

.bg-footer-col__links {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.bg-footer-col__links a {
  font-size: 0.875rem;
  opacity: 0.6;
  text-decoration: none;
  color: inherit;
}

.bg-footer-col__links a:hover,
.bg-footer-col__links a:focus-visible {
  opacity: 1;
}

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

@media (min-width: 1024px) {
  .bg-footer-grid {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 2.6fr);
    gap: 3rem;
    align-items: start;
  }

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

/* —— Local cart toast (commerce kapalıyken cart.js) —— */
.bg-cart-toast-root {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: min(22rem, calc(100vw - 2rem));
  pointer-events: none;
}

.bg-cart-toast {
  pointer-events: auto;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.875rem 1rem;
  border-radius: 0.875rem;
  background: #0f172a;
  color: #f8fafc;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.35);
  opacity: 0;
  transform: translateY(0.75rem);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

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

.bg-cart-toast-icon {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bg-cart-toast-body {
  flex: 1 1 auto;
  min-width: 0;
}

.bg-cart-toast-title {
  font-size: 0.875rem;
  font-weight: 700;
}

.bg-cart-toast-product {
  font-size: 0.75rem;
  opacity: 0.8;
  margin-top: 0.125rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bg-cart-toast-meta {
  font-size: 0.6875rem;
  opacity: 0.55;
  margin-top: 0.25rem;
}

.bg-cart-toast-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex-shrink: 0;
}

.bg-cart-toast-btn {
  border: 0;
  border-radius: 0.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
  white-space: nowrap;
}

.bg-cart-toast-btn-primary {
  background: var(--color-secondary, #c1121f);
  color: #fff;
}

.bg-cart-toast-btn-ghost {
  background: transparent;
  color: rgba(248, 250, 252, 0.75);
}

.bg-cart-added-flash {
  transform: scale(0.98);
  filter: brightness(1.08);
}

/* —— Brand page model picker (scoped; do not unscope flex) —— */
.bg-brand-model-picker {
  margin-top: 1.25rem;
}

.bg-brand-model-picker__label {
  margin: 0 0 0.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-muted-foreground, #64748b);
}

.bg-brand-model-picker__scroller {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.125rem 0 0.375rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  overscroll-behavior-x: contain;
}

.bg-brand-model-picker__scroller::-webkit-scrollbar {
  display: none;
}

.bg-brand-model-picker__chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 1rem;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 999px;
  background: var(--color-card, #fff);
  color: var(--color-primary, #0f172a);
  font-family: var(--font-headings, inherit);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.bg-brand-model-picker__chip:hover {
  border-color: var(--color-secondary, #c1121f);
  color: var(--color-secondary, #c1121f);
  background: rgba(193, 18, 31, 0.04);
}

.bg-brand-model-picker__chip:focus-visible {
  outline: 2px solid var(--color-secondary, #c1121f);
  outline-offset: 2px;
}

.bg-brand-model-picker__chip.is-active {
  border-color: var(--color-secondary, #c1121f);
  background: var(--color-secondary, #c1121f);
  color: #fff;
}

.bg-brand-model-picker__chip.is-active:hover {
  color: #fff;
  background: var(--color-secondary, #c1121f);
  filter: brightness(1.06);
}

@media (prefers-reduced-motion: reduce) {
  .bg-brand-model-picker__chip {
    transition: none;
  }
}

/* —— Home brand logo scroll row —— */
.bg-brand-scroll-row {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.bg-brand-scroll-row::-webkit-scrollbar {
  display: none;
}

.bg-brand-scroll-row > a {
  flex: 0 0 auto;
  min-width: 7.5rem;
}

[data-bg-brand-scroll-wrap] [data-bg-brand-scroll-prev]:hover:not(:disabled),
[data-bg-brand-scroll-wrap] [data-bg-brand-scroll-next]:hover:not(:disabled),
[data-bg-brand-scroll-wrap] [data-bg-brand-scroll-prev]:focus-visible:not(:disabled),
[data-bg-brand-scroll-wrap] [data-bg-brand-scroll-next]:focus-visible:not(:disabled) {
  border-color: var(--color-secondary, #c1121f);
  color: var(--color-secondary, #c1121f);
  background: rgba(193, 18, 31, 0.03);
  outline: none;
}

[data-bg-brand-scroll-wrap] [data-bg-brand-scroll-prev]:disabled,
[data-bg-brand-scroll-wrap] [data-bg-brand-scroll-next]:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* —— Home product carousel —— */
.bg-product-carousel {
  position: relative;
  width: 100%;
}

.bg-product-carousel__track,
[data-bg-carousel-track] {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.bg-product-carousel__track::-webkit-scrollbar,
[data-bg-carousel-track]::-webkit-scrollbar {
  display: none;
}

.bg-product-carousel__slide {
  flex: 0 0 auto;
  flex-shrink: 0;
  width: min(240px, 70vw);
  scroll-snap-align: start;
}

[data-bg-product-carousel] [data-bg-carousel-prev],
[data-bg-product-carousel] [data-bg-carousel-next] {
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

[data-bg-product-carousel] [data-bg-carousel-prev]:hover:not(:disabled),
[data-bg-product-carousel] [data-bg-carousel-next]:hover:not(:disabled),
[data-bg-product-carousel] [data-bg-carousel-prev]:focus-visible:not(:disabled),
[data-bg-product-carousel] [data-bg-carousel-next]:focus-visible:not(:disabled) {
  border-color: var(--color-secondary, #c1121f);
  color: var(--color-secondary, #c1121f);
  background: rgba(193, 18, 31, 0.03);
  outline: none;
}

[data-bg-product-carousel] [data-bg-carousel-prev]:disabled,
[data-bg-product-carousel] [data-bg-carousel-next]:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

@media (prefers-reduced-motion: reduce) {
  .bg-product-carousel__track,
  [data-bg-carousel-track],
  .bg-brand-scroll-row {
    scroll-behavior: auto;
  }
}
