/* ============================================================
   Güneş Restaurant — Sun Theme v2
   v1: nav, whatsapp button, about/contact
   v2: + galeri (PhotoSwipe), mobil harita iyileştirmeleri
   Ana renk: #F39C12 (sıcak amber)
   ============================================================ */

:root {
    --gr-primary: #F39C12;
    --gr-primary-dark: #E67E22;
    --gr-primary-light: rgba(243, 156, 18, 0.1);
    --gr-accent: #FFC30B;
}

/* ---------- Site Navigation ---------- */
.site-nav { position: relative; }
.nav-menu {
    list-style: none; padding: 0; margin: 0;
    display: flex; justify-content: center; gap: 0.25rem; flex-wrap: wrap;
}
.nav-menu li { margin: 0; }
.nav-menu a {
    display: block; padding: 0.5rem 0.9rem;
    color: #333; text-decoration: none; border-radius: 6px;
    font-weight: 500; font-size: 0.95rem;
    transition: background 0.2s, color 0.2s; white-space: nowrap;
}
.nav-menu a:hover { background: var(--gr-primary-light); color: var(--gr-primary-dark); }
.nav-menu a.active { background: var(--gr-primary); color: #fff; }
.nav-menu a i { margin-right: 0.3rem; font-size: 0.85rem; }

.nav-toggle {
    display: none; background: var(--gr-primary); color: #fff; border: none;
    padding: 0.5rem 1rem; border-radius: 6px; font-size: 1rem;
    cursor: pointer; width: 100%; margin-bottom: 0.5rem;
}

@media (max-width: 767.98px) {
    .nav-toggle { display: block; }
    .nav-menu {
        display: none; flex-direction: column; background: #fff;
        border: 1px solid #e0e0e0; border-radius: 8px; padding: 0.5rem;
        margin-top: 0.25rem;
    }
    .nav-menu.open { display: flex; }
    .nav-menu a { padding: 0.75rem 1rem; border-radius: 4px; }
}

/* ---------- WhatsApp Floating Button ---------- */
.whatsapp-float {
    position: fixed; bottom: 80px; right: 20px;
    width: 55px; height: 55px; background: #25D366; color: #fff;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem; box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    z-index: 999; text-decoration: none;
    transition: transform 0.2s; animation: wa-pulse 2s infinite;
}
.whatsapp-float:hover { transform: scale(1.08); color: #fff; }
@keyframes wa-pulse {
    0%   { box-shadow: 0 4px 12px rgba(0,0,0,0.25), 0 0 0 0 rgba(37, 211, 102, 0.7); }
    70%  { box-shadow: 0 4px 12px rgba(0,0,0,0.25), 0 0 0 15px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 4px 12px rgba(0,0,0,0.25), 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* ---------- Page Title ---------- */
.page-title { color: var(--gr-primary-dark); font-weight: 600; margin-bottom: 1.5rem; }

/* ---------- About Page ---------- */
.about-icon { color: var(--gr-primary); margin-bottom: 1rem; }
.about-features h5 { color: #333; font-weight: 600; }
.about-story h3 { color: var(--gr-primary-dark); font-weight: 600; }
.about-story p { line-height: 1.8; color: #555; text-align: justify; }

/* ---------- Contact Page ---------- */
.contact-card {
    background: #f8f9fa;
    border-radius: 12px;
}
.contact-card h4 {
    color: var(--gr-primary-dark); font-weight: 600;
    border-bottom: 2px solid var(--gr-accent); padding-bottom: 0.75rem;
}
.contact-row strong {
    display: inline-block; color: var(--gr-primary-dark);
    margin-bottom: 0.25rem; font-size: 0.9rem;
}
.contact-row strong i { margin-right: 0.4rem; }
.contact-row a { color: #333; }
.contact-row a:hover { color: var(--gr-primary); }

/* ---------- Map (responsive heights) ---------- */
#contact-map {
    width: 100%;
    height: 500px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    z-index: 1; /* leaflet stacking */
}

/* Mobil: viewport height kullan, daha büyük görün */
@media (max-width: 767.98px) {
    #contact-map {
        height: 70vh;          /* viewport height'in %70'i */
        min-height: 400px;     /* en az 400px */
        max-height: 600px;     /* en fazla 600px */
    }
}

/* Çok küçük mobil */
@media (max-width: 375px) {
    #contact-map {
        height: 65vh;
        min-height: 350px;
    }
}

/* Fullscreen plugin override */
.leaflet-control-zoom-fullscreen {
    background-image: none !important;
}
.leaflet-control-zoom-fullscreen::before {
    content: "\f065";  /* fa-expand */
    font-family: "Font Awesome 5 Free", "FontAwesome";
    font-weight: 900;
    font-size: 14px;
    line-height: 26px;
}
.leaflet-fullscreen-on .leaflet-control-zoom-fullscreen::before {
    content: "\f066";  /* fa-compress */
}

/* ---------- Header Background (Sun Theme) ---------- */
.appheader {
    background: linear-gradient(135deg, #FFF8E7 0%, #FFE4B5 100%) !important;
    border-bottom: 3px solid var(--gr-primary);
}

/* ---------- Bootstrap button overrides ---------- */
.btn-primary {
    background-color: var(--gr-primary) !important;
    border-color: var(--gr-primary) !important;
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--gr-primary-dark) !important;
    border-color: var(--gr-primary-dark) !important;
}
.btn-outline-primary {
    color: var(--gr-primary-dark) !important;
    border-color: var(--gr-primary) !important;
}
.btn-outline-primary:hover {
    background-color: var(--gr-primary) !important;
    color: #fff !important;
}

.businesstitle { color: var(--gr-primary-dark); }

/* ============================================================
   GALERİ — CSS Grid Masonry + Lightbox hover
   ============================================================ */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    grid-auto-rows: 280px;
}

/* Random heights for masonry feel */
.gallery-item:nth-child(3n+1) { grid-row: span 2; }
.gallery-item:nth-child(5n+3) { grid-row: span 1; }

@media (max-width: 575.98px) {
    .gallery-grid {
        grid-template-columns: 1fr 1fr;
        grid-auto-rows: 180px;
        gap: 0.5rem;
    }
}

@media (max-width: 380px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 240px;
    }
    .gallery-item:nth-child(n) { grid-row: span 1; }
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: zoom-in;
    transition: transform 0.3s, box-shadow 0.3s;
    display: block;
    text-decoration: none;
    color: inherit;
}

.gallery-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(243, 156, 18, 0.25);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%);
    color: #fff;
    padding: 1.5rem 1rem 1rem;
    transform: translateY(100%);
    transition: transform 0.3s;
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
}

