/**
 * FAZ 15B — Müşteri menüsü mobil responsive (menu-web.php, kategori.php)
 * Scope: body.sadekitap-menu-theme only
 */
body.sadekitap-menu-theme {
    --skk-touch-min: 44px;
    --skk-sticky-base: 56px;
    --skk-sticky-total: calc(var(--skk-sticky-base) + env(safe-area-inset-bottom, 0px));
}

html {
    -webkit-text-size-adjust: 100%;
}

body.sadekitap-menu-theme {
    overflow-x: hidden;
    min-height: 100dvh;
}

body.sadekitap-menu-theme .app-shell {
    width: 100%;
    max-width: var(--skk-shell-max, 480px);
    min-height: 100dvh;
    overflow-x: hidden;
}

/* ── Safe area + header ── */
body.sadekitap-menu-theme .skk-hero-actions {
    padding-top: calc(0.75rem + env(safe-area-inset-top, 0px));
    padding-left: calc(1rem + env(safe-area-inset-left, 0px));
    padding-right: calc(1rem + env(safe-area-inset-right, 0px));
    flex-wrap: wrap;
    row-gap: 0.5rem;
}

body.sadekitap-menu-theme .skk-hero-body {
    padding-left: calc(1.25rem + env(safe-area-inset-left, 0px));
    padding-right: calc(1.25rem + env(safe-area-inset-right, 0px));
}

body.sadekitap-menu-theme .skk-table-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 10px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fff;
    background: rgba(15, 140, 168, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.25);
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.sadekitap-menu-theme .skk-hero-actions-right {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: flex-end;
}

body.sadekitap-menu-theme .skk-hero-actions-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    min-width: 0;
    flex: 1 1 auto;
}

body.sadekitap-menu-theme .skk-hero-category .skk-hero-body h1 {
    font-size: clamp(1rem, 4.2vw, 1.35rem);
}

body.sadekitap-menu-theme .skk-hero-text h1,
body.sadekitap-menu-theme .skk-hero-text p {
    white-space: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

/* ── Main sheet bottom padding for sticky bar ── */
body.sadekitap-menu-theme .main-content.skk-main-sheet,
body.sadekitap-menu-theme .skk-main-sheet {
    padding-left: calc(1.25rem + env(safe-area-inset-left, 0px));
    padding-right: calc(1.25rem + env(safe-area-inset-right, 0px));
    padding-bottom: calc(6.75rem + env(safe-area-inset-bottom, 0px));
}

/* ── Sticky bar (override customer-menu.css conflicts) ── */
body.sadekitap-menu-theme .menu-sticky-bar {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    z-index: 130;
    width: min(100%, var(--skk-shell-max, 480px));
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    padding: 0.5rem calc(0.75rem + env(safe-area-inset-right, 0px)) calc(0.5rem + env(safe-area-inset-bottom, 0px)) calc(0.75rem + env(safe-area-inset-left, 0px));
    background: #f8fafc;
    border-top: 1px solid var(--skk-border-strong, #e5e7eb);
    box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.08);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

body.sadekitap-menu-theme .menu-sticky-btn {
    min-height: var(--skk-touch-min);
    padding: 0 0.75rem;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.sadekitap-menu-theme .menu-sticky-btn.menu-sticky-cart {
    box-shadow: 0 6px 16px var(--skk-brand-glow, rgba(15, 140, 168, 0.35));
}

/* ── Product cards ── */
body.sadekitap-menu-theme .product-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.875rem;
}

body.sadekitap-menu-theme .product-card {
    min-width: 0;
}

body.sadekitap-menu-theme .product-media img,
body.sadekitap-menu-theme .product-img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: cover;
    object-position: center;
}

body.sadekitap-menu-theme .product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}

body.sadekitap-menu-theme .product-price {
    flex-shrink: 0;
    font-size: 1rem;
    font-weight: 700;
}

