/* ══════════════════════════════════
   KÖK MENÜ v1.0 — style.css
══════════════════════════════════ */

/* ── 1. Değişkenler ── */
:root {
    --navy:       #0a1628;
    --navy2:      #0d1f35;
    --navy3:      #112240;
    --teal:       #2a9d8f;
    --teal-dark:  #1f7a6e;
    --teal-light: rgba(42,157,143,0.15);
    --teal-glow:  rgba(42,157,143,0.08);
    --text:       #e8f4f3;
    --text2:      #b0cfc9;
    --muted:      #7a9aa8;
    --border:     rgba(42,157,143,0.15);
    --card-bg:    rgba(13,31,53,0.95);
    --overlay:    rgba(10,22,40,0.75);
    --danger:     #e76f51;
    --success:    #52b788;
    --radius:     10px;
    --shadow:     0 4px 24px rgba(0,0,0,0.4);
}

/* ── 2. Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', sans-serif;
    background: var(--navy);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea { font-family: inherit; }
img { display: block; }

/* ── 3. Loading Ekranı ── */
#loading-screen {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: var(--navy);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    transition: opacity 0.4s ease;
}
#loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}
.loading-logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
}
.loading-bar {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(42,157,143,0.2);
    border-top-color: var(--teal);
    border-radius: 50%;
    animation: spin 0.85s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 4. Sayfalar ── */
#page-home, #page-category {
    display: none;
    min-height: 100vh;
    animation: fadeIn 0.3s ease;
}
#page-home.active, #page-category.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ── 5. Dil Çubuğu ── */
.lang-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    background: rgba(10,22,40,0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.lang-btn {
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    transition: all 0.2s;
}
.lang-btn:hover { color: var(--text); background: var(--teal-light); }
.lang-btn.active { background: var(--teal); color: #fff; }

/* ── 6. Hero ── */
.hero {
    position: relative;
    height: 320px;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.hero-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(10,22,40,0.3) 0%, rgba(10,22,40,0.85) 100%);
}
#info-toggle {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    padding: 7px 14px;
    background: rgba(10,22,40,0.7);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--teal);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    transition: all 0.2s;
}
#info-toggle:hover { background: var(--teal); color: #fff; }
.hero-content {
    position: relative;
    z-index: 5;
    text-align: center;
    padding: 0 16px 24px;
    width: 100%;
}
.hero-logo {
    width: 100px;
    height: 100px;
    object-fit: contain;
    margin: 0 auto 10px;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5));
}
.hero-logo-placeholder {
    font-size: 60px;
    margin: 0 auto 10px;
    line-height: 1;
}
.hero-subtitle {
    font-family: 'DM Serif Display', serif;
    font-style: italic;
    font-size: 15px;
    color: var(--text2);
    letter-spacing: 0.02em;
}

/* ── 7. Kategoriler ── */
.categories-section {
    padding: 24px 16px 100px;
    max-width: 640px;
    margin: 0 auto;
}
.categories-title {
    font-family: 'DM Serif Display', serif;
    font-size: 18px;
    color: var(--teal);
    margin-bottom: 16px;
    letter-spacing: 0.02em;
}
.categories-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.cat-card {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 4/3;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
}
.cat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
.cat-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.cat-card:hover .cat-card-img { transform: scale(1.04); }
.cat-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 40%, rgba(10,22,40,0.88) 100%);
}
.cat-card-placeholder {
    width: 100%;
    height: 100%;
    background: var(--navy3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
}
.cat-card-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 12px;
    font-family: 'DM Serif Display', serif;
    font-size: 15px;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}
