/* ==========================================================================
   ATP Besyo — Site geneli header (tek bileşen)
   Önek: .atph-   Hiçbir tema CSS'ine (app.css / styles.css) bağımlı değildir;
   iki temada da aynı görünür. Bkz. app/template/_site_header.php
   ========================================================================== */

.atph-root{
    --atph-ink:      #080b1a;
    --atph-ink-2:    #101433;
    --atph-line:     rgba(255,255,255,.12);
    --atph-txt:      rgba(255,255,255,.86);
    --atph-txt-dim:  rgba(255,255,255,.62);
    --atph-accent:   #7ff0da;
    --atph-accent-2: #c4b5fd;
    --atph-coral:    #ee4a62;
    --atph-h:        74px;

    position: relative;
    z-index: 999;
    font-family: inherit;
}
.atph-root *,
.atph-root *::before,
.atph-root *::after{ box-sizing: border-box; }

.atph-root a{ text-decoration: none; }
.atph-root ul{ list-style: none; margin: 0; padding: 0; }

/* --- Duyuru şeridi ---------------------------------------------------- */
.atph-announce{
    position: relative;
    background: linear-gradient(-45deg, #54b262, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: atphGradient 15s ease infinite;
}
@keyframes atphGradient{
    0%{ background-position: 0% 50%; }
    50%{ background-position: 100% 50%; }
    100%{ background-position: 0% 50%; }
}
.atph-announce__link{
    display: block;
    padding: 8px 44px;
    text-align: center;
    color: #fff;
    font-size: 13.5px;
    line-height: 1.45;
    font-weight: 500;
}
.atph-announce__link b{ font-weight: 700; }
.atph-announce__link:hover{ color: #fff; text-decoration: underline; }
.atph-announce__close{
    position: absolute;
    right: 8px; top: 50%;
    transform: translateY(-50%);
    width: 28px; height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    padding: 0;
    background: rgba(255,255,255,.16);
    color: #fff;
    border-radius: 8px;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    transition: background .18s ease;
}
.atph-announce__close:hover{ background: rgba(255,255,255,.3); }
.atph-root.is-announce-hidden .atph-announce{ display: none; }

/* --- Header ----------------------------------------------------------- */
/* NOT: `position: sticky` KULLANILAMAZ — eski temanın app.css'i
   `body{overflow:hidden}` tanımlıyor, bu da sticky'yi 64 sayfada tamamen
   devre dışı bırakıyor. Bunun yerine sayfa kaydırılınca JS `is-fixed`
   ekliyor ve altındaki .atph-spacer header yüksekliğini rezerve ederek
   içeriğin zıplamasını engelliyor. */
.atph-header{
    position: relative;
    z-index: 998;
    background: linear-gradient(120deg, var(--atph-ink) 0%, var(--atph-ink-2) 60%, #0a0d1f 100%);
    border-bottom: 1px solid var(--atph-line);
    transition: box-shadow .25s ease, padding .25s ease;
}
.atph-header.is-fixed{
    position: fixed;
    top: 0; left: 0; right: 0;
}
.atph-spacer{ height: 0; }

.atph-header.is-stuck{ box-shadow: 0 12px 34px rgba(0,0,0,.42); }

.atph-inner{
    max-width: 1560px;
    margin: 0 auto;
    padding: 0 22px;
    height: var(--atph-h);
    display: flex;
    align-items: center;
    gap: 18px;
}

/* --- Logo -------------------------------------------------------------- */
.atph-logo{
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
}
.atph-logo img{
    display: block;
    height: 50px;
    width: auto;
    transition: height .25s ease;
}
.atph-header.is-stuck .atph-logo img{ height: 42px; }

/* --- Masaüstü menü ----------------------------------------------------- */
.atph-nav{
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
}
.atph-menu{
    display: flex;
    align-items: center;
    gap: 2px;
}
.atph-menu > li{ position: relative; }
.atph-menu > li > a{
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 10px 13px;
    border-radius: 10px;
    font-size: 14.5px;
    font-weight: 500;
    color: var(--atph-txt);
    white-space: nowrap;
    transition: color .18s ease, background .18s ease;
}
.atph-menu > li > a:hover,
.atph-menu > li.is-active > a{
    color: #fff;
    background: rgba(255,255,255,.09);
}
.atph-menu > li.is-strong > a{ font-weight: 700; color: #fff; }
.atph-caret{
    display: inline-block;
    width: 8px; height: 8px;
    margin-left: 1px;
    border-right: 1.8px solid currentColor;
    border-bottom: 1.8px solid currentColor;
    transform: rotate(45deg) translate(-2px, -2px);
    transition: transform .2s ease;
}
.atph-menu > li:hover > a .atph-caret{ transform: rotate(225deg) translate(-3px, -3px); }

/* açılır alt menü */
.atph-sub{
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 232px;
    padding: 8px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 18px 44px rgba(6,10,26,.28);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.atph-menu > li:hover > .atph-sub,
.atph-menu > li:focus-within > .atph-sub{
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.atph-sub li a{
    display: block;
    padding: 10px 13px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 500;
    color: #33404d;
    transition: background .16s ease, color .16s ease;
}
.atph-sub li a:hover{ background: #f2f6f8; color: #0c6f60; }

/* --- Sağ taraf --------------------------------------------------------- */
.atph-actions{
    flex: 0 0 auto;
    margin-left: auto;   /* mobilde nav gizlenince butonlar sağda kalsın */
    display: flex;
    align-items: center;
    gap: 10px;
}

.atph-icon-btn{
    position: relative;
    width: 42px; height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,.22);
    background: rgba(255,255,255,.06);
    color: #fff;
    border-radius: 12px;
    cursor: pointer;
    padding: 0;
    transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.atph-icon-btn:hover{ background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.36); color: #fff; }
.atph-icon-btn svg{ width: 19px; height: 19px; display: block; }

.atph-cart-count{
    position: absolute;
    top: -6px; right: -6px;
    min-width: 20px; height: 20px;
    padding: 0 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--atph-coral);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    border-radius: 999px;
    border: 2px solid var(--atph-ink);
}

.atph-account{
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    padding: 0 16px;
    border-radius: 12px;
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.22);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    transition: background .18s ease, border-color .18s ease;
}
.atph-account:hover{ background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.4); color: #fff; }
.atph-account svg{ width: 17px; height: 17px; }
.atph-account__name{
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.atph-burger{ display: none; }

/* --- Mobil çekmece ----------------------------------------------------- */
.atph-backdrop{
    position: fixed;
    inset: 0;
    background: rgba(4,7,18,.62);
    -webkit-backdrop-filter: blur(3px);
            backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .28s ease, visibility .28s;
    z-index: 1000;
}
.atph-drawer{
    position: fixed;
    top: 0; right: 0;
    width: min(88vw, 360px);
    height: 100%;
    background: linear-gradient(170deg, var(--atph-ink) 0%, var(--atph-ink-2) 100%);
    border-left: 1px solid var(--atph-line);
    transform: translateX(100%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
body.atph-drawer-open{ overflow: hidden; }
.atph-root.is-drawer-open .atph-backdrop{ opacity: 1; visibility: visible; }
.atph-root.is-drawer-open .atph-drawer{ transform: translateX(0); }

.atph-drawer__top{
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 18px 14px;
    border-bottom: 1px solid var(--atph-line);
}
.atph-drawer__top img{ height: 44px; width: auto; display: block; }

.atph-drawer__body{
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 14px 14px 22px;
}
.atph-mmenu > li{ border-bottom: 1px solid rgba(255,255,255,.07); }
.atph-mmenu > li:last-child{ border-bottom: 0; }
.atph-mmenu > li > a,
.atph-mmenu > li > .atph-mtoggle{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 14px 8px;
    border: 0;
    background: transparent;
    text-align: left;
    font-size: 15px;
    font-weight: 500;
    color: var(--atph-txt);
    cursor: pointer;
    font-family: inherit;
}
.atph-mmenu > li > a:hover,
.atph-mmenu > li > .atph-mtoggle:hover{ color: #fff; }
.atph-mmenu > li.is-strong > a,
.atph-mmenu > li.is-strong > .atph-mtoggle{ color: #fff; font-weight: 700; }
.atph-mtoggle .atph-caret{
    transform: rotate(45deg);
    transition: transform .22s ease;
    color: var(--atph-txt-dim);
}
.atph-mmenu > li.is-open .atph-mtoggle .atph-caret{ transform: rotate(225deg) translate(-2px,-2px); }

.atph-msub{
    max-height: 0;
    overflow: hidden;
    transition: max-height .28s ease;
}
.atph-mmenu > li.is-open .atph-msub{ max-height: 460px; }
.atph-msub li a{
    display: block;
    padding: 11px 8px 11px 22px;
    font-size: 14px;
    color: var(--atph-txt-dim);
    border-left: 2px solid rgba(255,255,255,.14);
    margin-left: 8px;
}
.atph-msub li a:hover{ color: var(--atph-accent); border-left-color: var(--atph-accent); }

.atph-drawer__foot{
    flex: 0 0 auto;
    padding: 16px 18px 22px;
    border-top: 1px solid var(--atph-line);
    display: grid;
    gap: 10px;
}
.atph-drawer__btn{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    border-radius: 12px;
    font-size: 14.5px;
    font-weight: 700;
    color: #06241f;
    background: linear-gradient(120deg, #7ff0da, #1ab69d);
}
.atph-drawer__btn:hover{ color: #06241f; filter: brightness(1.06); }
.atph-drawer__btn--ghost{
    color: #fff;
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.22);
}
.atph-drawer__btn--ghost:hover{ color: #fff; background: rgba(255,255,255,.18); }

/* --- Duyarlılık --------------------------------------------------------- */
@media (max-width: 1299px){
    .atph-menu > li > a{ padding: 10px 10px; font-size: 14px; }
    .atph-inner{ padding: 0 16px; gap: 12px; }
}

@media (max-width: 1199px){
    .atph-nav{ display: none; }
    .atph-burger{ display: inline-flex; }
    .atph-account__name{ display: none; }
    .atph-account{ padding: 0; width: 42px; justify-content: center; }
}

@media (max-width: 575px){
    .atph-root{ --atph-h: 64px; }
    .atph-inner{ padding: 0 12px; gap: 8px; }
    .atph-logo img{ height: 40px; }
    .atph-header.is-stuck .atph-logo img{ height: 36px; }
    .atph-announce__link{ font-size: 12px; padding: 7px 40px; }
    .atph-icon-btn, .atph-account{ width: 40px; height: 40px; }
}

@media (prefers-reduced-motion: reduce){
    .atph-root *,
    .atph-root *::before,
    .atph-root *::after{
        animation-duration: .001ms !important;
        transition-duration: .001ms !important;
    }
}

/* --- Eski temaların kendi header kalıntılarını bastır --------------------
   (aynı sayfada iki header görünmesin) */
.edu-header.header-style-1,
.rbt-header.rbt-header-10{ display: none !important; }

/* ==========================================================================
   AÇIK (light) varyant — .atph-root.is-light
   Açık temalı sitelerde (ör. atpozelegitim.com) kullanılır. Yapı aynıdır,
   yalnızca renk katmanı değişir. Vurgu rengi --atph-brand ile verilir.
   ========================================================================== */

.atph-root.is-light{
    --atph-brand:      #d88022;
    --atph-brand-dark: #b4661a;
    --atph-l-bg:       #ffffff;
    --atph-l-ink:      #26313d;
    --atph-l-dim:      #66727f;
    --atph-l-line:     #e7edf3;
    --atph-l-hover:    #f3f7fa;
}

.atph-root.is-light .atph-header{
    background: rgba(255,255,255,.94);
    -webkit-backdrop-filter: saturate(1.6) blur(10px);
            backdrop-filter: saturate(1.6) blur(10px);
    border-bottom: 1px solid var(--atph-l-line);
}
.atph-root.is-light .atph-header.is-stuck{ box-shadow: 0 10px 30px rgba(28,44,63,.10); }

.atph-root.is-light .atph-menu > li > a{ color: var(--atph-l-ink); }
.atph-root.is-light .atph-menu > li > a:hover,
.atph-root.is-light .atph-menu > li.is-active > a{
    color: var(--atph-brand-dark);
    background: var(--atph-l-hover);
}
.atph-root.is-light .atph-menu > li.is-strong > a{ color: var(--atph-brand-dark); }

.atph-root.is-light .atph-icon-btn{
    border-color: var(--atph-l-line);
    background: #fff;
    color: var(--atph-l-ink);
}
.atph-root.is-light .atph-icon-btn:hover{
    background: var(--atph-l-hover);
    border-color: #d7e0ea;
    color: var(--atph-brand-dark);
}
.atph-root.is-light .atph-cart-count{ border-color: #fff; }

.atph-root.is-light .atph-account{
    background: var(--atph-brand);
    border-color: var(--atph-brand);
    color: #fff;
}
.atph-root.is-light .atph-account:hover{
    background: var(--atph-brand-dark);
    border-color: var(--atph-brand-dark);
    color: #fff;
}

/* Mobil çekmece — açık zemin */
.atph-root.is-light .atph-drawer{
    background: #fff;
    border-left: 1px solid var(--atph-l-line);
}
.atph-root.is-light .atph-drawer__top,
.atph-root.is-light .atph-drawer__foot{ border-color: var(--atph-l-line); }
.atph-root.is-light .atph-mmenu > li{ border-bottom-color: var(--atph-l-line); }
.atph-root.is-light .atph-mmenu > li > a,
.atph-root.is-light .atph-mmenu > li > .atph-mtoggle{ color: var(--atph-l-ink); }
.atph-root.is-light .atph-mmenu > li.is-strong > a,
.atph-root.is-light .atph-mmenu > li.is-strong > .atph-mtoggle{ color: var(--atph-brand-dark); }
.atph-root.is-light .atph-mtoggle .atph-caret{ color: var(--atph-l-dim); }
.atph-root.is-light .atph-msub li a{
    color: var(--atph-l-dim);
    border-left-color: var(--atph-l-line);
}
.atph-root.is-light .atph-msub li a:hover{
    color: var(--atph-brand-dark);
    border-left-color: var(--atph-brand);
}
.atph-root.is-light .atph-drawer__btn{
    background: var(--atph-brand);
    color: #fff;
}
.atph-root.is-light .atph-drawer__btn:hover{ color: #fff; }
.atph-root.is-light .atph-drawer__btn--ghost{
    background: #fff;
    color: var(--atph-l-ink);
    border-color: var(--atph-l-line);
}
.atph-root.is-light .atph-drawer__btn--ghost:hover{ background: var(--atph-l-hover); color: var(--atph-l-ink); }