body.sadekitap-menu-theme .btn-add {
    min-height: var(--skk-touch-min);
    min-width: var(--skk-touch-min);
    padding: 0 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

body.sadekitap-menu-theme .fav-btn {
    min-width: var(--skk-touch-min);
    min-height: var(--skk-touch-min);
}

/* ── Category grid ── */
body.sadekitap-menu-theme .category-grid {
    gap: 0.625rem;
}

body.sadekitap-menu-theme .category-card-name {
    font-size: 13px;
    line-height: 1.2;
    word-break: break-word;
}

body.sadekitap-menu-theme .category-card img {
    object-fit: cover;
    max-width: 100%;
}

/* ── Filter chips: horizontal scroll ── */
body.sadekitap-menu-theme .filter-chips {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    padding-bottom: 0.25rem;
    margin-top: 0.75rem;
}

body.sadekitap-menu-theme .filter-chips::-webkit-scrollbar {
    display: none;
}

body.sadekitap-menu-theme .filter-chip {
    flex: 0 0 auto;
    scroll-snap-align: start;
    min-height: var(--skk-touch-min);
    padding: 0 1rem;
    white-space: nowrap;
}

body.sadekitap-menu-theme .faz11b-filter-compact .filter-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.625rem;
}

body.sadekitap-menu-theme .filter-count {
    justify-self: start;
}

/* ── Modals: bottom sheet on mobile ── */
body.sadekitap-menu-theme .overlay {
    align-items: flex-end;
    justify-content: center;
    padding: 0;
}

body.sadekitap-menu-theme .overlay.open {
    display: flex;
}

body.sadekitap-menu-theme .overlay .modal {
    width: 100%;
    max-width: var(--skk-shell-max, 480px);
    max-height: min(92dvh, 720px);
    margin: 0;
    border-radius: 1.25rem 1.25rem 0 0;
    display: flex;
    flex-direction: column;
}

body.sadekitap-menu-theme .modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

body.sadekitap-menu-theme .modal-footer {
    flex-shrink: 0;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
}

body.sadekitap-menu-theme .btn-primary,
body.sadekitap-menu-theme .btn-secondary {
    min-height: var(--skk-touch-min);
}

body.sadekitap-menu-theme .btn-row {
    gap: 0.5rem;
}

body.sadekitap-menu-theme .qty-btn {
    min-width: var(--skk-touch-min);
    min-height: var(--skk-touch-min);
    width: var(--skk-touch-min);
    height: var(--skk-touch-min);
}

body.sadekitap-menu-theme .cart-item-remove {
    min-height: var(--skk-touch-min);
    padding: 0 0.5rem;
    display: inline-flex;
    align-items: center;
}

body.sadekitap-menu-theme .cart-item-name {
    display: block;
    overflow: visible;
    white-space: normal;
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
    word-break: break-word;
    overflow-wrap: anywhere;
}

body.sadekitap-menu-theme .cart-item-img {
    width: 4rem;
    height: 4rem;
    object-fit: cover;
    flex-shrink: 0;
}

body.sadekitap-menu-theme .modal-close {
    min-width: var(--skk-touch-min);
    min-height: var(--skk-touch-min);
}

body.sadekitap-menu-theme .preset-btn {
    min-height: var(--skk-touch-min);
}

