/* ===== QR MENÜ - MOBİL ÖNCELİKLİ ===== */
* { margin:0; padding:0; box-sizing:border-box; }

body {
    font-family: var(--font-body, 'Poppins', sans-serif);
    background: #f5f5f5;
    color: var(--text, #333);
    -webkit-text-size-adjust: 100%;
}

/* Hata Sayfası */
.qr-error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--secondary, #1a1a2e), #16213e);
}
.qr-error-box {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    max-width: 360px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.qr-error-icon { font-size: 48px; margin-bottom: 15px; }
.qr-error-box h2 { color: var(--accent, #e94560); margin-bottom: 10px; }
.qr-error-box p { color: #666; font-size: 14px; line-height: 1.6; margin-bottom: 20px; }

/* App Container */
.qr-app {
    max-width: 480px;
    margin: 0 auto;
    background: #fff;
    min-height: 100vh;
    position: relative;
    box-shadow: 0 0 30px rgba(0,0,0,.08);
}

/* Header */
.qr-header {
    background: linear-gradient(135deg, var(--secondary, #1a1a2e), #16213e);
    color: #fff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}
.qr-header h1 {
    font-family: var(--font-heading, 'Playfair Display', serif);
    font-size: 20px;
    font-weight: 700;
}
.qr-table-badge {
    background: rgba(255,255,255,.15);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    margin-top: 4px;
    display: inline-block;
}
.qr-header-actions { display: flex; gap: 8px; }

/* Buttons */
.qr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    background: var(--primary, #c8a97e);
    color: #fff;
    text-decoration: none;
}
.qr-btn:hover { opacity: .9; transform: translateY(-1px); }
.qr-btn:active { transform: scale(.97); }

.qr-btn-call {
    background: var(--accent, #e94560);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    padding: 0;
    font-size: 18px;
    animation: pulse 2s infinite;
}
.qr-btn-call.called {
    background: #27ae60;
    animation: none;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(233,69,96,.4); }
    70% { box-shadow: 0 0 0 10px rgba(233,69,96,0); }
}

.qr-btn-add {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--primary, #c8a97e);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
    flex-shrink: 0;
}
.qr-btn-add:active { transform: scale(.85); }

.qr-btn-order {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    border-radius: 12px;
    margin-top: 10px;
    background: #27ae60;
}
.qr-btn-sm {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 8px;
}

/* Tabs */
.qr-tabs {
    display: flex;
    background: #fff;
    border-bottom: 2px solid #f0f0f0;
    position: sticky;
    top: 76px;
    z-index: 99;
}
.qr-tab {
    flex: 1;
    padding: 12px 8px;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    color: #999;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: color .2s;
}
.qr-tab.active { color: var(--primary, #c8a97e); }
.qr-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary, #c8a97e);
}
.qr-cart-count, .qr-order-count {
    background: var(--accent, #e94560);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Tab Content */
.qr-tab-content {
    display: none;
    padding: 16px;
    padding-bottom: 80px;
}
.qr-tab-content.active { display: block; }

/* Welcome */
.qr-welcome {
    background: linear-gradient(135deg, var(--primary, #c8a97e), #a87d4e);
    color: #fff;
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 14px;
    margin-bottom: 16px;
    text-align: center;
}

/* Category Filters */
.qr-cat-filters {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0 16px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.qr-cat-filters::-webkit-scrollbar { display: none; }

.qr-cat-btn {
    padding: 8px 16px;
    border: 2px solid #e0e0e0;
    background: #fff;
    border-radius: 24px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all .2s;
    color: #666;
}
.qr-cat-btn.active {
    background: var(--primary, #c8a97e);
    border-color: var(--primary, #c8a97e);
    color: #fff;
}

/* Category Title */
.qr-cat-title {
    font-family: var(--font-heading, 'Playfair Display', serif);
    font-size: 22px;
    color: var(--heading, #1a1a2e);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0f0f0;
}

/* Menu Items */
.qr-menu-section { margin-bottom: 24px; }

.qr-menu-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    margin-bottom: 10px;
    transition: box-shadow .2s;
}
.qr-menu-item:active { box-shadow: 0 2px 12px rgba(0,0,0,.08); }

.qr-item-img {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
}
.qr-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.qr-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.qr-item-info h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--heading, #1a1a2e);
    margin-bottom: 4px;
}
.qr-item-desc {
    font-size: 12px;
    color: #888;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
}

.qr-item-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.qr-item-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary, #c8a97e);
}
.qr-item-price.no-price {
    font-size: 12px;
    font-weight: 500;
    color: #999;
    font-style: italic;
}

/* Empty State */
.qr-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}
.qr-empty i { font-size: 48px; margin-bottom: 15px; opacity: .4; }
.qr-empty p { font-size: 15px; margin-bottom: 20px; }

/* Cart Items */
.qr-cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #fafafa;
    border-radius: 10px;
    margin-bottom: 8px;
}
.qr-cart-item-info { flex: 1; min-width: 0; }
.qr-cart-item-name {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.qr-cart-item-price { font-size: 13px; color: #888; }

.qr-cart-qty {
    display: flex;
    align-items: center;
    gap: 8px;
}
.qr-cart-qty button {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: #fff;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
}
.qr-cart-qty button:active { background: #f0f0f0; }
.qr-cart-qty span { font-weight: 600; min-width: 20px; text-align: center; }

.qr-cart-item-total {
    font-weight: 700;
    color: var(--primary, #c8a97e);
    font-size: 14px;
    min-width: 60px;
    text-align: right;
}

/* Cart Summary */
.qr-cart-summary {
    border-top: 2px solid #f0f0f0;
    padding-top: 16px;
    margin-top: 16px;
}
.qr-cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: 700;
    color: var(--heading, #1a1a2e);
}
.qr-price-note {
    font-size: 12px;
    color: #999;
    font-style: italic;
    margin-top: 6px;
}

/* Cart Note */
.qr-cart-note {
    margin-top: 16px;
}
.qr-cart-note label {
    font-size: 13px;
    font-weight: 500;
    color: #666;
    display: block;
    margin-bottom: 6px;
}
.qr-cart-note textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-family: inherit;
    font-size: 13px;
    resize: vertical;
}

/* Order Cards */
.qr-order-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
}
.qr-order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.qr-order-number { font-weight: 700; font-size: 16px; }
.qr-order-status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.status-pending { background: #fff3e0; color: #e65100; }
.status-confirmed { background: #e8f5e9; color: #2e7d32; }
.status-preparing { background: #e3f2fd; color: #1565c0; }
.status-ready { background: #f3e5f5; color: #7b1fa2; }
.status-delivered { background: #e0f2f1; color: #00695c; }
.status-completed { background: #f5f5f5; color: #616161; }
.status-cancelled { background: #ffebee; color: #c62828; }

.qr-order-items { border-top: 1px solid #f0f0f0; padding-top: 10px; }
.qr-order-item-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 4px 0;
    color: #555;
}

.qr-order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}
.qr-order-time { font-size: 12px; color: #999; }
.qr-order-total { font-weight: 700; color: var(--primary, #c8a97e); }
.qr-order-total.no-price {
    font-size: 12px;
    font-weight: 500;
    color: #999;
    font-style: italic;
}

/* Modal Overlay */
.qr-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.5);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn .2s ease;
}
.qr-modal {
    background: #fff;
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    max-width: 320px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
    animation: scaleIn .2s ease;
}
.qr-modal-icon { font-size: 40px; color: var(--accent, #e94560); margin-bottom: 12px; }
.qr-modal h3 { margin-bottom: 8px; font-size: 18px; }
.qr-modal p { margin-bottom: 20px; font-size: 14px; color: #666; }
.qr-modal-actions { display: flex; gap: 10px; justify-content: center; }
.qr-modal-actions .qr-btn { min-width: 100px; padding: 10px 16px; border-radius: 10px; font-size: 14px; border: none; cursor: pointer; font-weight: 500; }
.qr-btn-cancel { background: #eee; color: #333; }
.qr-btn-confirm { background: var(--accent, #e94560); color: #fff; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { transform: scale(.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Toast */
.qr-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #333;
    color: #fff;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    z-index: 9999;
    transition: transform .3s ease;
    white-space: nowrap;
    max-width: 90%;
    text-align: center;
}
.qr-toast.show { transform: translateX(-50%) translateY(0); }
.qr-toast.success { background: #27ae60; }
.qr-toast.error { background: #e94560; }

/* ===== 3D / AR Viewer ===== */
.qr-3d-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
    backdrop-filter: blur(4px);
    transition: background 0.2s;
}
.qr-3d-badge:hover { background: var(--primary, #c8a97e); }
.qr-3d-badge i { font-size: 0.8rem; }

.qr-item-no-photo {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f0f0, #e8e8e8);
    min-height: 80px;
}
.qr-3d-badge-only {
    position: static;
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: 10px;
    background: var(--primary, #c8a97e);
}
.qr-3d-badge-only:hover { background: var(--secondary, #1a1a2e); }

.qr-item-img { position: relative; }

/* 3D Viewer Modal */
.qr-3d-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn 0.2s;
}
.qr-3d-modal {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.qr-3d-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #eee;
}
.qr-3d-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}
.qr-3d-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #999;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.2s;
}
.qr-3d-close:hover { background: #f0f0f0; color: #333; }
.qr-3d-body {
    flex: 1;
    min-height: 400px;
    height: 60vh;
    position: relative;
    overflow: hidden;
}
.qr-3d-hint {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.6);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    pointer-events: none;
    white-space: nowrap;
    animation: hintFade 3s ease-in-out forwards;
}
@keyframes hintFade {
    0%, 70% { opacity: 1; }
    100% { opacity: 0; }
}

/* Spin Viewer */
.spin-viewer {
    width: 100%;
    height: 100%;
    min-height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    cursor: grab;
    user-select: none;
    position: relative;
    border-radius: 0 0 16px 16px;
    overflow: hidden;
}
.spin-viewer:active { cursor: grabbing; }
.spin-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    pointer-events: none;
}

/* AR Button (model-viewer slot) */
.qr-ar-btn {
    position: absolute;
    bottom: 16px;
    right: 16px;
    background: linear-gradient(135deg, var(--primary, #c8a97e), var(--accent, #e94560));
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 10;
    transition: transform 0.2s, box-shadow 0.2s;
    animation: arPulse 2s ease-in-out infinite;
}
.qr-ar-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}
.qr-ar-btn i { font-size: 1.1rem; }

/* 3D Loading */
.qr-3d-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #f5f5f5;
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
}
.qr-3d-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e0e0e0;
    border-top-color: var(--primary, #c8a97e);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.qr-3d-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(0,0,0,0.1);
    z-index: 20;
    transition: opacity 0.5s;
}
.qr-3d-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary, #c8a97e), var(--accent, #e94560));
    border-radius: 0 2px 2px 0;
    transition: width 0.2s;
}
@keyframes arPulse {
    0%, 100% { box-shadow: 0 4px 15px rgba(0,0,0,0.3); }
    50% { box-shadow: 0 4px 25px rgba(233,69,96,0.5); }
}

/* Loading */
.qr-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}
.qr-loading::after {
    content: '';
    width: 32px;
    height: 32px;
    border: 3px solid #e0e0e0;
    border-top-color: var(--primary, #c8a97e);
    border-radius: 50%;
    animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Responsive */
@media (min-width: 481px) {
    .qr-app { border-left: 1px solid #e0e0e0; border-right: 1px solid #e0e0e0; }
    body { background: #e8e8e8; }
}

/* ===== LANGUAGE SWITCHER ===== */
.qr-lang-switcher {
    position: relative;
}
.qr-btn-lang {
    background: rgba(255,255,255,.15);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    padding: 0;
    font-size: 20px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
    color: #fff;
}
.qr-btn-lang:hover { background: rgba(255,255,255,.25); }
.qr-lang-flag { font-size: 20px; line-height: 1; }

.qr-lang-dropdown {
    position: absolute;
    right: 0;
    top: 50px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,.2);
    min-width: 160px;
    overflow: hidden;
    z-index: 200;
    display: none;
}
.qr-lang-dropdown.show { display: block; }

.qr-lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    transition: background .15s;
}
.qr-lang-option:hover { background: #f5f5f5; }
.qr-lang-option.active {
    background: rgba(200,169,126,.1);
    color: var(--primary, #c8a97e);
    font-weight: 600;
}
.qr-lang-option .qr-lang-flag {
    font-size: 18px;
}

/* ===== Alerjen & içindekiler (katlanır, taşma korumalı) ===== */
.qr-allergens { margin: 6px 0 0; border: 1px solid #ffe0b2; border-radius: 9px; background: #fffaf2; }
.qr-allergens > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 7px; padding: 6px 10px; font-size: 12px; color: #b9770e; font-weight: 600; }
.qr-allergens > summary::-webkit-details-marker { display: none; }
.qr-allergens .qra-title { white-space: nowrap; }
.qr-allergens .qra-right { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; max-width: 56%; overflow: hidden; }
.qr-allergens .qra-emojis { font-weight: 400; letter-spacing: 1px; font-size: 14px; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qr-allergens .qra-chevron { font-size: 10px; flex: none; transition: transform .2s; }
.qr-allergens[open] .qra-chevron { transform: rotate(180deg); }
.qr-allergens .qra-body { padding: 0 10px 10px; }
.qr-allergens .qra-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.qr-allergens .qra-chip { font-size: 11px; background: #fff; border: 1px solid #ffe0b2; border-radius: 20px; padding: 2px 8px; color: #7a5418; white-space: nowrap; }
.qr-allergens .qra-ing { font-size: 11.5px; color: #777; margin: 8px 0 0; line-height: 1.5; }
.qr-allergens .qra-note { font-size: 11.5px; color: #b9770e; margin: 6px 0 0; line-height: 1.5; }
