/* themes/library/christmas.css - CHRISTMAS (rebuilt 2026-11-27)
 *
 * Brand green #1e3b2a on top (top bar, menu bar, mobile bottom bar, cart
 * drawer header) - the SAME green as the home sections Cachitos / Hallacas /
 * Holiday Meal, so the page never shows two greens side by side. Buttons in
 * the Black Friday champagne gold #CCA86A with dark text (the bright yellow
 * #ffd700 was "too aggressive"), candy-cane red #d62828 only for sale items,
 * on the normal LIGHT page.
 *
 * Kept from the July theme: falling snow, a wrapped gift that drops in and
 * lands on load, twinkling string lights under the menu, a swaying ornament
 * by the mobile nav, card corner ribbons, candy-cane scrollbar.
 * Previous look (dark pine page, full copy of the July default theme) kept as
 * christmas-original.css.
 *
 * This theme IMPORTS the live default theme and only paints on top, so every
 * component added to theme.css later keeps working here (the July copy had
 * missed the cart drawer width cap and the cart promo styles).
 *
 * Fast: only transform and opacity animate. No background-position animation
 * on a full-screen layer, no background-attachment: fixed, no animating
 * top/left, nothing moves past the right edge.
 *
 * CSS-only: every new visual is a ::before/::after on an EXISTING selector,
 * all pointer-events:none so nothing ever blocks a click.
 */
@import url("../default/theme.css");

/* ── TOKENS ─────────────────────────────────────────────────────────────── */
:root {
    --xmas-green:  #1e3b2a;   /* brand green, same as the home sections */
    --xmas-green-d:#15291d;
    --xmas-red:    #d62828;   /* sale items only */
    --xmas-red-d:  #9e1b1b;
    --xmas-gold:   #CCA86A;   /* the Black Friday gold */
    --xmas-gold-d: #b08f52;
    --nav:         #1e3b2a;   /* top bar, menu bar, mobile bottom bar */
    --accent:      #CCA86A;   /* buttons, pills */
    --accent-d:    #b08f52;
    --accent-t:    #111111;   /* dark text on gold buttons */
}

/* ── Cart drawer: never wider than the phone (the July copy missed this; the
   staff storefront's default theme still has a plain 360px) + green header
   like the top of the site ──────────────────────────────────────────────── */
.offcanvas {
    max-width: min(360px, 100vw);
    background: var(--xmas-green) !important;
}

/* ── Backdrop: the normal light page, a soft green and red glow at the top ── */
body {
    background:
        radial-gradient(ellipse 900px 380px at 15% -8%, rgba(30,59,42,0.12), transparent 60%),
        radial-gradient(ellipse 900px 380px at 85% -8%, rgba(214,40,40,0.08), transparent 60%),
        #f7f6f2;
    background-repeat: no-repeat;
    background-color: #f7f6f2;
}

/* ── Gently falling snow behind everything. A tall fixed layer of soft dots
   slides down by exactly one tile height and repeats: transform only, so the
   phone's graphics chip does the work (the July theme moved the background
   of a full-screen layer, which made the site heavy). Tile heights 130 / 130 /
   260 all divide the 260px slide, so the loop has no jump. On the light page
   the flakes are pale blue-grey so they show. ─────────────────────────────── */
body::before {
    content: "";
    position: fixed;
    left: 0; right: 0;
    top: -260px;
    height: calc(100% + 260px);
    z-index: -1;
    pointer-events: none;
    background-image:
        radial-gradient(circle, rgba(150,175,195,0.55) 1.6px, transparent 1.6px),
        radial-gradient(circle, rgba(150,175,195,0.40) 1.1px, transparent 1.1px),
        radial-gradient(circle, rgba(150,175,195,0.50) 1.3px, transparent 1.3px);
    background-size: 140px 130px, 90px 130px, 200px 260px;
    background-position: 0 0, 40px 60px, 100px 20px;
    will-change: transform;
    animation: xmas-snowfall 14s linear infinite;
}
@keyframes xmas-snowfall {
    0%   { transform: translateY(0); }
    100% { transform: translateY(260px); }
}