/* ── Search overlay ── */
body.sadekitap-menu-theme .search-overlay {
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

body.sadekitap-menu-theme .search-input {
    min-height: var(--skk-touch-min);
    width: 100%;
}

body.sadekitap-menu-theme .search-result-name,
body.sadekitap-menu-theme .smart-item-name {
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: normal;
    overflow: visible;
    display: block;
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
}

body.sadekitap-menu-theme .search-result-img {
    object-fit: cover;
    flex-shrink: 0;
}

/* ── Popular strip ── */
body.sadekitap-menu-theme .popular-strip {
    margin-left: calc(-0.25rem - env(safe-area-inset-left, 0px));
    margin-right: calc(-0.25rem - env(safe-area-inset-right, 0px));
    padding-left: calc(0.25rem + env(safe-area-inset-left, 0px));
    padding-right: calc(0.25rem + env(safe-area-inset-right, 0px));
}

body.sadekitap-menu-theme .popular-name {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Performance: reduce blur on small screens ── */
@media (max-width: 768px) {
    body.sadekitap-menu-theme .skk-hero-btn {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: rgba(255, 255, 255, 0.22);
    }

    body.sadekitap-menu-theme .category-card:hover img {
        transform: none;
    }

    body.sadekitap-menu-theme .category-card,
    body.sadekitap-menu-theme .popular-card,
    body.sadekitap-menu-theme .product-card {
        transition: transform 0.12s ease;
    }
}

/* ── Breakpoints ── */
@media (max-width: 320px) {
    body.sadekitap-menu-theme .category-grid {
        grid-template-columns: 1fr;
    }

    body.sadekitap-menu-theme .skk-hero-btn {
        min-height: 36px;
        padding: 0 8px;
        font-size: 11px;
    }

    body.sadekitap-menu-theme .skk-hero-btn-icon {
        width: 36px;
    }

    body.sadekitap-menu-theme .product-footer .btn-add {
        width: 100%;
        justify-content: center;
    }

    body.sadekitap-menu-theme .preset-grid {
        grid-template-columns: 1fr;
    }

    body.sadekitap-menu-theme .btn-row {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 321px) and (max-width: 767px) {
    body.sadekitap-menu-theme .category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.sadekitap-menu-theme .product-footer .btn-add {
        margin-left: auto;
    }
}

@media (max-width: 390px) {
    body.sadekitap-menu-theme .product-list .product-info {
        margin-left: 0.65rem !important;
    }

    body.sadekitap-menu-theme .product-list .product-footer .btn-add {
        width: auto !important;
        justify-content: center;
    }
}

@media (min-width: 768px) {
    /* Ürün listesi tek sütun kalır — app-shell max 480px */
    body.sadekitap-menu-theme .faz11b-filter-compact .filter-row {
        grid-template-columns: 1fr auto auto;
        align-items: end;
    }

    body.sadekitap-menu-theme .overlay {
        align-items: center;
        padding: 1rem;
    }

    body.sadekitap-menu-theme .overlay .modal {
        border-radius: var(--skk-radius-2xl, 1.25rem);
        max-height: 88vh;
    }
}

@media (min-width: 481px) and (max-width: 767px) {
    body.sadekitap-menu-theme .app-shell {
        box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
    }
}

@media (max-width: 480px) {
    body.sadekitap-menu-theme .app-shell {
        max-width: 100%;
        box-shadow: none;
    }
}

/* ── FAZ 15C: Modal lock, sticky hide, iOS zoom ── */
body.sadekitap-menu-theme.menu-modal-open {
    overflow: hidden;
    touch-action: none;
    position: fixed;
    width: 100%;
    left: 0;
    right: 0;
}

body.sadekitap-menu-theme.menu-modal-open .menu-sticky-bar {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

body.sadekitap-menu-theme .overlay,
body.sadekitap-menu-theme .search-overlay {
    z-index: 9999;
}

body.sadekitap-menu-theme .overlay .modal {
    z-index: 10000;
    position: relative;
}

body.sadekitap-menu-theme .overlay .modal,
body.sadekitap-menu-theme .search-overlay {
    max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 8px);
}

body.sadekitap-menu-theme .modal-footer {
    position: sticky;
    bottom: 0;
    z-index: 2;
    background: #f8fafc;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
}

body.sadekitap-menu-theme input,
body.sadekitap-menu-theme textarea,
body.sadekitap-menu-theme select,
body.sadekitap-menu-theme .form-input,
body.sadekitap-menu-theme .form-textarea,
body.sadekitap-menu-theme .search-input,
body.sadekitap-menu-theme .filter-input,
body.sadekitap-menu-theme .filter-select {
    font-size: 16px !important;
}