.cat-card-edit {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    background: rgba(10,22,40,0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    display: none;
}
.admin-mode .cat-card-edit { display: flex; }

/* ── 8. Kategori Sayfası ── */
.cat-page-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--navy2);
    position: sticky;
    top: 45px;
    z-index: 50;
}
.cat-back-btn {
    color: var(--teal);
    font-size: 13px;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 6px;
    transition: background 0.2s;
    white-space: nowrap;
}
.cat-back-btn:hover { background: var(--teal-light); }
.cat-page-title {
    font-family: 'DM Serif Display', serif;
    font-size: 17px;
    color: var(--text);
    flex: 1;
    text-align: center;
    padding-right: 60px;
}
.cat-items-container {
    padding: 12px;
    max-width: 640px;
    margin: 0 auto;
    padding-bottom: 100px;
}
.urun-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius);
    background: var(--card-bg);
    border: 1px solid var(--border);
    margin-bottom: 8px;
    transition: border-color 0.2s;
}
.urun-card:hover { border-color: rgba(42,157,143,0.3); }
.urun-img-wrap {
    width: 72px;
    height: 72px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    cursor: pointer;
    background: var(--navy3);
    display: flex;
    align-items: center;
    justify-content: center;
}
.urun-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.urun-img-placeholder { font-size: 28px; }
.urun-info { flex: 1; min-width: 0; }
.urun-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.urun-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--teal);
    font-family: 'DM Serif Display', serif;
}
.urun-actions {
    display: none;
    flex-direction: column;
    gap: 4px;
    align-items: flex-end;
}
.admin-mode .urun-actions { display: flex; }
.urun-action-btn {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 5px;
    background: var(--teal-light);
    color: var(--teal);
    font-weight: 500;
    transition: background 0.2s;
    white-space: nowrap;
}
.urun-action-btn:hover { background: var(--teal); color: #fff; }
.urun-action-btn.del { background: rgba(231,111,81,0.1); color: var(--danger); }
.urun-action-btn.del:hover { background: var(--danger); color: #fff; }
.urun-drag-handle {
    display: none;
    color: var(--muted);
    font-size: 16px;
    padding: 0 4px;
    cursor: grab;
}
.admin-mode .urun-drag-handle { display: block; }
.sortable-ghost { opacity: 0.4; }
.del-kat-btn {
    padding: 6px 12px;
    background: rgba(231,111,81,0.1);
    color: var(--danger);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid rgba(231,111,81,0.2);
    transition: all 0.2s;
}
.del-kat-btn:hover { background: var(--danger); color: #fff; }

/* ── 9. Info Drawer ── */
#info-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(3px);
}
#info-overlay.active { display: block; }
#info-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 201;
    background: var(--navy2);
    border-top: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
    max-height: 80vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
    max-width: 640px;
    margin: 0 auto;
}
#info-drawer.open { transform: translateY(0); }
.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--navy2);
    z-index: 1;
}
.drawer-header h3 {
    font-family: 'DM Serif Display', serif;
    font-size: 18px;
    color: var(--teal);
}
.drawer-close-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--teal-light);
    color: var(--teal);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.drawer-close-btn:hover { background: var(--teal); color: #fff; }
.drawer-body { padding: 16px 20px 32px; }
.drawer-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.drawer-row:last-child { border-bottom: none; }
.drawer-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.drawer-label {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 3px;
}
.drawer-value {
    font-size: 14px;
    color: var(--text);
    line-height: 1.4;
}
.drawer-value a { color: var(--teal); text-decoration: none; }
.drawer-value a:hover { text-decoration: underline; }
.drawer-edit-btn {
    margin-left: auto;
    flex-shrink: 0;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 5px;
    background: var(--teal-light);
    color: var(--teal);
    display: none;
    transition: background 0.2s;
}
.drawer-edit-btn:hover { background: var(--teal); color: #fff; }
.admin-mode .drawer-edit-btn { display: block; }

/* Renk önizleme */
.color-preview {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.2);
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
}

/* ── 10. Lightbox ── */
#lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(0,0,0,0.92);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
}
#lightbox.active { display: flex; }
#lb-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    color: #fff;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
#lb-close:hover { background: rgba(255,255,255,0.2); }
#lb-img {
    max-width: 92vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
}
#lb-msg { font-size: 13px; color: var(--text2); text-align: center; }