/* ── A wrapped gift drops in on page load, tumbles, lands with a bounce and
   slides to the right corner. Moves with transform only (the July version
   animated top/left) and stops 60px short of the right edge. ───────────── */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 46px;
    height: 40px;
    z-index: 99999;
    pointer-events: none;
    background:
        linear-gradient(90deg, transparent 42%, var(--xmas-gold) 42%, var(--xmas-gold) 58%, transparent 58%),
        linear-gradient(0deg, transparent 42%, var(--xmas-gold) 42%, var(--xmas-gold) 58%, transparent 58%),
        var(--xmas-red);
    border-radius: 3px;
    box-shadow: 0 8px 18px rgba(0,0,0,0.35);
    will-change: transform, opacity;
    animation: xmas-gift-drop 1.8s cubic-bezier(.32,.9,.35,1.15) 0.2s 1 both;
}
@keyframes xmas-gift-drop {
    0%   { transform: translate(calc(50vw - 23px), -80px) rotate(-20deg) scale(0.85); opacity: 0; }
    10%  { opacity: 1; }
    55%  { transform: translate(calc(50vw - 23px), 62vh)  rotate(360deg) scale(1.1); }
    72%  { transform: translate(calc(50vw - 23px), 58vh)  rotate(380deg) scale(0.92); }
    85%  { transform: translate(calc(50vw - 23px), 61vh)  rotate(372deg) scale(1.03); }
    100% { transform: translate(calc(100vw - 60px), 60vh) rotate(375deg) scale(0.6); opacity: 0.9; }
}