.gallery-overlay h5 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--gr-accent);
}

.gallery-overlay p {
    margin: 0.25rem 0 0;
    font-size: 0.85rem;
    opacity: 0.9;
}

/* PhotoSwipe caption styling */
.pswp__caption-wrap {
    position: absolute;
    bottom: 0;
    width: 100%;
    text-align: center;
    color: #fff;
    padding: 1rem;
    background: rgba(0,0,0,0.6);
}

.pswp__caption-wrap h5 {
    color: var(--gr-accent);
    margin: 0 0 0.25rem;
}

/* Mobile gallery overlay always visible (no hover on touch) */
@media (hover: none) and (pointer: coarse) {
    .gallery-overlay {
        transform: translateY(0);
        background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 60%);
    }
    .gallery-item:hover img {
        transform: none;
    }
}
/* ============================================================
   HOTFIX — 3 sorun düzeltmesi
   custom.css'in SONUNA ekleyin (mevcut tüm CSS'i ezmek için)
   ============================================================ */

/* ----------------------------------------------------------
   FIX 1: .nav-toggle desktop'ta görünüyor / mobilde full-width
   ----------------------------------------------------------
   Sorun: width: 100% her ekranda, ayrıca bazen desktop'ta da görünüyor
   Çözüm: width auto, sadece mobilde inline-block, kompakt boyut
*/
.nav-toggle {
    display: none !important;          /* Default: gizli */
    width: auto !important;             /* Full-width yapma */
    padding: 0.4rem 0.9rem !important;
    font-size: 0.95rem !important;
    margin-bottom: 0 !important;
}

/* Sadece mobilde göster (768px altı) */
@media (max-width: 767.98px) {
    .nav-toggle {
        display: inline-flex !important;
        align-items: center;
        gap: 0.4rem;
        margin-bottom: 0.4rem !important;
    }
    .nav-toggle::after {
        content: "Menü";
        font-size: 0.9rem;
    }
}

/* ----------------------------------------------------------
   FIX 2: .businesstitle - style.css'in !important'ini ez
   ----------------------------------------------------------
   Sorun: style.css'te color: #FFF !important var, custom rengimiz görünmüyor
   Çözüm: Daha spesifik selector + !important
*/
.appheader .businesstitle,
header .businesstitle,
.businesstitle {
    color: var(--gr-primary-dark) !important;
}

