/* ================================================================
   Halloween Theme Preview — Caister Costumes
   Loaded only when browsing under /preview/halloween/. Overrides the
   site's CSS custom properties (so most components re-skin for free)
   plus a handful of targeted rules for spots that use hardcoded
   colors in home.css, and some decorative Halloween flourishes.
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Creepster&family=Nunito:wght@400;600;700;800&family=Quicksand:wght@500;600;700&display=swap');

body.theme-halloween {
    /* ---- Brand palette: pumpkin orange / witch purple / slime green ---- */
    --primary-color: #ff7518;
    --secondary-color: #8e2de2;
    --accent-color: #9dff3c;

    /* ---- Dark backgrounds ---- */
    --primary-bg: #100a14;
    --secondary-bg: #1b1220;
    --tertiary-bg: #211527;
    --primary-text: #f6e9d8;
    --secondary-text: #c6b3d9;
    --border-color: #4a2e5c;

    --font-heading: 'Creepster', 'Quicksand', cursive;

    --shadow-sm: 0 2px 10px rgba(255, 117, 24, 0.25);
    --shadow-md: 0 4px 24px rgba(142, 45, 226, 0.35);
    --shadow-lg: 0 10px 45px rgba(255, 117, 24, 0.3);

    background-color: var(--primary-bg);
    position: relative;
}

/* Headings get the display font, but keep it readable at small sizes -
   only the big hero/section titles go full Creepster. */
body.theme-halloween h1,
body.theme-halloween .section-header h2,
body.theme-halloween .cta-banner h2,
body.theme-halloween .products-hero h1 {
    font-family: var(--font-heading);
    letter-spacing: 0.5px;
    text-shadow: 0 0 18px rgba(255, 117, 24, 0.45);
}

body.theme-halloween h3,
body.theme-halloween h4,
body.theme-halloween .footer-brand .logo-text {
    font-family: 'Quicksand', sans-serif;
}

/* ---------------- Preview ribbon ---------------- */
.halloween-preview-ribbon {
    background: linear-gradient(90deg, #ff7518, #8e2de2);
    color: #fff5e6;
    text-align: center;
    font-weight: 700;
    font-family: 'Quicksand', sans-serif;
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
    position: relative;
    z-index: 2000;
    letter-spacing: 0.3px;
}

.halloween-preview-ribbon a {
    color: #fff;
    text-decoration: underline;
    font-weight: 800;
}

.halloween-preview-ribbon-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.4rem 0.9rem;
}