/* ── A little red ornament keeps swaying above the mobile nav ──────────── */
.bnav::after {
    content: "";
    position: absolute;
    right: 16px;
    top: -28px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(circle at 32% 28%, #ff8f8f, var(--xmas-red) 65%, #8e1616 100%);
    box-shadow: 0 3px 6px rgba(0,0,0,0.35), inset 0 0 0 1px rgba(255,255,255,0.15);
    animation: xmas-ornament-sway 2.2s ease-in-out infinite;
    transform-origin: top center;
}
.bnav::before {
    content: "";
    position: absolute;
    right: 24px;
    top: -32px;
    width: 6px;
    height: 5px;
    background: var(--xmas-gold);
    border-radius: 1px;
    pointer-events: none;
    animation: xmas-ornament-sway 2.2s ease-in-out infinite;
    transform-origin: bottom center;
}
@keyframes xmas-ornament-sway {
    0%, 100% { transform: rotate(-8deg); }
    50%      { transform: rotate(8deg); }
}
.bnav { border-top: 2px solid var(--xmas-gold); }
.bnav-item.active .bnav-icon, .bnav-item:hover .bnav-icon {
    filter: drop-shadow(0 0 5px var(--xmas-gold));
}

/* ── Twinkling string lights under the menu bar (opacity only) ──────────── */
.navbar-main { overflow: visible; }
.navbar-main::after {
    content: "";
    position: absolute;
    left: 0; right: 0;
    bottom: -9px;
    height: 9px;
    pointer-events: none;
    background-image:
        radial-gradient(circle, var(--xmas-red) 3px, transparent 3.5px),
        radial-gradient(circle, #3f8f5f 3px, transparent 3.5px),
        radial-gradient(circle, var(--xmas-gold) 3px, transparent 3.5px),
        radial-gradient(circle, #4dd0ff 3px, transparent 3.5px);
    background-size: 100px 9px;
    background-repeat: repeat-x;
    background-position: 6px 0, 31px 0, 56px 0, 81px 0;
    will-change: opacity;
    animation: xmas-lights-twinkle 1.6s ease-in-out infinite;
}
@keyframes xmas-lights-twinkle {
    0%, 100% { opacity: 0.55; }
    50%      { opacity: 1; }
}
.sbar { border-bottom: 0 !important; }   /* no line between the top bar and the menu bar, like Black Friday */

/* ── Announcement bar: dark green with gold text, tree and gift bookends ─ */
#ann {
    background: linear-gradient(180deg, #24472f, var(--xmas-green-d));
    color: var(--xmas-gold);
    font-weight: 800;
    letter-spacing: 0.3px;
}
#ann::before { content: "\01F384  "; }   /* christmas tree */
#ann::after  { content: "  \01F381"; }   /* gift */

/* ── Section titles: green pill with a gold edge ────────────────────────── */
.sec-hdr, .sec-hdr::before { background-color: var(--xmas-green) !important; }
.sec-hdr { border-right: 4px solid var(--xmas-gold); }
.sec-title { color: #fff; }
.sec-count { color: #fff; opacity: 0.85; }

/* ── Product cards: corner ribbons cycling gold / red / green, gold ring on hover ── */
.pc:hover { box-shadow: 0 0 0 2px var(--xmas-gold), 0 12px 28px rgba(204,168,106,0.25); }
.pc-img { position: relative; }
.pc-img::after {
    content: "";
    position: absolute;
    top: 0; right: 0;
    border-style: solid;
    border-width: 0 26px 26px 0;
    border-color: transparent var(--xmas-gold) transparent transparent;
    pointer-events: none;
}
.pc:nth-of-type(3n+2) .pc-img::after { border-color: transparent var(--xmas-red) transparent transparent; }
.pc:nth-of-type(3n+3) .pc-img::after { border-color: transparent var(--xmas-green) transparent transparent; }

/* ── Sale items: red, and only sale items ───────────────────────────────── */
.b-sale { background: var(--xmas-red) !important; color: #fff !important; }
.ci-tag-promo { background: var(--xmas-red); border-color: var(--xmas-red); color: #fff; }
.pc-price-row:has(.pc-was) .pc-price { color: var(--xmas-red); }
.pd-price-row:has(.pd-was) .pd-price,
.pd-info:has(.pd-on-sale) .pd-price-row .pd-price { color: var(--xmas-red); }
.pd-var-btn .pd-on-sale { color: var(--xmas-red); }
.pc-was, .pd-was, .pd-var-was, .ci-was, .cn-was { text-decoration-color: var(--xmas-red) !important; }

/* ── Account buttons: candy-cane top edge ───────────────────────────────── */
.auth-btn, .acc-claim-btn, .acc-history-more-btn {
    border-top: 4px solid transparent !important;
    border-image: repeating-linear-gradient(-45deg, var(--xmas-red) 0 6px, #fff 6px 12px) 4;
}

/* ── Reward badge: a little ornament ────────────────────────────────────── */
.reward-badge {
    background: radial-gradient(circle at 32% 28%, #ff8f8f, var(--xmas-red) 65%);
    box-shadow: 0 0 0 2px var(--xmas-gold);
}

/* ── Order confirmed: the "gift" pops open + gold ring flash ──────────────── */
.pay-success-icon, #confirm-icon, .order-confirmed-icon {
    position: relative;
    animation: xmas-unwrap-pop 0.65s ease-out;
}
@keyframes xmas-unwrap-pop {
    0%   { transform: scale(0.55) rotate(-10deg); opacity: 0; }
    60%  { transform: scale(1.2) rotate(6deg);   opacity: 1; }
    100% { transform: scale(1) rotate(0deg); }
}
.pay-success-icon::after, #confirm-icon::after, .order-confirmed-icon::after {
    content: "";
    position: absolute;
    inset: -18px;
    border-radius: 50%;
    border: 3px solid var(--xmas-gold);
    opacity: 0;
    pointer-events: none;
    animation: xmas-ring-flash 0.8s ease-out 0.1s;
}
@keyframes xmas-ring-flash {
    0%   { transform: scale(0.5); opacity: 0.9; }
    100% { transform: scale(1.55); opacity: 0; }
}

/* ── Extras: gold selection, candy-cane scrollbar ───────────────────────── */
::selection { background: var(--xmas-gold); color: #111; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--xmas-green); }
::-webkit-scrollbar-thumb {
    background: repeating-linear-gradient(-45deg, var(--xmas-red) 0 6px, #fff 6px 12px);
    border-radius: 6px;
    border: 2px solid var(--xmas-green);
}

/* ── The default theme writes the brand amber as a literal (#fbb00b) in a few
   places instead of var(--accent): repainted gold here. ─────────────────── */
.ham-btn, #ham-icon { color: var(--xmas-gold) !important; border-color: var(--xmas-gold) !important; }
.cart-n { color: var(--xmas-gold) !important; border-color: var(--xmas-gold) !important; }
.hl-tab, .hl-drawer-header { background-color: var(--xmas-gold) !important; color: #111111 !important; }

/* ── Cart icon: an IMAGE (assets/img/cart.png), so color cannot reach it - the
   image is hidden but keeps its place, and the same PNG is a stencil filled gold. ── */
.cart-btn { position: relative; }
.cart-btn > img { opacity: 0; }
.cart-btn::before {
    content: "";
    position: absolute;
    left: 50%; top: 50%;
    width: 22px; height: 22px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    background-color: var(--xmas-gold);
    -webkit-mask: url("../../assets/img/cart.png") center / contain no-repeat;
            mask: url("../../assets/img/cart.png") center / contain no-repeat;
}
