:root {
    --primary-color: #2c3e50;
    --accent-color: #27ae60;
    --accent-hover: #229954;
    --background-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #2c3e50;
    --text-muted: #7f8c8d;
    --border-radius: 20px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --gradient-overlay: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.4) 100%);
}

* {
    box-sizing: border-box;
}

/* Telefon tarzı scrollbar: ince, şeffaf, overlay */
html {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.25) transparent;
}

html::-webkit-scrollbar {
    width: 6px;
}

html::-webkit-scrollbar-track {
    background: transparent;
}

html::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 3px;
}

html::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.35);
}

body {
    font-family: var(--template-font-family, 'Inter'), -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--template-page-bg-color, #f5f7fa);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body[data-bg-type="image"] {
    background-image: var(--template-page-bg-image);
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

.mobile-container {
    max-width: 480px;
    margin: 0 auto;
    background-color: transparent;
    min-height: 100vh;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow-x: hidden;
    font-family: var(--template-font-family, 'Inter'), -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    /* Scrollbar container'da da aynı ince/şeffaf stil */
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.mobile-container::-webkit-scrollbar {
    width: 6px;
}

.mobile-container::-webkit-scrollbar-track {
    background: transparent;
}

.mobile-container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.mobile-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Header */
.restaurant-header {
    position: relative;
    height: 220px;
    background: linear-gradient(135deg, var(--template-header-bg, var(--primary-color)) 0%, #34495e 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom-left-radius: 32px;
    border-bottom-right-radius: 32px;
    overflow: hidden;
    margin-bottom: 0;
}

.restaurant-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-overlay);
    z-index: 1;
}

.restaurant-header img.cover-image {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.85;
}

.restaurant-logo-badge {
    position: relative;
    width: 118px;
    height: 118px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    overflow: hidden;
}

/* Logo görseli varken (PNG şeffaf arka plan): beyaz arka plan yok, çerçeve logoyla bir */
.restaurant-logo-badge:has(img) {
    background: transparent;
}

/* Logo kare (köşeleri yuvarlatılmış); çerçeve yok, gölge ile ön plan */
.logo-badge-square {
    border-radius: 16px;
    border: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3);
}

.star-badge {
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    -webkit-clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    border: 3px solid #d4af37;
    border-radius: 0;
}

.restaurant-logo-badge img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    vertical-align: middle;
}

.logo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 12px 8px;
    width: 100%;
    height: 100%;
}

.logo-placeholder i {
    font-size: 1.8rem;
    color: #d4af37;
    margin-bottom: 6px;
}

.logo-placeholder span {
    font-size: 0.65rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.1;
    letter-spacing: 0.5px;
}


/* Categories Grid - şablon değişkenleri .mobile-container üzerinden gelir */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(var(--template-category-columns, 2), 1fr);
    gap: 14px;
    padding: 16px;
    background: transparent;
}

.category-card {
    background: var(--card-bg);
    border: none;
    border-radius: var(--border-radius);
    overflow: hidden;
    outline: none;
    box-shadow: var(--shadow-md);
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    height: var(--template-category-height, 140px);
    cursor: pointer;
    isolation: isolate;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Kategori kart stilleri */
.mobile-container[data-category-style="2"] .category-card {
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.mobile-container[data-category-style="3"] .category-card {
    border-radius: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.mobile-container[data-category-style="3"] .category-title-overlay {
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.75) 100%);
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.category-card:active {
    transform: translateY(-2px) scale(0.98);
}

.category-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    filter: brightness(0.95);
    display: block;
    border-radius: inherit;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.category-card:hover img {
    transform: scale(1.05);
    filter: brightness(1);
}

.category-title-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: var(--template-category-justify, center);
    background: var(--template-category-overlay, linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.5) 100%));
    color: var(--template-category-name-color, white);
    font-weight: 700;
    font-size: var(--template-category-font-size, 16px);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
    z-index: 2;
    padding: 12px;
    text-align: var(--template-category-text-align, center);
    border-radius: inherit;
}

.premium-card {
    border: none;
}

/* Category Page Header */
.category-page-header {
    padding: 16px 20px;
    background: transparent;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 16px;
}

.back-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.2s;
    border: none;
    flex-shrink: 0;
}

.back-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.back-button:active {
    transform: scale(0.95);
}

.back-button i {
    margin: 0;
}

.category-page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
    letter-spacing: 0.5px;
    flex: 1;
}

/* Product List - kolon sayısı şablondan */
.product-list {
    padding: 12px 20px 24px;
    background: transparent;
    display: grid;
    grid-template-columns: repeat(var(--template-product-columns, 1), 1fr);
    gap: 12px;
}

.product-box {
    background: var(--template-product-bg, var(--card-bg));
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
    border: none;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    cursor: pointer;
    min-height: var(--template-product-image-size, 110px);
}

/* Ürün kolon sayısı > 1 iken kartlar dikey (görsel üstte) */
.mobile-container[data-product-columns="2"] .product-list .product-box,
.mobile-container[data-product-columns="3"] .product-list .product-box {
    flex-direction: column;
    min-height: 0;
}

.mobile-container[data-product-columns="2"] .product-list .product-box-image,
.mobile-container[data-product-columns="3"] .product-list .product-box-image {
    width: 100%;
    min-width: 100%;
    height: var(--template-product-image-size, 110px);
}

/* Ürün kart stilleri */
.mobile-container[data-product-style="2"] .product-box {
    flex-direction: column;
    min-height: 0;
}