/* Header arka plan değiştiyse beyaz başlık daha okunaklı olabilir */
@media (max-width: 767.98px) {
    .appheader .businesstitle {
        font-size: 1.1em !important;
    }
}

/* ----------------------------------------------------------
   FIX 3: .product-detail-image gerçekten fluid olsun
   ----------------------------------------------------------
   Sorun: max-height: 350px ve fixed margin → dar ekranda küçük kalıyor
   Çözüm: aspect-ratio kullan, container width'ine yasla, mobilde edge-to-edge
*/
.product-detail-image {
    width: 100% !important;
    max-width: 100% !important;
    max-height: none !important;        /* Eski 350px'i sil */
    height: auto !important;
    aspect-ratio: 4 / 3;                 /* Modern tarayıcılar */
    object-fit: cover !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 12px;
    display: block;
}

/* Container/wrapper'ın da fluid olduğundan emin ol */
.product-detail-image-wrapper,
.product-image-container {
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Mobilde edge-to-edge (rounded corner kalır ama padding gitsin) */
@media (max-width: 575.98px) {
    .product-detail-image {
        aspect-ratio: 16 / 10;            /* Mobilde biraz daha az boy */
        border-radius: 8px;
    }
}

/* Tablet ve desktop'ta makul max */
@media (min-width: 768px) {
    .product-detail-image {
        max-height: 500px !important;     /* Çok büyümesin diye üst sınır */
        aspect-ratio: 16 / 10;
    }
}

/* ============================================================
   v6: DARK MODE
   body.theme-dark sınıfı varken aktif olur
   ============================================================ */

body.theme-dark {
    background: #0A0A0A !important;
    color: #F4ECD8;
}

/* Bootstrap container/card overrides */
body.theme-dark .card,
body.theme-dark .modal-content {
    background: #1a1a1a !important;
    color: #F4ECD8 !important;
    border-color: rgba(201, 169, 97, 0.2) !important;
}

body.theme-dark .card-title,
body.theme-dark .card-text,
body.theme-dark h1, body.theme-dark h2, body.theme-dark h3,
body.theme-dark h4, body.theme-dark h5, body.theme-dark h6 {
    color: #F4ECD8 !important;
}

body.theme-dark .text-muted {
    color: #999 !important;
}

body.theme-dark a {
    color: var(--gr-accent);
}

body.theme-dark a:hover {
    color: var(--gr-primary);
}

/* Form inputs */
body.theme-dark .form-control,
body.theme-dark .form-select {
    background: #2a2a2a !important;
    border-color: rgba(201, 169, 97, 0.3) !important;
    color: #F4ECD8 !important;
}

body.theme-dark .form-control:focus,
body.theme-dark .form-select:focus {
    background: #2a2a2a !important;
    border-color: var(--gr-primary) !important;
    color: #F4ECD8 !important;
    box-shadow: 0 0 0 0.25rem rgba(201, 169, 97, 0.25);
}

/* Nav menu (dark) */
body.theme-dark .nav-menu a {
    color: #F4ECD8;
}

body.theme-dark .nav-menu a:hover {
    background: rgba(201, 169, 97, 0.15);
    color: var(--gr-accent);
}

body.theme-dark .nav-menu a.active {
    background: var(--gr-primary);
    color: #0A0A0A;
}

@media (max-width: 767.98px) {
    body.theme-dark .nav-menu {
        background: #1a1a1a;
        border-color: rgba(201, 169, 97, 0.3);
    }
}

/* Header in dark mode — keep gradient but darker */
body.theme-dark .appheader {
    /* Renkler brand.css'ten gelir, bu sadece text ayarlar */
    color: #F4ECD8;
}

body.theme-dark .appheader .businesstitle {
    color: var(--gr-accent) !important;
    text-shadow: 0 0 20px rgba(232, 199, 102, 0.3);
}

/* Page titles */
body.theme-dark .page-title {
    color: var(--gr-accent) !important;
}

/* Cart bar (alt) */
body.theme-dark #cart-button-container {
    background: rgba(20, 20, 20, 0.95) !important;
    border-top: 1px solid rgba(201, 169, 97, 0.3);
}

/* Tables (Bootstrap) */
body.theme-dark .table {
    color: #F4ECD8;
}

