/*
 * WindVanilla – additions on top of the Cobble theme (generic.css / shared.css).
 * Everything the original theme did not ship (basket extras, order page, error page,
 * inline pixel icons, ...) and the text-contrast fixes for the bright #00D8FF accent.
 */

/* ── Inline pixel icons (replace the Material Design icon font) ───────────── */
.px-icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    flex-shrink: 0;
    vertical-align: -0.125em;
}
.px-icon--btn { width: 16px; height: 16px; }
.px-icon--lg { width: 40px; height: 40px; }
.px-icon--chevron { width: 12px; height: 8px; transition: transform 0.2s ease; }
.px-check { width: 14px; height: 12px; color: var(--success); }
.px-cross { width: 12px; height: 12px; color: var(--danger); }
.nav-chevron .px-icon, .px-chevron { width: 12px; height: 8px; transition: transform 0.2s ease; }
.ranktable-card.open .px-chevron { transform: rotate(180deg); }
.basket-refresh .px-icon { width: 16px; height: 16px; }
.basket-refresh.spinning .px-icon { animation: spin 0.5s ease infinite; }
.cart-empty > .px-icon { color: var(--text-tertiary); }
.category-title > .px-icon { width: 18px; height: 18px; }

/* ── Text on the primary colour ───────────────────────────────────────────
   The theme prints white text on its (darker) blue. #00D8FF is bright, so the
   text on every filled primary surface uses --color-primary-text instead. */
