/*
 * «Арабская ночь» — всплывающее окно со спецменю на вечер.
 * Разметку создаёт arabian-night.js, здесь только оформление.
 * После события файл можно удалить вместе со строками подключения в index.html.
 */

:root{
    --an-gold:#e9c98a;
    --an-gold-soft:rgba(233,201,138,.55);
    --an-gold-line:rgba(233,201,138,.22);
    --an-night:#10143a;
    --an-text:#f4ead6;
    --an-muted:#b9b0c9;
}

/* ---------- Оверлей ---------- */

.an-overlay{
    position:fixed;
    inset:0;
    z-index:990; /* ниже окон блюд/кальянов (1000), чтобы они открывались поверх */

    display:flex;
    align-items:center;
    justify-content:center;
    padding:16px;

    background:rgba(5,7,22,.78);
    -webkit-backdrop-filter:blur(6px);
    backdrop-filter:blur(6px);

    opacity:0;
    visibility:hidden;
    transition:opacity .35s ease, visibility .35s;
}

.an-overlay.active{
    opacity:1;
    visibility:visible;
}

/* ---------- Карточка ---------- */

.an-card{
    position:relative;
    width:100%;
    max-width:420px;
    max-height:calc(100vh - 32px);
    max-height:calc(100dvh - 32px);

    display:flex;
    flex-direction:column;
    overflow:hidden;

    border-radius:26px;
    border:1px solid var(--an-gold-soft);
    background:
        radial-gradient(120% 50% at 50% 100%, rgba(214,150,72,.35), transparent 70%),
        linear-gradient(180deg, #11163d 0%, #191741 45%, #2a1f2a 78%, #3b2818 100%);
    box-shadow:
        0 30px 80px rgba(0,0,0,.55),
        0 0 60px rgba(233,201,138,.12);

    color:var(--an-text);
    font-family:'Comfortaa', sans-serif;

    transform:translateY(24px) scale(.97);
    transition:transform .45s cubic-bezier(.2,.8,.2,1);
}

.an-overlay.active .an-card{
    transform:none;
}

/* Тонкая золотая рамка внутри карточки */
.an-card::after{
    content:"";
    position:absolute;
    inset:7px;
    border:1px solid var(--an-gold-line);
    border-radius:20px;
    pointer-events:none;
    z-index:3;
}

/* ---------- Шапка с дворцом ---------- */

.an-hero{
    position:relative;
    flex:none;
    height:250px;
    overflow:hidden;
}

.an-hero img{
    width:100%;
    height:100%;
    object-fit:cover;
    object-position:center 62%;
    display:block;
    animation:an-zoom 18s ease-in-out infinite alternate;
}

/* Плавный переход картинки в фон карточки */
.an-hero::after{
    content:"";
    position:absolute;
    inset:0;
    background:linear-gradient(180deg,
        rgba(17,22,61,0) 35%,
        rgba(17,22,61,.55) 68%,
        #12173e 100%);
    pointer-events:none;
}

.an-stars span{
    position:absolute;
    width:3px;
    height:3px;
    border-radius:50%;
    background:#fff;
    box-shadow:0 0 6px 1px rgba(255,255,255,.8);
    opacity:0;
    animation:an-twinkle 3.2s ease-in-out infinite;
    z-index:1;
}

.an-close{
    position:absolute;
    top:16px;
    right:16px;
    z-index:4;

    width:40px;
    height:40px;
    border-radius:50%;
    border:1px solid var(--an-gold-line);
    background:rgba(8,10,30,.55);
    -webkit-backdrop-filter:blur(4px);
    backdrop-filter:blur(4px);

    color:var(--an-gold);
    font-size:26px;
    line-height:1;
    cursor:pointer;

    display:flex;
    align-items:center;
    justify-content:center;
}

.an-heading{
    position:absolute;
    left:0;
    right:0;
    bottom:6px;
    z-index:2;
    text-align:center;
    padding:0 24px;
}

.an-date{
    display:inline-block;
    font-size:11px;
    font-weight:700;
    letter-spacing:.22em;
    text-transform:uppercase;
    color:var(--an-gold);
    padding:5px 12px;
    border:1px solid var(--an-gold-line);
    border-radius:999px;
    background:rgba(8,10,30,.45);
}

.an-title{
    margin-top:8px;
    font-family:'Cormorant Garamond', 'Times New Roman', serif;
    font-weight:700;
    font-size:44px;
    line-height:1;
    letter-spacing:.01em;

    background:linear-gradient(180deg, #fff3d1 0%, #e9c98a 55%, #b88a45 100%);
    -webkit-background-clip:text;
    background-clip:text;
    color:transparent;
    filter:drop-shadow(0 2px 10px rgba(233,170,80,.45));
}

/* ---------- Список ---------- */

.an-body{
    flex:1 1 auto;
    min-height:0;
    overflow-y:auto;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior:contain;
    padding:6px 22px 8px;
}

.an-sub{
    text-align:center;
    font-family:'Cormorant Garamond', 'Times New Roman', serif;
    font-style:italic;
    font-weight:500;
    font-size:18px;
    color:var(--an-muted);
    margin:4px 0 2px;
}

/* Разделитель-орнамент: линия — звезда — линия */
.an-group-title{
    display:flex;
    align-items:center;
    gap:10px;
    margin:18px 0 6px;

    font-size:11px;
    font-weight:700;
    letter-spacing:.24em;
    text-transform:uppercase;
    color:var(--an-gold);
}

.an-group-title::before,
.an-group-title::after{
    content:"";
    flex:1;
    height:1px;
    background:linear-gradient(90deg, transparent, var(--an-gold-soft));
}

.an-group-title::after{
    background:linear-gradient(90deg, var(--an-gold-soft), transparent);
}

.an-item{
    width:100%;
    display:flex;
    align-items:center;
    gap:14px;
    padding:10px 4px;

    background:none;
    border:none;
    border-bottom:1px solid rgba(233,201,138,.10);
    color:inherit;
    font:inherit;
    text-align:left;
    cursor:pointer;

    opacity:0;
    transform:translateY(8px);
    transition:background .2s, opacity .4s ease, transform .4s ease;
}

.an-overlay.active .an-item{
    opacity:1;
    transform:none;
    transition-delay:calc(var(--i, 0) * 45ms + 150ms);
}

.an-item:last-child{
    border-bottom:none;
}

.an-item:active{
    background:rgba(233,201,138,.07);
}

/* Фото в форме арочного окна */
.an-thumb{
    flex:none;
    width:52px;
    height:62px;
    border-radius:26px 26px 8px 8px;
    overflow:hidden;
    border:1px solid var(--an-gold-soft);
    background:#1c1f45;
    box-shadow:0 4px 14px rgba(0,0,0,.35);
}

.an-thumb img{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
}

.an-item-text{
    flex:1;
    min-width:0;
    display:flex;
    flex-direction:column;
    gap:3px;
}

.an-item-name{
    font-size:16px;
    font-weight:700;
    line-height:1.25;
    color:var(--an-text);
}

.an-item-desc{
    font-size:12px;
    line-height:1.35;
    color:var(--an-muted);
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.an-item-arrow{
    flex:none;
    font-size:24px;
    color:var(--an-gold-soft);
}

/* Кальян — отдельная плашка */
.an-hookah{
    margin:16px 0 4px;
    padding:14px 16px;
    border:1px solid var(--an-gold-line);
    border-radius:16px;
    background:
        radial-gradient(80% 120% at 0% 50%, rgba(214,130,60,.22), transparent 70%),
        rgba(255,255,255,.03);
}

.an-hookah .an-thumb{
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:24px;
    background:linear-gradient(180deg, #2a2050, #4a2c1a);
}

/* ---------- Низ ---------- */

.an-footer{
    flex:none;
    padding:12px 22px 20px;
    background:linear-gradient(180deg, rgba(59,40,24,0), rgba(59,40,24,.6));
}

.an-cta{
    width:100%;
    padding:15px 18px;
    border:none;
    border-radius:14px;
    cursor:pointer;

    font-family:'Comfortaa', sans-serif;
    font-size:15px;
    font-weight:700;
    color:#2a1a08;
    background:linear-gradient(180deg, #f6dfa8 0%, #e2b867 100%);
    box-shadow:0 6px 20px rgba(226,184,103,.3), inset 0 1px 0 rgba(255,255,255,.6);
}

.an-cta:active{
    transform:scale(.98);
}

/* ---------- Кнопка «вернуться к Арабской ночи» ---------- */

.an-fab{
    position:fixed;
    left:16px;
    bottom:20px;
    z-index:900;

    display:flex;
    align-items:center;
    gap:8px;
    padding:11px 16px 11px 13px;

    border:1px solid var(--an-gold-soft);
    border-radius:999px;
    background:linear-gradient(135deg, rgba(17,22,61,.94), rgba(43,30,48,.94));
    box-shadow:0 8px 24px rgba(0,0,0,.4), 0 0 18px rgba(233,201,138,.18);
    color:var(--an-gold);

    font-family:'Comfortaa', sans-serif;
    font-size:13px;
    font-weight:700;
    cursor:pointer;

    opacity:0;
    visibility:hidden;
    transform:translateY(12px);
    transition:opacity .3s, transform .3s, visibility .3s;
}

.an-fab.show{
    opacity:1;
    visibility:visible;
    transform:none;
}

.an-fab-moon{
    font-size:16px;
    line-height:1;
    animation:an-glow 2.6s ease-in-out infinite;
}

/* ---------- Анимации ---------- */

@keyframes an-twinkle{
    0%, 100% { opacity:0; transform:scale(.6); }
    50%      { opacity:1; transform:scale(1); }
}

@keyframes an-zoom{
    from { transform:scale(1); }
    to   { transform:scale(1.08); }
}

@keyframes an-glow{
    0%, 100% { text-shadow:0 0 0 rgba(233,201,138,0); }
    50%      { text-shadow:0 0 10px rgba(233,201,138,.9); }
}

@media (prefers-reduced-motion: reduce){
    .an-hero img,
    .an-stars span,
    .an-fab-moon{ animation:none; }
    .an-stars span{ opacity:.7; }
    .an-card,
    .an-item{ transition:none; }
}

@media (max-width:360px){
    .an-title{ font-size:38px; }
    .an-hero{ height:220px; }
}