.halloween-bg-toggle {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    padding: 0.25rem 0.8rem;
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.halloween-bg-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ---------------- Header / nav ---------------- */
body.theme-halloween header {
    background-color: var(--secondary-bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

body.theme-halloween .nav-links a {
    color: var(--primary-text);
}

body.theme-halloween .nav-links a:hover {
    color: var(--primary-color);
}

body.theme-halloween .nav-search input {
    background: var(--tertiary-bg);
    color: var(--primary-text);
    border-color: var(--border-color);
}

body.theme-halloween .nav-search input::placeholder {
    color: var(--secondary-text);
}

body.theme-halloween .login-btn,
body.theme-halloween .logout-link {
    color: var(--primary-text);
}

/* The logo artwork has a transparent background with black lettering
   in the middle - fine on the light site, invisible on this dark navbar.
   Rather than touch the shared logo file or patch a solid shape behind
   it, stack a few blurred drop-shadows that trace the artwork's own
   opaque pixels (letters included) in cream, giving the black text a
   soft halo it can be read against - no hard-edged sticker shape. */
body.theme-halloween .logo {
    filter:
        drop-shadow(0 0 2px #fff8ec)
        drop-shadow(0 0 2px #fff8ec)
        drop-shadow(0 0 5px rgba(255, 248, 236, 0.8));
}

body.theme-halloween .basket-count {
    background: var(--primary-color);
}

/* ---------------- Buttons ---------------- */
body.theme-halloween .btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #ff9d3d);
    box-shadow: 0 4px 15px rgba(255, 117, 24, 0.45);
}

body.theme-halloween .btn-primary:hover {
    box-shadow: 0 8px 25px rgba(255, 117, 24, 0.55);
}

body.theme-halloween .btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color), #b06ffb);
    color: #fff;
    box-shadow: 0 4px 15px rgba(142, 45, 226, 0.45);
}

body.theme-halloween .btn-secondary:hover {
    color: #fff;
    box-shadow: 0 8px 25px rgba(142, 45, 226, 0.55);
}

body.theme-halloween .btn-outline {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* ---------------- Hero ---------------- */
body.theme-halloween .hero {
    background: radial-gradient(ellipse at 20% 0%, rgba(142, 45, 226, 0.25) 0%, transparent 55%),
                radial-gradient(ellipse at 85% 90%, rgba(255, 117, 24, 0.2) 0%, transparent 55%),
                var(--primary-bg);
}

body.theme-halloween .hero::before {
    background: radial-gradient(circle, rgba(255, 117, 24, 0.18) 0%, transparent 70%);
}

body.theme-halloween .hero::after {
    background: radial-gradient(circle, rgba(142, 45, 226, 0.22) 0%, transparent 70%);
}

body.theme-halloween .hero-badge {
    background: linear-gradient(135deg, var(--secondary-color), #b06ffb);
    color: #fff;
}

body.theme-halloween .hero-image-container {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

body.theme-halloween .hero-floating {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
}

body.theme-halloween .floating-text {
    color: var(--primary-text);
}

/* ---------------- Sections / cards ---------------- */
body.theme-halloween .section-alt {
    background: var(--tertiary-bg);
}

body.theme-halloween .section-header h2::after {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

body.theme-halloween .feature-card,
body.theme-halloween .product-card {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
}

body.theme-halloween .feature-icon,
body.theme-halloween .product-image {
    background: linear-gradient(135deg, var(--tertiary-bg), #2a1a35);
}

body.theme-halloween .feature-card:hover .feature-icon {
    background: linear-gradient(135deg, var(--secondary-color), #b06ffb);
}

body.theme-halloween .product-overlay {
    background: rgba(142, 45, 226, 0.85);
}

body.theme-halloween .gallery-overlay {
    background: linear-gradient(135deg, rgba(255, 117, 24, 0.55), rgba(142, 45, 226, 0.55));
}

/* ---------------- CTA banner ---------------- */
body.theme-halloween .cta-banner {
    background: linear-gradient(135deg, var(--secondary-color), #5a1a99);
}

/* ---------------- World Book Day banner -> keep but tone to theme ---------------- */
body.theme-halloween .wbd-facebook-section {
    background: linear-gradient(135deg, #2b0f45 0%, #4a1666 100%);
}

/* ---------------- Footer ---------------- */
body.theme-halloween footer {
    background: #0a0610;
    border-top: 1px solid var(--border-color);
}

/* ---------------- Forms & alerts ---------------- */
body.theme-halloween .form-group input,
body.theme-halloween .form-group select,
body.theme-halloween .form-group textarea {
    background: var(--tertiary-bg);
    color: var(--primary-text);
    border-color: var(--border-color);
}

body.theme-halloween .form-group label {
    color: var(--primary-text);
}

body.theme-halloween .alert-success {
    background: rgba(157, 255, 60, 0.12);
    color: #9dff3c;
    border-color: rgba(157, 255, 60, 0.35);
}

body.theme-halloween .alert-error {
    background: rgba(255, 87, 87, 0.12);
    color: #ff8080;
    border-color: rgba(255, 87, 87, 0.35);
}

body.theme-halloween .alert-info {
    background: rgba(176, 111, 251, 0.12);
    color: #c9a3ff;
    border-color: rgba(176, 111, 251, 0.35);
}

/* ---------------- Products / breadcrumb / badges ---------------- */
body.theme-halloween .products-hero {
    background: radial-gradient(ellipse at 50% 0%, rgba(142, 45, 226, 0.3) 0%, transparent 60%), var(--primary-bg);
}

body.theme-halloween .breadcrumb {
    background: var(--tertiary-bg);
    border-bottom: 1px solid var(--border-color);
}

body.theme-halloween .stock-status.in-stock {
    background: rgba(157, 255, 60, 0.12);
    color: #9dff3c;
}

body.theme-halloween .stock-status.out-of-stock {
    background: rgba(255, 117, 24, 0.15);
    color: var(--primary-color);
}

/* ---------------- Lightbox stays dark by default; just tie the accent in ---------------- */
body.theme-halloween .lightbox-close:hover {
    color: var(--primary-color);
}

/* ================================================================
   Light background variant - same orange/purple palette, swapped
   onto a pale backdrop instead of black. Toggled by the "Try light
   background" button in the preview ribbon (see base.html), which
   just adds/removes this class - every rule above still applies via
   the CSS variables, this block only needs to override the values
   that assumed a dark backdrop.
   ================================================================ */
body.theme-halloween.theme-halloween-light {
    --primary-bg: #fffaf5;
    --secondary-bg: #ffffff;
    --tertiary-bg: #fdf1e3;
    --primary-text: #2c1b3d;
    --secondary-text: #6c5a78;
    --border-color: #f2ddc2;

    --shadow-sm: 0 2px 10px rgba(255, 117, 24, 0.12);
    --shadow-md: 0 4px 24px rgba(142, 45, 226, 0.14);
    --shadow-lg: 0 10px 40px rgba(255, 117, 24, 0.16);
}

body.theme-halloween.theme-halloween-light h1,
body.theme-halloween.theme-halloween-light .section-header h2,
body.theme-halloween.theme-halloween-light .cta-banner h2,
body.theme-halloween.theme-halloween-light .products-hero h1 {
    text-shadow: 0 0 10px rgba(255, 117, 24, 0.18);
}

body.theme-halloween.theme-halloween-light header {
    box-shadow: 0 2px 16px rgba(43, 15, 69, 0.1);
}

body.theme-halloween.theme-halloween-light .logo {
    /* Black lettering already reads fine on a pale navbar - drop the
       cream glow used to rescue it against the dark header. */
    filter: none;
}

body.theme-halloween.theme-halloween-light .nav-search input {
    color: var(--primary-text);
}

body.theme-halloween.theme-halloween-light .hero {
    background: radial-gradient(ellipse at 20% 0%, rgba(142, 45, 226, 0.1) 0%, transparent 55%),
                radial-gradient(ellipse at 85% 90%, rgba(255, 117, 24, 0.1) 0%, transparent 55%),
                var(--primary-bg);
}

body.theme-halloween.theme-halloween-light .hero::before {
    background: radial-gradient(circle, rgba(255, 117, 24, 0.1) 0%, transparent 70%);
}

body.theme-halloween.theme-halloween-light .hero::after {
    background: radial-gradient(circle, rgba(142, 45, 226, 0.12) 0%, transparent 70%);
}

body.theme-halloween.theme-halloween-light .feature-icon,
body.theme-halloween.theme-halloween-light .product-image {
    background: linear-gradient(135deg, var(--tertiary-bg), #ffffff);
}

body.theme-halloween.theme-halloween-light .products-hero {
    background: radial-gradient(ellipse at 50% 0%, rgba(142, 45, 226, 0.12) 0%, transparent 60%), var(--primary-bg);
}

/* Footer stays a deep plum rather than turning white - matches how
   the footer is dark on the live site regardless of the page theme. */
body.theme-halloween.theme-halloween-light footer {
    background: #241633;
}

body.theme-halloween.theme-halloween-light .stock-status.in-stock {
    background: rgba(46, 125, 50, 0.1);
    color: #2e7d32;
}

body.theme-halloween.theme-halloween-light .stock-status.out-of-stock {
    background: rgba(255, 117, 24, 0.12);
    color: #c65a12;
}

body.theme-halloween.theme-halloween-light .alert-success {
    background: #e6f7e6;
    color: #1e7d1e;
    border-color: #bfe8bf;
}

body.theme-halloween.theme-halloween-light .alert-error {
    background: #fdeaea;
    color: #b3261e;
    border-color: #f5c6c6;
}

body.theme-halloween.theme-halloween-light .alert-info {
    background: #f1e6fb;
    color: #6a2ea3;
    border-color: #ddc4f2;
}

@media (max-width: 768px) {
    .halloween-preview-ribbon {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }
}