body.theme-dark .table-striped > tbody > tr:nth-of-type(odd) > * {
    background: rgba(201, 169, 97, 0.05);
    color: #F4ECD8;
}

/* Alerts */
body.theme-dark .alert-info {
    background: rgba(201, 169, 97, 0.1);
    color: #F4ECD8;
    border-color: rgba(201, 169, 97, 0.3);
}

/* Contact card */
body.theme-dark .contact-card {
    background: #1a1a1a !important;
    border: 1px solid rgba(201, 169, 97, 0.2);
}

body.theme-dark .contact-card h4 {
    color: var(--gr-accent) !important;
    border-bottom-color: var(--gr-primary) !important;
}

body.theme-dark .contact-row strong {
    color: var(--gr-accent) !important;
}

body.theme-dark .contact-row a {
    color: #F4ECD8;
}

body.theme-dark .contact-row a:hover {
    color: var(--gr-accent);
}

/* About page */
body.theme-dark .about-icon {
    color: var(--gr-accent) !important;
}

body.theme-dark .about-story p {
    color: #B8B0A0;
}

body.theme-dark .about-contact-cta {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a1f0f 100%) !important;
    border: 1px solid rgba(201, 169, 97, 0.3);
}

body.theme-dark .about-contact-cta h4 {
    color: var(--gr-accent) !important;
}

/* Gallery */
body.theme-dark .gallery-item {
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    background: #1a1a1a;
}

body.theme-dark .gallery-item:hover {
    box-shadow: 0 6px 16px rgba(201, 169, 97, 0.3);
}

/* Map popup (Leaflet) */
body.theme-dark .leaflet-popup-content-wrapper,
body.theme-dark .leaflet-popup-tip {
    background: #1a1a1a !important;
    color: #F4ECD8 !important;
}

body.theme-dark .leaflet-control-zoom a,
body.theme-dark .leaflet-control-zoom-fullscreen {
    background: #1a1a1a !important;
    color: #F4ECD8 !important;
    border-color: rgba(201, 169, 97, 0.3) !important;
}

/* In-house only badge */
.in-house-only-badge {
    display: inline-block;
    background: rgba(201, 169, 97, 0.15);
    color: var(--gr-primary-dark);
    border: 1px solid var(--gr-primary);
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

body.theme-dark .in-house-only-badge {
    background: rgba(201, 169, 97, 0.2);
    color: var(--gr-accent);
    border-color: var(--gr-accent);
}

/* In-house only product — disable add to cart */
.in-house-only .btn-add-cart,
.in-house-only #cart-button-container .add-to-cart {
    display: none !important;
}

.in-house-only-message {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 12px;
    background: rgba(201, 169, 97, 0.08);
    border-radius: 6px;
    margin: 12px 0;
}

body.theme-dark .in-house-only-message {
    background: rgba(201, 169, 97, 0.12);
    color: #B8B0A0;
}

/* ============================================================
   v6: GAMES (Maç Takvimi) — frontend stilleri
   ============================================================ */
.game-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 1rem;
    border-left: 4px solid var(--gr-primary);
    transition: transform 0.2s, box-shadow 0.2s;
}

.game-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(243, 156, 18, 0.15);
}

.game-card.featured {
    border-left-color: var(--gr-accent);
    background: linear-gradient(135deg, #fff 0%, rgba(255, 195, 11, 0.05) 100%);
}

body.theme-dark .game-card {
    background: #1a1a1a;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

body.theme-dark .game-card.featured {
    background: linear-gradient(135deg, #1a1a1a 0%, rgba(232, 199, 102, 0.08) 100%);
}

.game-league {
    color: var(--gr-primary-dark);
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

body.theme-dark .game-league {
    color: var(--gr-accent);
}

.game-teams {
    font-size: 1.3em;
    font-weight: 600;
    margin: 0.5rem 0;
}

.game-vs {
    color: var(--gr-primary);
    font-weight: 700;
    margin: 0 0.5rem;
}

.game-time {
    color: #666;
    font-size: 0.9em;
}

body.theme-dark .game-time {
    color: #aaa;
}

.game-screen {
    display: inline-block;
    background: var(--gr-primary);
    color: #fff;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.8em;
    margin-left: 0.5rem;
}

.game-notes {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed rgba(201, 169, 97, 0.3);
    font-size: 0.9em;
    color: #777;
}

body.theme-dark .game-notes {
    color: #aaa;
}

.game-featured-badge {
    background: var(--gr-accent);
    color: #0A0A0A;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.7em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    float: right;
}
