/* Хэллоуин (20.10.2026, переделано 26.10.2026 по замечаниям владельца). Подключается только когда оформление включено — Flavor_Halloween.
   Картинки — рисованный набор владельца (assets/images/halloween). Двигается только привидение. */
:root { --dd-hw-orange: #f39a3d; --dd-hw-ink: #2d2340; --dd-hw-ghost-w: 96px; --dd-hw-peek: -52px; --dd-hw-strip: 30px; }

/* Полоса «Hey, pumpkin!» — только на телефоне и планшете (с ПК убрана, владелец 26.10.2026).
   Она часть фиксированной шапки, поэтому там шапка выше на её высоту: отступы страниц
   считаются от этих переменных. */
@media (max-width: 1023px) { body.dd-halloween { --header-height: calc(56px + var(--dd-hw-strip)); --header-height-mobile: calc(56px + var(--dd-hw-strip)); } }
/* Мобильное меню открывается под шапкой: и верх, и высота — с учётом полосы, иначе низ меню
   (строка входа) уходил за экран (замечание владельца 26.10.2026). */
@media (max-width: 1023px) {
    .dd-halloween #mobile-menu { top: calc(56px + var(--dd-hw-strip)); height: calc(100% - 56px - var(--dd-hw-strip)); }
    .dd-halloween.admin-bar #mobile-menu { top: calc(56px + var(--dd-hw-strip) + var(--admin-bar-height)); height: calc(100% - 56px - var(--dd-hw-strip) - var(--admin-bar-height)); }
    .dd-halloween .faq-toc { top: calc(56px + var(--dd-hw-strip)); }
}
@media (min-width: 768px) and (max-width: 1023px) {
    .dd-halloween #mobile-menu { top: calc(64px + var(--dd-hw-strip)); height: calc(100% - 64px - var(--dd-hw-strip)); }
    .dd-halloween.admin-bar #mobile-menu { top: calc(64px + var(--dd-hw-strip) + var(--admin-bar-height)); height: calc(100% - 64px - var(--dd-hw-strip) - var(--admin-bar-height)); }
}
/* Нижняя граница шапки шла светлой линией под зелёной полосой — убрана там, где полоса есть. */
@media (max-width: 1023px) { .dd-halloween #header { border-bottom: 0; } }

/* 1. Тыквы у логотипа — справа от «Daddy Dread», по центру строки */
.dd-halloween .header-logo { position: relative; }
.dd-hw-pumpkins { position: absolute; top: 50%; left: 100%; margin-left: 8px; transform: translateY(-50%); pointer-events: none; line-height: 0; }
.dd-hw-pumpkins__img { display: block; width: 60px; max-width: none; height: auto; }
/* ПК: тыквы вместо картинки логотипа, надпись «Daddy Dread» остаётся (владелец 26.10.2026) — справа
   от надписи тыквы налезали на меню. Место под тыквы — отступ слева внутри ссылки; тыквы лежат
   поверх и клики пропускают, так что нажатие ведёт на главную. */
@media (min-width: 1024px) {
    .dd-halloween .header-logo a.logo img { display: none !important; }
    .dd-halloween .header-logo a.logo { min-height: 56px; padding-left: 74px; }
    .dd-halloween .dd-hw-pumpkins { left: 0; margin-left: 0; transition: opacity .2s; }
    .dd-halloween .dd-hw-pumpkins__img { width: 68px; }
    .dd-halloween .header-logo:has(a.logo:hover) .dd-hw-pumpkins { opacity: .7; }
}

/* 2. Паутинка с паучком в правом углу шапки — за содержимым, клики не перехватывает */
.dd-hw-web { position: absolute; top: 0; right: 0; z-index: -1; width: 112px; pointer-events: none; line-height: 0; }
.dd-hw-web__img { display: block; width: 100%; max-width: none; height: auto; transform: scaleX(-1); opacity: .85; }
html[data-theme="dark"] .dd-hw-web__img { filter: invert(.85); }

/* 2а. Полоса под шапкой: луна и поздравление */
.dd-hw-strip { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; height: var(--dd-hw-strip); padding: 0 16px; background: #284139; color: #F8D794; }
.dd-hw-strip__moon { display: block; width: 26px; max-width: none; height: auto; flex-shrink: 0; }
.dd-hw-strip__text { font-size: 13px; font-weight: 600; letter-spacing: .03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* С ПК полоса убрана (владелец 26.10.2026) — после правила .dd-hw-strip, иначе оно перебивает. */
@media (min-width: 1024px) { .dd-hw-strip { display: none; } }


/* 3. Поздравление в верхней полоске (компьютер) */
.dd-hw-greet { font-size: 13px; letter-spacing: .02em; white-space: nowrap; }
.dd-hw-code { margin: 0 2px; padding: 0 7px; font: inherit; font-weight: 700; color: var(--dd-hw-orange); background: none; border: 1px dashed currentColor; border-radius: 6px; cursor: pointer; }
.dd-hw-code:hover, .dd-hw-code:focus-visible { background: rgba(243, 154, 61, .12); }
@media (max-width: 1023px) { .dd-hw-greet { display: none; } }

/* 4. Привидение с табличкой — слева; справа кнопки чата и категорий.
      Сначала выходит целиком на 20 с, потом прячется за край и выглядывает половинкой; нажатие — выходит снова. */
.dd-hw-ghost { position: fixed; left: 0; bottom: 28px; z-index: 45; display: flex; align-items: flex-end; gap: 6px; transform: translateX(-130%); transition: transform .9s cubic-bezier(.2, .9, .3, 1.2); }
.dd-hw-ghost[hidden] { display: none; }
.dd-hw-ghost.is-in { transform: translateX(14px); }
.dd-hw-ghost.is-peek { transform: translateX(var(--dd-hw-peek)); }
.dd-hw-ghost.is-peek .dd-hw-ghost__body { animation: dd-hw-peek 4s ease-in-out infinite; }
.dd-hw-ghost.is-peek .dd-hw-ghost__sign { opacity: 0; pointer-events: none; }
.dd-hw-ghost__body { width: var(--dd-hw-ghost-w); height: calc(var(--dd-hw-ghost-w) * 1.125); padding: 0; background: none; border: 0; cursor: pointer; filter: drop-shadow(0 8px 14px rgba(45, 35, 64, .22)); will-change: transform; animation: dd-hw-float 3s ease-in-out infinite; -webkit-tap-highlight-color: transparent; }
.dd-hw-ghost__body svg { display: block; width: 100%; height: 100%; overflow: visible; }
.dd-hw-arm { transform-box: fill-box; transform-origin: 0 100%; animation: dd-hw-wave 1.1s ease-in-out 3.4s 4; }
.dd-hw-blush { transition: opacity .3s; }
.dd-hw-ghost.is-giggle .dd-hw-ghost__body { animation: dd-hw-giggle .45s ease-in-out 2; }
.dd-hw-ghost.is-giggle .dd-hw-blush { opacity: 1; }
.dd-hw-ghost__sign { margin-bottom: 18px; padding: 8px 12px; font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1.2; color: #fff; white-space: nowrap; background: var(--dd-hw-orange); border: 0; border-radius: 12px; box-shadow: 0 5px 12px rgba(243, 154, 61, .38); transform: rotate(-6deg); cursor: pointer; transition: opacity .3s; }
.dd-hw-ghost__sign b { letter-spacing: .04em; }
html[data-theme="dark"] .dd-hw-ghost__body { filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .5)) brightness(.94); }
@keyframes dd-hw-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes dd-hw-peek { 0%, 100% { transform: rotate(12deg) translateY(0); } 50% { transform: rotate(16deg) translateY(-4px); } }
@keyframes dd-hw-wave { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-24deg); } }
@keyframes dd-hw-giggle { 0%, 100% { transform: translateY(0) rotate(0); } 30% { transform: translateY(-12px) rotate(-6deg); } 60% { transform: translateY(-5px) rotate(5deg); } }

/* 6. Карточка-поздравление в сетке товаров */
.dd-hw-tile { position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 10px; min-height: 100%; padding: 18px 12px; overflow: hidden; text-align: center; color: #fff; list-style: none; background: radial-gradient(120% 90% at 50% 0%, #6b4f9a 0%, #3d2c5c 55%, #2a1f40 100%); border-radius: 12px; }
.dd-hw-tile::after { content: ""; position: absolute; inset: 0; background: radial-gradient(2px 2px at 20% 18%, #fff8 50%, transparent 51%), radial-gradient(2px 2px at 78% 12%, #fff6 50%, transparent 51%), radial-gradient(1.5px 1.5px at 62% 30%, #fff8 50%, transparent 51%), radial-gradient(1.5px 1.5px at 12% 42%, #fff5 50%, transparent 51%); pointer-events: none; }
.dd-hw-tile__art { position: relative; width: 100%; max-width: 220px; aspect-ratio: 1 / .8; }
.dd-hw-tile__ghost { position: absolute; left: 22%; top: 0; width: 46%; }
.dd-hw-tile__pumpkins { position: absolute; right: 2%; bottom: 0; width: 62%; height: auto; }
.dd-hw-tile__ghost svg { display: block; width: 100%; height: auto; }
.dd-hw-tile__text { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 14px; line-height: 1.3; }
.dd-hw-tile__title { font-size: 20px; line-height: 1.15; letter-spacing: .01em; }
.dd-hw-tile__code { padding: 6px 14px; font-family: inherit; font-size: 18px; font-weight: 800; letter-spacing: .08em; color: var(--dd-hw-ink); background: var(--dd-hw-orange); border: 0; border-radius: 10px; box-shadow: 0 4px 12px rgba(0, 0, 0, .25); cursor: pointer; }
.dd-hw-tile small { font-size: 12px; opacity: .85; }

/* «Скопировано» */
.dd-hw-toast { position: fixed; left: 50%; bottom: 110px; z-index: 100000; padding: 9px 16px; font-size: 14px; color: #fff; background: var(--dd-hw-ink); border-radius: 999px; opacity: 0; transform: translate(-50%, 10px); transition: opacity .25s, transform .25s; pointer-events: none; }
.dd-hw-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* Телефон */
@media (max-width: 767px) {
    :root { --dd-hw-ghost-w: 78px; --dd-hw-peek: -42px; }
    .dd-hw-web { width: 66px; }
    .dd-hw-pumpkins { margin-left: 6px; }
    .dd-hw-pumpkins__img { width: 46px; }
    .dd-hw-strip__text { font-size: 12.5px; }
    .dd-hw-ghost { bottom: 78px; }
    .dd-hw-ghost__sign { font-size: 13px; padding: 7px 10px; }
    .dd-hw-tile { padding: 14px 8px; gap: 8px; }
    .dd-hw-tile__title { font-size: 17px; }
    .dd-hw-tile__text { font-size: 12.5px; }
    .dd-hw-tile__code { font-size: 16px; padding: 5px 12px; }
}

/* «Уменьшить движение»: привидение не плавает и не выезжает */
@media (prefers-reduced-motion: reduce) {
    .dd-hw-ghost__body, .dd-hw-arm { animation: none !important; }
    .dd-hw-ghost, .dd-hw-toast { transition: none !important; }
}