.button--primary,
.button--primary:hover,
.button--primary:focus,
.button--success,
.button--success:hover,
.button--success:focus,
.button--checkout,
.button--checkout:hover,
.button--checkout:focus,
.button--primary .px-icon,
.button--checkout .px-icon {
    color: var(--color-primary-text, #031a20);
}
.badge-primary,
.nav-tag,
.category-title,
.category-title *,
.package-expiry,
.login-edition.active,
.patron-tier__header,
.stacked-tier.active .stacked-tier__inner,
.stacked-tier.active .stacked-tier__inner *,
.cart-empty__cat:hover,
.vote-site__number-inner,
.sb-announcement,
.sb-announcement * {
    color: var(--color-primary-text, #031a20);
}
.pkg-btn--add .pkg-btn__inner,
.pkg-btn--add .pkg-btn__inner * {
    color: var(--color-primary-text, #031a20);
}
.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus {
    color: var(--color-primary-text, #031a20);
}
.cart-btn .profile__name,
.cart-btn .profile__value,
.cart-badge-mobile .header-badge__text,
.vote-site__number *,
.panel-primary,
.panel-primary *,
.btn-primary,
.store-product-options .actions .btn-primary {
    color: var(--color-primary-text, #031a20) !important;
}
.cart-btn .profile__value { opacity: 0.75; }

/* Secondary button */
.button--secondary {
    --btn-border: var(--border);
    --btn-bg: var(--surface-raised);
    color: var(--white);
    height: 44px;
    padding: 0 20px;
}
.button--secondary:hover { filter: brightness(1.25); }

/* ── Basket additions ─────────────────────────────────────────────────────── */
.basket-item__meta {
    margin-top: 4px;
    font-size: 0.75em;
    line-height: 1.4;
    color: var(--text-tertiary);
    overflow-wrap: anywhere;
}
.basket-item__left { padding-right: 12px; }
.basket-item__qty-btn { text-decoration: none; user-select: none; }

.basket-promo { display: flex; flex-direction: column; }
.basket-promo__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 4px 0;
    background: none;
    border: 0;
    cursor: pointer;
    color: var(--text-secondary);
    font: inherit;
    font-size: 0.85em;
    text-align: left;
}
.basket-promo__toggle:hover { color: var(--white); }
.basket-promo.open .px-icon--chevron { transform: rotate(180deg); }
.basket-promo__body { display: none; padding-top: 8px; }
.basket-promo.open .basket-promo__body { display: block; }
.basket-promo__form { display: flex; gap: 8px; }
.basket-promo__input { flex: 1 1 auto; min-width: 0; height: 44px; text-transform: uppercase; }
.basket-promo__apply { flex-shrink: 0; }

.basket-lines { display: flex; flex-direction: column; gap: 6px; padding: 4px 0; }
.basket-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.85em;
    color: var(--text-secondary);
}
.basket-line > span:last-child { white-space: nowrap; color: var(--white); }
.basket-line b { color: var(--white); font-weight: 600; }
.basket-line em { font-style: normal; color: var(--text-tertiary); margin-left: 4px; }
.basket-line--discount > span:last-child { color: var(--success); }
.basket-line__x {
    background: none;
    border: 0;
    padding: 0 4px;
    margin-left: 4px;
    font-size: 16px;
    line-height: 1;
    color: var(--text-tertiary);
    cursor: pointer;
}
.basket-line__x:hover { color: var(--danger); }

.basket-pulse { animation: basket-pulse 0.5s ease; }
@keyframes basket-pulse {
    0% { transform: scale(1); }
    40% { transform: scale(1.12); }
    100% { transform: scale(1); }
}

/* ── Forms ────────────────────────────────────────────────────────────────── */
.field-hint { display: block; margin-top: 6px; font-size: 12px; color: var(--text-tertiary); }
.store-form-options .form-group { margin-bottom: 16px; }
.store-form-options label { display: block; margin-bottom: 6px; color: var(--white); font-weight: 600; }
.store-form-options select.input { width: 100%; }
@media (max-width: 767px) {
    input.input, select.input, textarea.input { font-size: 16px; }
}

/* ── Order page ───────────────────────────────────────────────────────────── */
.order-page .page-header { flex-wrap: wrap; gap: 12px; }
.order-status {
    display: inline-block;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: var(--border);
    color: var(--white);
    clip-path: var(--clip-2);
}
.order-status--pending { background: var(--warning); color: #201500; }
.order-status--paid { background: var(--color-primary); color: var(--color-primary-text, #031a20); }
.order-status--delivered { background: var(--success); color: #04200f; }
.order-status--cancelled, .order-status--refunded { background: var(--danger); color: #fff; }

.order-notice {
    margin: 0 0 20px;
    padding: 16px 20px;
    background: rgba(245, 158, 11, 0.08);
    border-left: 4px solid var(--warning);
    color: var(--text-primary);
    line-height: 1.6;
}
.order-notice--ok { background: rgba(34, 197, 94, 0.08); border-left-color: var(--success); }
.order-notice__ref { margin-top: 10px; color: var(--text-secondary); }
.order-notice__ref strong { color: var(--white); font-size: 1.1em; letter-spacing: 0.05em; user-select: all; }

.order-items { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    background: var(--surface-raised);
    border: 2px solid var(--border);
}
.order-item__info { min-width: 0; }
.order-item__name { color: var(--white); font-weight: 600; }
.order-item__qty { color: var(--text-secondary); font-weight: 500; }
.order-item__meta { margin-top: 2px; font-size: 12px; color: var(--text-tertiary); }
.order-item__price { color: var(--white); font-weight: 600; white-space: nowrap; }
.order-item__price small, .order-totals small { color: var(--text-tertiary); font-weight: 500; }

.order-totals { margin-left: auto; max-width: 360px; display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.order-totals__row { display: flex; justify-content: space-between; gap: 24px; color: var(--text-secondary); }
.order-totals__row span:last-child { color: var(--white); }
.order-totals__row--total {
    padding-top: 10px;
    border-top: 2px solid var(--border);
    font-size: 1.15em;
    font-weight: 700;
    color: var(--white);
}
.order-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.order-actions .button { height: 48px; }

/* ── Error page ───────────────────────────────────────────────────────────── */
.error-page { padding: 56px 24px; text-align: center; }
.error-page__code {
    font-size: clamp(64px, 14vw, 120px);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
    color: var(--color-primary);
    text-shadow: 0 0 40px color-mix(in srgb, var(--color-primary) 35%, transparent);
}
.error-page__title { margin: 12px 0 8px; color: var(--white); font-size: 24px; }
.error-page__text { max-width: 460px; margin: 0 auto 24px; color: var(--text-secondary); }
.error-page__btn { min-width: 200px; }

/* ── Login popup / bedrock notice ─────────────────────────────────────────── */
.giftcard-menu-back { transition: opacity 0.2s ease; }

/* ── Grid images: keep aspect ratio inside cards ──────────────────────────── */
.img-responsive { max-width: 100%; height: auto; }

/* ── Snow (Christmas mode) ────────────────────────────────────────────────── */
.snow { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.snow > i {
    position: absolute;
    top: -10px;
    width: var(--s, 4px);
    height: var(--s, 4px);
    background: #fff;
    opacity: var(--o, 0.7);
    animation: snowfall var(--d, 10s) linear var(--delay, 0s) infinite;
}
@keyframes snowfall {
    to { transform: translate3d(var(--x, 20px), 105vh, 0); }
}

/* ── Footer extras ────────────────────────────────────────────────────────── */
.footer-legal { display: flex; flex-wrap: wrap; gap: 16px; }

/* ── Accessibility ────────────────────────────────────────────────────────── */
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
    .snow, .particles-container { display: none; }
    * { scroll-behavior: auto !important; }
}

/* ── Rank table: the columns are narrow, so keep the buttons compact ──────── */
.ranktable-rank .pkg-actions { margin: 0; width: 100%; }
.ranktable-rank .pkg-btn__inner { padding: 0 8px; font-size: 12px; }
.ranktable-rank .pkg-btn.wide { min-width: 0; }
.ranktable-desktop[data-many] .pkg-btn--info { display: none; }

/* ── Misc fixes ───────────────────────────────────────────────────────────── */
.basket-line__x { display: inline-block; }
.basket-line > span:first-child { min-width: 0; }
/* keep toasts clear of the open basket drawer */
@media (min-width: 768px) {
    body:has(.basket-popup) .toaster { right: 520px; }
}
@media (max-width: 767px) {
    /* the basket covers the whole screen on phones – show toasts at the top so they never hide the checkout button */
    body:has(.basket-popup) .toaster { top: 12px; bottom: auto; height: auto; flex-direction: column; }
}