.mobile-container[data-product-style="2"] .product-box-image {
    width: 100%;
    min-width: 100%;
    height: var(--template-product-image-size, 110px);
}

.mobile-container[data-product-style="3"] .product-box {
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    padding: 10px;
}

.mobile-container[data-product-style="3"] .product-box-image {
    width: 64px;
    min-width: 64px;
    height: 64px;
    border-radius: 8px;
}

.mobile-container[data-product-style="4"] .product-box {
    border: 2px solid rgba(0, 0, 0, 0.08);
    border-radius: 4px;
}

.product-box:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.product-box:active {
    transform: scale(0.98);
}

.product-box-image {
    width: var(--template-product-image-size, 110px);
    min-width: var(--template-product-image-size, 110px);
    height: var(--template-product-image-size, 110px);
    overflow: hidden;
    background: #f0f0f0;
    position: relative;
    flex-shrink: 0;
}

.product-box-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-box-content {
    padding: 12px 14px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}

.product-box-name {
    font-weight: 700;
    font-size: var(--template-product-font-size, 15px);
    color: var(--template-product-name-color, var(--text-color));
    margin-bottom: 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.product-box-desc {
    font-size: 0.75rem;
    color: var(--template-product-desc-color, #6c757d);
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.product-box-footer {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-top: auto;
    padding-top: 6px;
}

.product-box-price {
    font-weight: 700;
    font-size: var(--template-product-price-font-size, 16px);
    color: var(--template-product-price-color, #e67e22);
    letter-spacing: 0.2px;
}

.product-add-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--accent-color);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(39, 174, 96, 0.25);
}

.product-add-btn:hover {
    background: var(--accent-hover);
    transform: scale(1.08);
    box-shadow: 0 3px 10px rgba(39, 174, 96, 0.35);
}

.product-add-btn:active {
    transform: scale(0.95);
}

.product-add-btn i {
    font-size: 0.9rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 4rem;
    opacity: 0.2;
    margin-bottom: 16px;
    color: var(--accent-color);
}

.empty-state p {
    font-size: 1rem;
    margin: 0;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
    opacity: 0;
}

.animate-fade-in:nth-child(1) {
    animation-delay: 0.05s;
}

.animate-fade-in:nth-child(2) {
    animation-delay: 0.1s;
}

.animate-fade-in:nth-child(3) {
    animation-delay: 0.15s;
}

.animate-fade-in:nth-child(4) {
    animation-delay: 0.2s;
}

.animate-fade-in:nth-child(5) {
    animation-delay: 0.25s;
}

.animate-fade-in:nth-child(6) {
    animation-delay: 0.3s;
}

.animate-fade-in:nth-child(7) {
    animation-delay: 0.35s;
}

.animate-fade-in:nth-child(8) {
    animation-delay: 0.4s;
}

/* Responsive adjustments */
@media (max-width: 360px) {
    .categories-grid {
        gap: 12px;
        padding: 12px;
    }

    .category-card {
        height: 120px;
    }

    .restaurant-header {
        height: 190px;
    }

    .restaurant-logo-badge {
        width: 100px;
        height: 100px;
    }

    .category-page-header {
        padding: 12px 16px;
    }

    .category-page-title {
        font-size: 1.3rem;
    }

    .product-list {
        gap: 10px;
        padding: 10px 16px 20px;
    }

    .product-box {
        min-height: 100px;
        border-radius: 10px;
    }

    .product-box-image {
        width: 100px;
        min-width: 100px;
        height: 100px;
    }

    .product-box-content {
        padding: 10px 12px;
    }

    .product-box-name {
        font-size: 0.9rem;
    }

    .product-box-desc {
        font-size: 0.7rem;
    }

    .product-box-price {
        font-size: 1rem;
    }

    .product-add-btn {
        width: 32px;
        height: 32px;
    }
}

/* --- Layout Type 2: Sticky category nav, tek sayfa --- */
/* Wrapper: spacer (yer kaplar) + sticky nav; fixed olunca menü zıplamaz */
.category-nav-wrapper {
    position: relative;
}

.category-nav-spacer {
    height: 0;
    transition: height 0.15s ease;
}

.category-nav-wrapper.is-fixed .category-nav-sticky {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    z-index: 90;
}

.category-nav-sticky {
    position: relative;
    z-index: 90;
    background: #fff;
    padding: 10px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.category-nav-scroll {
    display: flex;
    gap: 8px;
    padding: 0 16px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.category-nav-scroll::-webkit-scrollbar {
    display: none;
}

.category-nav-tab {
    flex-shrink: 0;
    padding: 10px 16px;
    min-height: 44px;
    border-radius: 8px;
    border: 2px solid #c0392b;
    background: #fff;
    color: #c0392b;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.08);
}

.category-nav-tab:hover {
    background: #fdf2f2;
}

.category-nav-tab.active {
    background: #c0392b;
    color: #fff;
    border-color: #c0392b;
}

.menu-content-type2 {
    padding-bottom: 24px;
}

.category-section {
    padding: 0 0 24px;
}

.category-section-banner {
    width: 100%;
    height: 200px;
    overflow: hidden;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
}

.category-section-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 40%;
    display: block;
}

.category-section-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 16px 12px;
    letter-spacing: 0.5px;
}

.menu-content-type2 .product-list {
    padding: 0 16px;
}

.type2-header {
    margin-bottom: 0;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection */
::selection {
    background: var(--accent-color);
    color: white;
}