:root {
    --bg-deep: #08090c;
    --bg-mid: #12151a;
    --card: #1c2028;
    --card-hover: #22272f;
    --text: #f4f6f8;
    --muted: #8b95a5;
    --accent: #e3b565;
    --accent-soft: rgba(227, 181, 101, 0.18);
    --line: rgba(255, 255, 255, 0.07);
    --radius: 18px;
    --radius-sm: 12px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.15), 0 12px 32px rgba(0, 0, 0, 0.35);
    --shadow-lift: 0 8px 24px rgba(0, 0, 0, 0.4);
    --font: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --safe-x: max(0px, env(safe-area-inset-left, 0px));
    --safe-r: max(0px, env(safe-area-inset-right, 0px));
    --safe-t: max(0px, env(safe-area-inset-top, 0px));
    --safe-b: max(0px, env(safe-area-inset-bottom, 0px));
    --touch-min: 44px;
    color-scheme: dark;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: max(9rem, calc(var(--safe-t) + 7.5rem));
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body.menu-page {
    margin: 0;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
    font-family: var(--font);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
    touch-action: pan-y pinch-zoom;
    -webkit-tap-highlight-color: rgba(227, 181, 101, 0.12);
    background-color: var(--bg-deep);
    background-image:
        radial-gradient(ellipse 120% 80% at 50% -20%, rgba(227, 181, 101, 0.12), transparent 55%),
        radial-gradient(ellipse 60% 40% at 100% 50%, rgba(80, 120, 180, 0.06), transparent 50%),
        linear-gradient(180deg, var(--bg-mid) 0%, var(--bg-deep) 45%);
}

.menu-header {
    position: sticky;
    top: 0;
    z-index: 10;
    padding: max(0.75rem, var(--safe-t)) max(1.1rem, var(--safe-r)) 0.65rem max(1.1rem, var(--safe-x));
    background: linear-gradient(
        180deg,
        rgba(8, 9, 12, 0.94) 0%,
        rgba(8, 9, 12, 0.82) 70%,
        rgba(8, 9, 12, 0.65) 100%
    );
    backdrop-filter: blur(14px) saturate(1.2);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
    border-bottom: 1px solid var(--line);
}

.menu-eyebrow {
    margin: 0 0 0.2rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.menu-title {
    margin: 0;
    font-size: clamp(1.35rem, 4.5vw, 1.6rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    background: linear-gradient(135deg, #fff 0%, #e8ecf2 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.menu-search-wrap {
    margin-top: 0.85rem;
}

.menu-search {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-height: var(--touch-min);
    padding: 0.35rem 0.9rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.05);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    touch-action: manipulation;
}

.menu-search:focus-within {
    border-color: rgba(227, 181, 101, 0.45);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.menu-search-icon {
    flex-shrink: 0;
    color: var(--muted);
    opacity: 0.85;
    width: 22px;
    height: 22px;
}

.menu-search input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    color: var(--text);
    font: inherit;
    /* iOS Safari: 16px altında odakta sayfa zoom yapar */
    font-size: max(16px, 0.9375rem);
    font-weight: 500;
    padding: 0.4rem 0;
    line-height: 1.35;
    outline: none;
    border-radius: 0;
    -webkit-appearance: none;
    appearance: none;
}

.menu-search input::placeholder {
    color: var(--muted);
    opacity: 0.85;
}

.menu-search input[type="search"]::-webkit-search-cancel-button {
    filter: invert(0.7);
}

.category-bar {
    display: flex;
    gap: 0.45rem;
    margin-top: 0.85rem;
    margin-left: -0.2rem;
    margin-right: calc(-1 * max(1.1rem, var(--safe-r)));
    padding: 0.15rem max(0.25rem, var(--safe-r)) 0.35rem 0.2rem;
    padding-bottom: max(0.35rem, calc(var(--safe-b) * 0.2));
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-soft) transparent;
    mask-image: linear-gradient(90deg, #000 86%, transparent 100%);
    overscroll-behavior-x: contain;
    scroll-padding-inline: 0.5rem;
}

.category-bar::-webkit-scrollbar {
    height: 3px;
}

.category-bar::-webkit-scrollbar-thumb {
    background: var(--accent-soft);
    border-radius: 3px;
}

.category-chip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    appearance: none;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    min-height: var(--touch-min);
    padding: 0.45rem 1.05rem;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.12s ease;
}

.category-chip:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
}