/* ── 11. Pin / Admin Modali ── */
#pin-modal, #confirm-modal, #input-modal, #ceviri-modal, #img-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 600;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 16px;
}
#pin-modal.active, #confirm-modal.active, #input-modal.active,
#ceviri-modal.active, #img-modal.active { display: flex; }
.pin-box, .confirm-box, .input-modal-box, .ceviri-box, .img-modal-box {
    background: var(--navy2);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
    width: 100%;
    max-width: 360px;
    box-shadow: var(--shadow);
}
.pin-box h3, .ceviri-box h3, .img-modal-box h3 {
    font-family: 'DM Serif Display', serif;
    font-size: 20px;
    color: var(--teal);
    margin-bottom: 8px;
}
.pin-box p { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.pin-input, .modal-input, .ceviri-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--navy3);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    outline: none;
    margin-bottom: 10px;
    transition: border-color 0.2s;
}
.pin-input:focus, .modal-input:focus, .ceviri-input:focus { border-color: var(--teal); }
#pin-error {
    display: none;
    font-size: 12px;
    color: var(--danger);
    margin-bottom: 10px;
}
#pin-error.show { display: block; }
.pin-actions, .confirm-actions, .input-modal-actions, .ceviri-actions, .img-modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 8px;
}
.btn-pin-cancel, .btn-confirm-cancel, .btn-input-cancel, .btn-ceviri-cancel, .btn-img-cancel {
    padding: 8px 16px;
    border-radius: 7px;
    background: var(--teal-light);
    color: var(--text2);
    font-size: 13px;
    transition: background 0.2s;
}
.btn-pin-cancel:hover, .btn-confirm-cancel:hover, .btn-input-cancel:hover,
.btn-ceviri-cancel:hover, .btn-img-cancel:hover { background: rgba(42,157,143,0.25); }
.btn-pin-ok, .btn-input-ok, .btn-ceviri-ok {
    padding: 8px 20px;
    border-radius: 7px;
    background: var(--teal);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s;
}
.btn-pin-ok:hover, .btn-input-ok:hover, .btn-ceviri-ok:hover { background: var(--teal-dark); }
.confirm-box p { font-size: 14px; color: var(--text); margin-bottom: 16px; }
.btn-confirm-ok {
    padding: 8px 20px;
    border-radius: 7px;
    background: var(--danger);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s;
}
.btn-confirm-ok:hover { background: #c9573a; }
#input-modal-title { font-size: 14px; font-weight: 600; color: var(--text2); margin-bottom: 10px; }

/* ── 12. Çeviri Modali ── */
.ceviri-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.ceviri-flag { font-size: 20px; flex-shrink: 0; }
.ceviri-input { margin-bottom: 0; }
.ceviri-input[readonly] { opacity: 0.5; }

/* ── 13. Fotoğraf Modali ── */
.img-tabs {
    display: flex;
    gap: 4px;
    background: var(--navy3);
    padding: 4px;
    border-radius: 8px;
    margin: 12px 0 16px;
}
.img-tab-btn {
    flex: 1;
    padding: 7px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    transition: all 0.2s;
}
.img-tab-btn.active { background: var(--teal); color: #fff; }
.img-tab-content { display: none; margin-bottom: 12px; }
.img-tab-content.active { display: block; }
.file-drop-area {
    border: 1.5px dashed var(--border);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    color: var(--muted);
    font-size: 13px;
    transition: border-color 0.2s, background 0.2s;
}
.file-drop-area:hover { border-color: var(--teal); background: var(--teal-glow); }
#file-input { display: none; }
#file-preview {
    max-width: 100%;
    max-height: 150px;
    object-fit: contain;
    margin-top: 10px;
    border-radius: 6px;
    display: none;
}
#url-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--navy3);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}
#url-input:focus { border-color: var(--teal); }
.btn-img-apply {
    padding: 8px 16px;
    border-radius: 7px;
    background: var(--teal);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s;
}
.btn-img-apply:hover { background: var(--teal-dark); }
.btn-img-remove {
    padding: 8px 14px;
    border-radius: 7px;
    background: rgba(231,111,81,0.1);
    color: var(--danger);
    font-size: 13px;
    transition: all 0.2s;
}
.btn-img-remove:hover { background: var(--danger); color: #fff; }

/* ── 14. Admin Çubuğu ── */
#admin-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 300;
    padding: 10px 12px;
    gap: 8px;
    background: rgba(10,22,40,0.96);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    justify-content: center;
    flex-wrap: wrap;
}
#admin-bar.active { display: flex; }
.admin-bar-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}
.btn-add-cat { background: var(--teal-light); color: var(--teal); border: 1px solid rgba(42,157,143,0.3); }
.btn-add-cat:hover { background: var(--teal); color: #fff; }
.btn-save { background: var(--teal); color: #fff; }
.btn-save:hover { background: var(--teal-dark); }
.btn-password { background: rgba(255,255,255,0.05); color: var(--text2); border: 1px solid rgba(255,255,255,0.1); }
.btn-password:hover { background: rgba(255,255,255,0.12); }
.btn-exit { background: rgba(231,111,81,0.1); color: var(--danger); border: 1px solid rgba(231,111,81,0.2); }
.btn-exit:hover { background: var(--danger); color: #fff; }
.btn-save.saving { opacity: 0.7; pointer-events: none; }

/* ── 15. Admin Gizli Elemanlar ── */
.admin-only { display: none; }
.admin-mode .admin-only { display: flex; }

/* ── 16. Toast ── */
#toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    z-index: 999;
    background: var(--navy3);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 20px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.25s, transform 0.25s;
    pointer-events: none;
    white-space: nowrap;
}
#toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
#toast.success { border-color: rgba(82,183,136,0.4); color: var(--success); }
#toast.error { border-color: rgba(231,111,81,0.4); color: var(--danger); }

/* ── 17. Footer ── */
.footer {
    padding: 20px;
    text-align: center;
    border-top: 1px solid var(--border);
    margin-top: 20px;
}
.footer-credit { font-size: 10px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 4px; }
.footer-name {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text2);
    letter-spacing: 0.12em;
}
.footer-line { flex: 1; max-width: 40px; height: 1px; background: var(--border); }

/* ── 18. Scrollbar ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(42,157,143,0.3); border-radius: 2px; }

/* ── 19. RTL (Arapça) ── */
.lang-ar .hero-subtitle,
.lang-ar .cat-page-title,
.lang-ar .drawer-value,
.lang-ar .urun-name { direction: rtl; }

/* ── 20. Admin logo/hero edit overlay ── */
.hero-admin-overlay {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(10,22,40,0.5);
}
.admin-mode .hero:hover .hero-admin-overlay { display: flex; }
.hero-edit-btn {
    padding: 8px 14px;
    background: var(--teal);
    color: #fff;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
}

/* ── 21. Ürün form (admin) ── */
#add-urun-wrap { display: none; }
.admin-mode #add-urun-wrap { display: block !important; }
#add-urun-btn {
    cursor: pointer;
    transition: all 0.2s;
}
#add-urun-btn:hover { background: var(--teal-glow) !important; }
