/*
 * mobile.css (2026-12-06) — phone density, Trendyol / Hepsiburada reference.
 * Only inside @media (max-width: 767px): desktop and tablet are untouched.
 * Same colours, components and markup; only scale, insets and spacing change.
 * Loaded last in layouts/app.blade.php so it wins over layout/responsive/storefront.
 *
 * Reference (TY/HB mobile web): side inset 8–12px, body 13–14px, card title 12–13px
 * (2 lines), price 15–16px bold, section titles 15–17px, H1 16–18px, 2-column grid with
 * 8px gaps, low hero, intros clamped to 1–2 lines. Text never below 12px, hits ≥ 40px.
 */
@media (max-width: 767px) {
  /* —— 1) Scale ————————————————————————————————————————————————— */
  /* html is 125% for desktop (rem = 20px). On phones every rem-based gap, padding and
     height was 25% larger than the design intends; back to the browser default. */
  html {
    font-size: 100%;
  }

  /* Tailwind size tokens are px (they ignore the 125%): pull the ramp down. */
  :root {
    --text-xs: 12px;
    --text-sm: 13px;
    --text-base: 14px;
    --text-lg: 15px;
    --text-xl: 16px;
    --text-2xl: 18px;
    --text-3xl: 20px;
    --text-4xl: 22px;

    --bg-type-display: 20px;
    --bg-type-title: 17px;
    --bg-type-heading: 15px;
    --bg-type-lead: 14px;
    --bg-type-body: 13px;
    --bg-type-meta: 12px;
    --bg-type-label: 12px;

    --bg-m-inset: 12px;
  }

  body {
    font-size: 14px;
  }

  /* —— 2) One side inset: 12px ——————————————————————————————————— */
  main .theme-container,
  main .bg-theme-container,
  footer .bg-theme-container,
  .bg-breadcrumb-bar .bg-theme-container {
    padding-inline: var(--bg-m-inset);
  }

  /* The catalog / PDP wrappers added their own 1rem on top of the container (40px total). */
  .bg-catalog-gutter.px-8,
  .bg-pdp.px-8 {
    padding-left: 0;
    padding-right: 0;
  }

  [data-bg-header-main] {
    padding: 6px var(--bg-m-inset);
  }

  /* Vertical rhythm of listing wrappers (py-10 / py-8 / py-12). */
  main .bg-catalog-gutter.py-10,
  main .bg-catalog-gutter.py-12 {
    padding-top: 12px;
    padding-bottom: 24px;
  }

  main .bg-catalog-gutter.py-8 {
    padding-top: 14px;
    padding-bottom: 14px;
  }

  main .bg-catalog-gutter.py-3 {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  /* —— 3) Listing header: short title, 1 line count, intro 2 lines ———————— */
  .bg-catalog-toolbar {
    gap: 8px;
    margin-bottom: 12px;
  }

  .bg-catalog-toolbar__title h1,
  .bg-catalog-toolbar__title h2 {
    font-size: 17px;
    line-height: 1.3;
    letter-spacing: -0.01em;
  }

  .bg-catalog-toolbar__title [data-bg-listing-count] {
    margin-top: 2px;
    font-size: 12px;
  }

  .bg-catalog-toolbar__title p + p {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.45;
  }

  /* Sort + filter + density on one row; "3 columns" is 2 below 480px anyway. */
  .bg-catalog-toolbar__actions {
    flex-wrap: nowrap;
    gap: 6px;
  }

  .bg-catalog-toolbar__sort label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .bg-catalog-density button {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
  }

  .bg-catalog-density button[data-bg-grid-density-value="3"] {
    display: none;
  }

  .bg-catalog-density button[data-bg-grid-density-value="2"] {
    border-right: 0;
  }

  /* —— 4) Product grid: 2 columns, 8px gaps (TY/HB) ————————————————— */
  .bg-product-grid {
    --bg-listing-cols: 2;
    gap: 8px;
  }

  .bg-catalog-main[data-grid-density="1"] .bg-product-grid {
    --bg-listing-cols: 1;
  }

  /* Two columns: the square frame is ~170px, no need for the landscape crop. */
  .bg-catalog-main:not([data-grid-density]) .bg-product-grid .bg-product-media,
  .bg-catalog-main[data-grid-density="2"] .bg-product-grid .bg-product-media,
  .bg-catalog-main[data-grid-density="3"] .bg-product-grid .bg-product-media {
    aspect-ratio: 1 / 1;
    max-height: none;
  }

  .bg-product-media > img {
    padding: 8% 8% 2rem;
  }

  /* —— 5) Product card ——————————————————————————————————————————— */
  [data-bg-product-card] {
    border-radius: 10px;
  }

  [data-bg-product-card] > .p-3 {
    padding: 8px;
  }

  [data-bg-product-card] a.font-semibold.text-sm {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    font-size: 12.5px;
    line-height: 1.35;
    min-height: calc(2 * 1.35em);
  }

  [data-bg-product-card] .text-xs {
    font-size: 12px;
  }

  /* OEM and fitment lines: one line each, ellipsis. */
  [data-bg-product-card] .p-3 > .text-xs.mb-1:not(.font-bold),
  [data-bg-product-card] .p-3 > .text-xs.flex > span:last-child {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    min-width: 0;
  }

  [data-bg-product-card] .p-3 > .text-xs.mb-3 {
    margin-bottom: 8px;
  }

  [data-bg-product-card] .p-3 > .mb-3.mt-auto {
    margin-bottom: 8px;
  }

  [data-bg-product-card] .font-bold.text-base {
    font-size: 15px;
    line-height: 1.3;
  }

  [data-bg-product-card] .bg-product-media .text-xs {
    padding: 1px 6px;
  }

  [data-bg-product-card] button,
  [data-bg-product-card] [data-bg-add-to-cart] {
    min-height: 40px;
    font-size: 13px;
  }

  /* —— 6) Breadcrumb ————————————————————————————————————————————— */
  .bg-breadcrumb-bar {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  /* —— 7) Brand / model hero ———————————————————————————————————— */
  .bg-brand-hero {
    gap: 10px;
  }

  .bg-brand-hero > img {
    width: 44px;
    height: 44px;
    padding: 4px;
    border-radius: 10px;
  }

  .bg-brand-hero__text .text-xs.uppercase {
    margin-bottom: 2px;
    font-size: 12px;
    letter-spacing: 0.08em;
  }

  .bg-brand-hero__text h1 {
    font-size: 18px;
    line-height: 1.25;
  }

  .bg-brand-hero__text p {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.45;
  }

  /* —— 8) Product page ——————————————————————————————————————————— */
  .bg-pdp.py-10 {
    padding-top: 8px;
  }

  .bg-pdp__buy h1 {
    margin-bottom: 8px;
    font-size: 17px;
    line-height: 1.3;
    letter-spacing: -0.01em;
  }

  .bg-pdp__buy .font-bold.text-3xl:not(h1) {
    font-size: 22px;
  }

  .bg-pdp__buy .mb-6 {
    margin-bottom: 12px;
  }

  .bg-pdp__buy .mb-4 {
    margin-bottom: 10px;
  }

  /* —— 9) Home banner: low hero, two promo tiles side by side ———————————— */
  .bg-banner-split {
    padding-top: 8px;
  }

  .bg-banner-split__wrap {
    padding-bottom: 8px;
  }

  .bg-banner-split__grid,
  .bg-banner-split__side {
    gap: 8px;
  }

  .bg-banner-main .bg-banner-main__media {
    aspect-ratio: 2 / 1;
  }

  .bg-banner-main__copy {
    padding: 12px 14px 14px;
  }

  .bg-banner-main__eyebrow {
    margin-bottom: 6px;
    padding: 2px 8px;
    font-size: 12px;
    line-height: 16px;
  }

  .bg-banner-main__title {
    font-size: 18px;
    line-height: 24px;
  }

  .bg-banner-main__text {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    margin-top: 6px;
    font-size: 13px;
    line-height: 18px;
  }

  .bg-banner-main__cta {
    margin-top: 12px;
    height: 42px;
    font-size: 14px;
    border-radius: 10px;
  }

  .bg-banner-split__side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bg-banner-card {
    aspect-ratio: 1.45;
  }

  .bg-banner-card__copy {
    width: 70%;
    padding: 10px 0 10px 12px;
  }

  .bg-banner-card__title {
    font-size: 14px;
    line-height: 18px;
  }

  .bg-banner-card__text {
    display: none;
  }

  .bg-banner-card__cta {
    margin-top: 8px;
    height: 30px;
    padding: 0 10px;
    font-size: 12px;
    border-radius: 6px;
  }

  /* —— 10) Home sections: tighter rhythm, title + link on one row ——————— */
  main .px-8.py-12,
  main .px-8.py-14,
  main .px-8.py-10 {
    padding-top: 20px;
    padding-bottom: 20px;
  }

  main .px-8.py-8 {
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .bg-section-head,
  .bg-product-carousel__head {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 4px 12px;
    margin-bottom: 12px;
  }

  .bg-section-head > :first-child,
  .bg-product-carousel__copy {
    flex: 1 1 0;
    min-width: 0;
  }

  .bg-section-head .text-xs.uppercase,
  .bg-product-carousel__copy .text-xs.uppercase {
    margin-bottom: 2px;
    font-size: 12px;
    letter-spacing: 0.08em;
  }

  .bg-section-head > a,
  .bg-product-carousel__tools > a {
    min-height: 40px;
    align-items: center;
    font-size: 13px;
  }

  /* Swipe on phones (TY/HB); the arrows stay on tablet and desktop. */
  .bg-product-carousel__nav {
    display: none;
  }

  .bg-product-carousel__tools {
    flex: 0 0 auto;
  }

  /* Product strips: ~2.3 cards in view instead of one wide card. */
  .bg-product-carousel__track,
  [data-bg-carousel-track] {
    gap: 8px;
  }

  .bg-product-carousel .bg-product-carousel__slide,
  .bg-product-carousel--peek .bg-product-carousel__slide {
    flex: 0 0 calc((100% - 16px) / 2.3);
    width: calc((100% - 16px) / 2.3);
    min-width: calc((100% - 16px) / 2.3);
    max-width: calc((100% - 16px) / 2.3);
  }

  .bg-product-carousel__slide .bg-product-media {
    aspect-ratio: 1 / 1;
  }

  /* Category tiles: three per row. */
  .bg-cat-grid--tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .bg-cat-tile {
    border-radius: 12px;
  }

  .bg-cat-tile__media {
    aspect-ratio: 1 / 1;
  }

  .bg-cat-tile__body {
    padding: 6px 8px 8px;
    gap: 0;
  }

  .bg-cat-tile__name {
    font-size: 13px;
  }

  .bg-cat-tile__count {
    font-size: 12px;
  }

  /* Stats band: one row of four. */
  .bg-stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .bg-stats-grid .text-2xl {
    font-size: 17px;
  }

  /* Heads with an intro paragraph stay stacked (the link would squeeze the copy). */
  .bg-section-head:has(> :first-child p) {
    flex-direction: column;
    align-items: flex-start;
  }

  .bg-section-head > :first-child p {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.45;
  }

  /* Japan / Korea brand tiles: two per row, compact. */
  .bg-brand-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .bg-brand-tile {
    gap: 8px;
    padding: 8px;
    border-radius: 12px;
  }

  .bg-brand-tile__logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .bg-brand-tile__logo img {
    padding: 5px;
  }

  .bg-brand-tile__name {
    font-size: 14px;
  }

  .bg-brand-tile__models {
    font-size: 12px;
    -webkit-line-clamp: 1;
  }

  .bg-brand-tile__chevron {
    display: none;
  }

  /* Brand showcase (Toyota / Hyundai / Kia strips). */
  .bg-brand-showcase__head {
    gap: 10px;
    margin-bottom: 12px;
  }

  .bg-brand-showcase__logo {
    width: 48px;
    height: 48px;
  }

  .bg-brand-showcase__head p {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.45;
  }

  .bg-brand-showcase__models {
    margin-bottom: 12px;
  }

  .bg-brand-showcase__label {
    margin-bottom: 6px;
  }

  .bg-chip-grid {
    gap: 8px;
  }

  /* —— 11) Hit areas that shrank with the rem reset ——————————————————— */
  main button.w-7.h-7 {
    width: 36px;
    height: 36px;
  }

  footer a.w-8.h-8 {
    width: 40px;
    height: 40px;
  }

  /* Card corner badges are inline 9–11px; keep the 12px floor. */
  main .absolute.top-2.left-2.rounded,
  main .absolute.top-2.right-2.rounded {
    font-size: 12px !important;
  }

  /* PDP: actions, trust notes, tabs. */
  .bg-pdp__actions.mb-8 {
    margin-bottom: 16px;
  }

  .bg-pdp__trust {
    gap: 6px;
  }

  .bg-pdp__trust > .p-4 {
    padding: 10px 12px;
  }

  .bg-pdp__trust .text-sm.font-bold {
    margin-bottom: 0;
    font-size: 13px;
  }

  .bg-pdp-tabs__tab {
    padding: 10px 14px;
    min-height: 44px;
    font-size: 13px;
  }

  .bg-pdp-tabs__panel {
    padding: 12px 14px 14px;
  }

  .bg-pdp-tabs__prose,
  .bg-pdp-tabs__prose p,
  .bg-pdp-tabs__prose li {
    font-size: 14px;
    line-height: 1.6;
  }

  .bg-pdp .bg-product-carousel {
    margin-top: 20px;
  }

  .bg-pdp .mt-16.pt-12 {
    margin-top: 24px;
    padding-top: 20px;
  }

  .bg-pdp .mt-16.pt-12 > h2.mb-6 {
    margin-bottom: 12px;
  }

  /* Search: "Arama Sonuçları" becomes a small label over the query title. */
  .bg-catalog-gutter > .bg-theme-container > h1.mb-8 {
    margin-bottom: 2px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-muted-foreground, #64748b);
  }

  /* Category index heading strip (py-5). */
  main .bg-catalog-gutter.py-5 {
    padding-top: 12px;
    padding-bottom: 12px;
  }
}

/* Parça tarafı (Sağ/Sol · Ön/Arka) telefonda liste üstünde ayrı kutu değil: Filtre çekmecesindeki
   "Parça tarafı" bölümünden seçilir (partials/catalog/side-filter-section). Seçim yapılmışsa çubuk
   görünür kalır ki etkin süzgeç ve kaldırma yolu kaybolmasın. */
@media (max-width: 767px) {
    .bg-side-filter:not(.is-active) {
        display: none;
    }
}