.category-chip.is-active {
    background: linear-gradient(135deg, #e8c078 0%, var(--accent) 100%);
    border-color: transparent;
    color: #1a1308;
    box-shadow: 0 2px 12px rgba(227, 181, 101, 0.25);
}

.category-chip:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.category-chip:active {
    transform: scale(0.97);
}

.menu-list {
    padding: 1rem max(1rem, var(--safe-x)) max(5.5rem, calc(var(--safe-b) + 4rem)) max(1rem, var(--safe-r));
    max-width: 520px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.menu-no-results {
    text-align: center;
    color: var(--muted);
    font-size: max(0.9375rem, 16px);
    padding: 2rem 1rem;
    margin: 0;
    line-height: 1.5;
}

.menu-section {
    scroll-margin-top: max(6.5rem, calc(var(--safe-t) + 5.25rem));
    margin-bottom: 1.5rem;
}

.menu-section:last-child {
    margin-bottom: 0;
}

.menu-section-title {
    margin: 0 0 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--line);
}

.menu-section-cards {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.menu-empty {
    text-align: center;
    color: var(--muted);
    margin-top: 3rem;
    font-size: 0.95rem;
}

.product-card {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
    transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

.product-card--unavailable {
    opacity: 0.92;
}

.product-card--unavailable .product-media img,
.product-card--unavailable .product-placeholder {
    filter: grayscale(0.35) brightness(0.88);
}

.product-status-badge {
    position: absolute;
    top: 0.65rem;
    left: 0.65rem;
    z-index: 3;
    padding: 0.35rem 0.65rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #1a1308;
    background: linear-gradient(135deg, #e8c078 0%, var(--accent) 100%);
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    max-width: calc(100% - 1.3rem);
    line-height: 1.2;
}

.product-card--unavailable[data-sale-status="unavailable"] .product-status-badge {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: #f3f4f6;
}

@media (hover: hover) {
    .product-card:hover {
        border-color: rgba(255, 255, 255, 0.1);
        box-shadow: var(--shadow-lift);
        transform: translateY(-2px);
    }
}

.product-media {
    position: relative;
    overflow: hidden;
}

.product-media::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(180deg, transparent 55%, rgba(8, 9, 12, 0.35) 100%);
}

.product-media img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: #0d0f12;
    transition: transform 0.45s ease;
}

@media (hover: hover) {
    .product-card:hover .product-media img {
        transform: scale(1.04);
    }
}

.product-placeholder {
    width: 100%;
    aspect-ratio: 4 / 3;
    background:
        radial-gradient(circle at 30% 40%, rgba(227, 181, 101, 0.08) 0%, transparent 45%),
        radial-gradient(circle at 70% 60%, rgba(120, 140, 180, 0.06) 0%, transparent 40%),
        linear-gradient(145deg, #252b34 0%, #181c22 100%);
    position: relative;
}

.product-placeholder::before {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 48px;
    height: 48px;
    opacity: 0.2;
    background: no-repeat center / contain;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e3b565' stroke-width='1.5'%3E%3Cpath d='M4 16l4.5-8 3 5 3-9 5.5 12'/%3E%3Ccircle cx='9' cy='19' r='1'/%3E%3Ccircle cx='15' cy='19' r='1'/%3E%3C/svg%3E");
}

.product-body {
    padding: 1.05rem 1.2rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.product-name {
    margin: 0;
    font-size: clamp(1.0625rem, 3.8vw, 1.125rem);
    font-weight: 650;
    letter-spacing: -0.02em;
    line-height: 1.28;
    text-wrap: balance;
}

.product-desc {
    margin: 0;
    font-size: max(0.9375rem, 15px);
    color: var(--muted);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: 0.35rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--line);
}

.product-price {
    margin: 0;
    font-size: clamp(1.05rem, 3.5vw, 1.125rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--accent);
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
}

.product-price--muted {
    color: var(--muted);
    background: rgba(255, 255, 255, 0.05);
    text-decoration: line-through;
    text-decoration-color: rgba(255, 255, 255, 0.35);
}

.back-top {
    position: fixed;
    right: max(1rem, calc(var(--safe-r) + 0.35rem));
    bottom: max(1rem, calc(var(--safe-b) + 0.5rem));
    z-index: 20;
    width: max(3rem, var(--touch-min));
    height: max(3rem, var(--touch-min));
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: rgba(28, 32, 40, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--accent);
    cursor: pointer;
    box-shadow: var(--shadow);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.12s ease, background 0.15s ease, color 0.15s ease;
}

.back-top:hover {
    background: var(--accent-soft);
    color: var(--text);
}

.back-top:active {
    transform: scale(0.94);
}

.back-top:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

@media (max-width: 360px) {
    .menu-section-title {
        font-size: 0.7rem;
    }

    .menu-section-cards {
        gap: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .category-chip,
    .product-card,
    .product-media img {
        transition: none !important;
    }

    .product-card:hover {
        transform: none !important;
    }

    .product-card:hover .product-media img {
        transform: none !important;
    }
}
