/*
Theme Name: Crackle Candy Co
Theme URI: https://bennettasmith.com
Author: Crackle Candy Co.
Description: Custom store theme for Crackle Candy Co. — freeze dried candy, Katy TX. WooCommerce-ready. Fun, bold, sticker-style design with movement. Brand: red #9b0406, blue #08197a.
Version: 0.9.8
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: crackle-candy-co
*/

:root {
  --ccc-red: #9b0406;
  --ccc-blue: #08197a;
  --ccc-yellow: #ffc400;
  --ccc-lime: #35c759;
  --ccc-orange: #ff7a00;
  --ccc-pink: #ff3d8a;
  --ccc-sky: #29b6ff;
  --ccc-white: #ffffff;
  --ccc-shadow: 6px 6px 0 var(--ccc-blue);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: "Arial Rounded MT Bold", "Helvetica Rounded", Arial, sans-serif; color: var(--ccc-blue); background: var(--ccc-white); overflow-x: hidden; }
a { color: var(--ccc-blue); }

/* ---------- Motion ---------- */
@keyframes ccc-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes ccc-float { 0%,100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-16px) rotate(10deg); } }
@keyframes ccc-wiggle { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-2.5deg) scale(1.04); } 75% { transform: rotate(2.5deg) scale(1.04); } }
@keyframes ccc-pulse { 0%,100% { transform: scale(1) rotate(3deg); } 50% { transform: scale(1.12) rotate(3deg); } }
@keyframes ccc-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes ccc-spin-slow { from { transform: translate(-50%, -50%) rotate(0deg); } to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes ccc-pop-in { 0% { opacity: 0; transform: scale(.6); } 70% { transform: scale(1.06); } 100% { opacity: 1; transform: scale(1); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}

/* Scroll-reveal (JS adds .ccc-in; visible by default without JS) */
.ccc-reveal { transition: opacity .5s ease, transform .5s cubic-bezier(.2,1.6,.4,1); }
.js .ccc-reveal { opacity: 0; transform: translateY(28px) scale(.97); }
.js .ccc-reveal.ccc-in { opacity: 1; transform: none; }

/* ---------- Announcement marquee ---------- */
.ccc-announce { background: var(--ccc-red); color: #fff; overflow: hidden; white-space: nowrap; padding: 9px 0; font-weight: 800; }
.ccc-marquee-track { display: inline-flex; gap: 0; animation: ccc-marquee 22s linear infinite; will-change: transform; }
.ccc-marquee-track span { padding: 0 28px; }

/* ---------- Header ---------- */
.ccc-header { display: flex; align-items: center; gap: 16px; padding: 12px 20px; border-bottom: 5px solid var(--ccc-blue); flex-wrap: wrap; background: #fff; position: sticky; top: 0; z-index: 50; }
.ccc-header .ccc-logo img { height: 64px; width: auto; display: block; }
.ccc-header .ccc-logo:hover img { animation: ccc-wiggle .45s ease-in-out; }
.ccc-nav { margin-left: auto; }
.ccc-nav ul { list-style: none; display: flex; gap: 10px; margin: 0; padding: 0; flex-wrap: wrap; }
.ccc-nav a { text-decoration: none; font-weight: 800; padding: 8px 14px; border-radius: 999px; border: 3px solid transparent; transition: transform .15s ease, background .15s ease, border-color .15s ease; display: inline-block; }
.ccc-nav a:hover { background: var(--ccc-yellow); border-color: var(--ccc-blue); transform: translateY(-2px) rotate(-1deg); }

/* ---------- Hero ---------- */
.ccc-hero { text-align: center; padding: 48px 20px 40px; position: relative; overflow: hidden; background:
  radial-gradient(circle at 12% 18%, rgba(255,196,0,.55), transparent 34%),
  radial-gradient(circle at 88% 12%, rgba(255,61,138,.45), transparent 36%),
  radial-gradient(circle at 85% 88%, rgba(41,182,255,.45), transparent 40%),
  radial-gradient(circle at 8% 85%, rgba(53,199,89,.40), transparent 36%),
  radial-gradient(circle at 50% 55%, rgba(255,122,0,.28), transparent 55%), #fff; }
.ccc-hero > * { position: relative; z-index: 2; }
/* Rotating candy-color sunburst rays behind the hero photo = color explosion */
.ccc-hero::before { content: ""; position: absolute; z-index: 0; left: 50%; top: 56%; width: 150vmax; height: 150vmax; transform: translate(-50%, -50%); background: repeating-conic-gradient(from 0deg, rgba(155,4,6,.10) 0deg 10deg, rgba(255,196,0,.12) 10deg 20deg, rgba(41,182,255,.10) 20deg 30deg, rgba(53,199,89,.10) 30deg 40deg, rgba(255,61,138,.10) 40deg 50deg, rgba(255,122,0,.10) 50deg 60deg); animation: ccc-spin-slow 70s linear infinite; pointer-events: none; }
.ccc-hero::after { content: ""; position: absolute; z-index: 1; left: 50%; top: 56%; width: 620px; height: 620px; max-width: 120vw; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.95) 0%, rgba(255,255,255,.55) 45%, rgba(255,255,255,0) 72%); pointer-events: none; }
.ccc-hero h1 { font-size: clamp(2rem, 6vw, 3.2rem); margin: 0 0 8px; letter-spacing: .5px; }
.ccc-hero h1 .ccc-pop-word { color: var(--ccc-red); display: inline-block; animation: ccc-bob 2.4s ease-in-out infinite; }
.ccc-hero .ccc-sub { font-size: 1.15rem; margin: 0 0 22px; }
.ccc-hero-photo { max-width: 560px; width: 100%; height: auto; border-radius: 20px; border: 4px solid var(--ccc-blue); box-shadow: var(--ccc-shadow); animation: ccc-bob 5s ease-in-out infinite; }
.ccc-dot { position: absolute; border-radius: 50%; border: 3px solid var(--ccc-blue); animation: ccc-float 4s ease-in-out infinite; pointer-events: none; }
.ccc-dot.d1 { width: 34px; height: 34px; background: var(--ccc-yellow); top: 12%; left: 6%; }
.ccc-dot.d2 { width: 24px; height: 24px; background: var(--ccc-pink); top: 20%; right: 8%; animation-delay: .7s; }
.ccc-dot.d3 { width: 28px; height: 28px; background: var(--ccc-lime); bottom: 16%; left: 10%; animation-delay: 1.2s; }
.ccc-dot.d4 { width: 20px; height: 20px; background: var(--ccc-orange); bottom: 24%; right: 12%; animation-delay: .4s; }
.ccc-dot.d5 { width: 16px; height: 16px; background: var(--ccc-sky); top: 55%; left: 3%; animation-delay: 1.6s; }

/* ---------- Buttons ---------- */
.ccc-btn { display: inline-block; background: var(--ccc-blue); color: #fff !important; padding: 13px 28px; border-radius: 999px; text-decoration: none; font-weight: 800; border: 3px solid var(--ccc-blue); box-shadow: 4px 4px 0 var(--ccc-red); transition: transform .15s cubic-bezier(.2,1.8,.4,1), box-shadow .15s ease, background .15s ease; }
.ccc-btn:hover { background: var(--ccc-red); transform: translateY(-3px) scale(1.05) rotate(-1deg); box-shadow: 7px 7px 0 var(--ccc-blue); }
.ccc-btn:active { transform: translateY(1px) scale(.98); box-shadow: 2px 2px 0 var(--ccc-blue); }
.ccc-btn.ccc-btn-yellow { background: var(--ccc-yellow); color: var(--ccc-blue) !important; box-shadow: 4px 4px 0 var(--ccc-blue); }
.ccc-btn.ccc-btn-yellow:hover { background: var(--ccc-orange); }

/* ---------- Sections & cards ---------- */
.ccc-section { max-width: 1080px; margin: 0 auto; padding: 40px 20px; }
.ccc-section h2 { text-align: center; margin-top: 0; font-size: clamp(1.5rem, 4vw, 2.1rem); }
.ccc-band { max-width: none; }
.ccc-band .ccc-inner { max-width: 1080px; margin: 0 auto; }
.ccc-band-yellow { background: var(--ccc-yellow); border-top: 5px solid var(--ccc-blue); border-bottom: 5px solid var(--ccc-blue); }
.ccc-band-sky { background: #e3f4ff; border-top: 5px solid var(--ccc-blue); border-bottom: 5px solid var(--ccc-blue); }
.ccc-band-pink { background: #ffe3ef; border-top: 5px solid var(--ccc-blue); border-bottom: 5px solid var(--ccc-blue); }

.ccc-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.ccc-card { background: #fff; border: 3px solid var(--ccc-blue); border-radius: 18px; padding: 18px; text-align: center; position: relative; box-shadow: var(--ccc-shadow); transition: transform .2s cubic-bezier(.2,1.6,.4,1), box-shadow .2s ease; }
.ccc-card:hover { transform: translateY(-8px) rotate(-1deg) scale(1.02); box-shadow: 10px 12px 0 var(--ccc-blue); }
.ccc-card img { max-width: 100%; height: auto; border-radius: 12px; }
.ccc-card.tilt-r:hover { transform: translateY(-8px) rotate(1.2deg) scale(1.02); }
.ccc-price { color: var(--ccc-red); font-size: 1.6rem; font-weight: 800; }
.ccc-badge { position: absolute; top: -14px; right: -8px; background: var(--ccc-red); color: #fff; padding: 6px 14px; border-radius: 999px; font-size: .82rem; font-weight: 800; border: 3px solid var(--ccc-blue); box-shadow: 3px 3px 0 var(--ccc-blue); animation: ccc-pulse 1.6s ease-in-out infinite; z-index: 2; }
.ccc-note { text-align: center; font-weight: 700; }

/* ---------- Footer ---------- */
.ccc-footer { background: var(--ccc-blue); color: #fff; text-align: center; padding: 32px 20px; margin-top: 48px; border-top: 6px solid var(--ccc-red); }
.ccc-footer a { color: #fff; }
.ccc-footer img { height: 52px; width: auto; background: #fff; border-radius: 10px; padding: 4px; transition: transform .2s ease; }
.ccc-footer img:hover { animation: ccc-wiggle .45s ease-in-out; }

.ccc-content { max-width: 860px; margin: 0 auto; padding: 32px 20px; }

/* ---------- Snake game (pop-up) ---------- */
.ccc-modal { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; padding: 16px; }
.ccc-modal.ccc-open { display: flex; }
.ccc-modal-backdrop { position: absolute; inset: 0; background: rgba(8,25,122,.72); }
.ccc-modal-box { position: relative; background: #fff; border: 5px solid var(--ccc-blue); border-radius: 22px; box-shadow: 10px 10px 0 var(--ccc-red); max-width: 520px; width: 100%; max-height: 94vh; overflow: auto; padding: 20px; text-align: center; animation: ccc-pop-in .3s cubic-bezier(.2,1.6,.4,1); }
.ccc-modal-box h2 { margin: 4px 0 6px; }
.ccc-modal-close { position: absolute; top: 10px; right: 10px; width: 42px; height: 42px; border-radius: 50%; border: 3px solid var(--ccc-blue); background: var(--ccc-red); color: #fff; font-size: 1.15rem; font-weight: 800; cursor: pointer; box-shadow: 3px 3px 0 var(--ccc-blue); }
.ccc-modal-close:hover { transform: rotate(90deg) scale(1.08); }
.ccc-modal-close { transition: transform .25s ease; }
.ccc-game { text-align: center; }
#ccc-snake-canvas, .ccc-game canvas { width: min(400px, 86vw); height: auto; aspect-ratio: 1; border: 4px solid var(--ccc-blue); border-radius: 16px; box-shadow: var(--ccc-shadow); background: #fff; touch-action: none; }
.ccc-game-score { font-size: 1.25rem; font-weight: 800; margin-bottom: 12px; }
.ccc-game-score span { color: var(--ccc-red); }
.ccc-mode-btn.ccc-active { background: var(--ccc-red); }
.ccc-pad { margin-top: 6px; }
.ccc-pad button { width: 58px; height: 58px; margin: 3px; font-size: 1.3rem; border-radius: 16px; border: 3px solid var(--ccc-blue); background: var(--ccc-yellow); color: var(--ccc-blue); box-shadow: 3px 3px 0 var(--ccc-blue); cursor: pointer; }
.ccc-pad button:active { transform: translateY(2px); box-shadow: 1px 1px 0 var(--ccc-blue); }
@media (hover: hover) and (pointer: fine) { .ccc-pad { display: none; } }
.ccc-play-fab { position: fixed; right: 18px; bottom: 18px; z-index: 120; background: var(--ccc-red); color: #fff; border: 3px solid var(--ccc-blue); box-shadow: 4px 4px 0 var(--ccc-blue); border-radius: 999px; padding: 12px 20px; font-weight: 800; font-size: 1rem; cursor: pointer; animation: ccc-bob 2.2s ease-in-out infinite; }
.ccc-play-fab:hover { background: var(--ccc-blue); box-shadow: 4px 4px 0 var(--ccc-red); }
.ccc-sent { background: var(--ccc-lime); color: #fff; text-align: center; font-weight: 800; padding: 12px; border-bottom: 4px solid var(--ccc-blue); }

/* ---------- Page hero banners (same pop as home) ---------- */
.ccc-page-hero { position: relative; overflow: hidden; text-align: center; padding: 44px 20px 38px; border-bottom: 5px solid var(--ccc-blue); background:
  radial-gradient(circle at 10% 20%, rgba(255,196,0,.50), transparent 38%),
  radial-gradient(circle at 90% 15%, rgba(255,61,138,.40), transparent 40%),
  radial-gradient(circle at 85% 95%, rgba(41,182,255,.40), transparent 42%),
  radial-gradient(circle at 8% 90%, rgba(53,199,89,.35), transparent 38%), #fff; }
.ccc-page-hero::before { content: ""; position: absolute; left: 50%; top: 50%; width: 120vmax; height: 120vmax; transform: translate(-50%, -50%); background: repeating-conic-gradient(from 0deg, rgba(155,4,6,.07) 0deg 12deg, rgba(255,196,0,.09) 12deg 24deg, rgba(41,182,255,.07) 24deg 36deg, rgba(53,199,89,.07) 36deg 48deg, rgba(255,61,138,.07) 48deg 60deg); animation: ccc-spin-slow 80s linear infinite; pointer-events: none; }
.ccc-page-hero > * { position: relative; z-index: 2; }
.ccc-page-hero h1 { font-size: clamp(1.9rem, 5.5vw, 2.8rem); margin: 0 0 6px; }
.ccc-page-hero .ccc-sub { font-size: 1.1rem; margin: 0; font-weight: 700; }
.ccc-page-hero .ccc-dot { z-index: 1; }
.ccc-content h2 { margin-top: 34px; }
.ccc-content .ccc-card, .ccc-content .ccc-faq { will-change: transform; }

/* WooCommerce shop/product pop */
.woocommerce ul.products li.product { border: 3px solid var(--ccc-blue); border-radius: 18px; box-shadow: var(--ccc-shadow); padding: 14px; background: #fff; transition: transform .2s cubic-bezier(.2,1.6,.4,1), box-shadow .2s ease; text-align: center; }
.woocommerce ul.products li.product:hover { transform: translateY(-8px) rotate(-1deg) scale(1.02); box-shadow: 10px 12px 0 var(--ccc-blue); }
.woocommerce ul.products li.product .price { color: var(--ccc-red) !important; font-size: 1.4rem !important; font-weight: 800; }
.woocommerce ul.products li.product img { border-radius: 12px; }
.woocommerce div.product .price { color: var(--ccc-red) !important; font-weight: 800; }
.woocommerce-cart .ccc-content, .woocommerce-checkout .ccc-content { max-width: 1080px; }

/* ---------- Forms & FAQ ---------- */
.ccc-form { max-width: 560px; margin: 0 auto 28px; text-align: left; }
.ccc-form label { display: block; font-weight: 800; margin-bottom: 14px; }
.ccc-form input, .ccc-form textarea { width: 100%; margin-top: 6px; padding: 12px 14px; font: inherit; color: var(--ccc-blue); background: #fff; border: 3px solid var(--ccc-blue); border-radius: 14px; box-shadow: 3px 3px 0 rgba(8,25,122,.25); }
.ccc-form input:focus, .ccc-form textarea:focus { outline: none; border-color: var(--ccc-red); box-shadow: 3px 3px 0 var(--ccc-red); }
.ccc-form-inline { display: flex; gap: 10px; justify-content: center; align-items: flex-end; flex-wrap: wrap; }
.ccc-form-inline label { flex: 1 1 260px; margin-bottom: 0; }
.ccc-sr { font-weight: 800; }
.ccc-faq { border: 3px solid var(--ccc-blue); border-radius: 16px; box-shadow: 4px 4px 0 var(--ccc-blue); padding: 6px 18px; margin-bottom: 14px; background: #fff; transition: transform .15s ease; }
.ccc-faq:hover { transform: translateY(-2px); }
.ccc-faq summary { font-weight: 800; font-size: 1.1rem; cursor: pointer; padding: 10px 0; }
.ccc-faq[open ] summary { color: var(--ccc-red); }
.ccc-faq p { margin-top: 0; }

/* WooCommerce touches */
.woocommerce .button, .woocommerce button.button, .woocommerce a.button { border-radius: 999px !important; font-weight: 800 !important; }
.woocommerce span.onsale { background: var(--ccc-red) !important; border: 3px solid var(--ccc-blue); animation: ccc-pulse 1.6s ease-in-out infinite; }

/* How-it's-made: transform animation + step 4 photo placeholder (v0.8) */
.ccc-transform-wrap { text-align: center; }
.ccc-transform-gif { max-width: 640px; width: 100%; height: auto; border-radius: 20px; border: 4px solid var(--ccc-blue); box-shadow: var(--ccc-shadow); }
.ccc-photo-soon { aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; background: repeating-linear-gradient(45deg, #fff7e0, #fff7e0 14px, #ffedb8 14px, #ffedb8 28px); border-radius: 12px; font-weight: 800; color: var(--ccc-blue); font-size: 1.1rem; }

/* Home shop cards: smaller pictures under the hero (v0.8.1, Bennett's request) */
#ccc-shop-anchor .ccc-card img { max-width: 60%; }

/* Single bag card: 30% smaller than the other card photo (v0.8.2, Bennett's request) */
#ccc-shop-anchor .ccc-card:first-child img { max-width: 42%; }

/* Header cart button + form selects (v0.9.0) */
.ccc-form select { width: 100%; margin-top: 6px; padding: 12px 14px; font: inherit; color: var(--ccc-blue); background: #fff; border: 3px solid var(--ccc-blue); border-radius: 14px; box-shadow: 3px 3px 0 rgba(8,25,122,.25); }
.ccc-form select:focus { outline: none; border-color: var(--ccc-red); box-shadow: 3px 3px 0 var(--ccc-red); }
.ccc-cart-btn { margin-left: 10px; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 800; color: #fff !important; background: var(--ccc-red); padding: 9px 16px; border-radius: 999px; border: 3px solid var(--ccc-blue); box-shadow: 3px 3px 0 var(--ccc-blue); transition: transform .15s ease, box-shadow .15s ease; white-space: nowrap; }
.ccc-cart-btn:hover { transform: translateY(-2px) rotate(-1deg); box-shadow: 5px 5px 0 var(--ccc-blue); }
.ccc-cart-count { background: #fff; color: var(--ccc-red); border-radius: 999px; padding: 1px 9px; font-size: .85rem; border: 2px solid var(--ccc-blue); }

/* Status note (subscriptions not active) + events intro (v0.9.1) */
.ccc-status-note { background: #fff3b0; border: 3px solid var(--ccc-blue); border-radius: 16px; box-shadow: 4px 4px 0 var(--ccc-blue); padding: 14px 18px; font-size: 1.05rem; }
.ccc-events-intro { font-size: 1.08rem; }

/* Events page: alert signup box (v0.9.2) */
.ccc-alert-box { background: #dff3ff; border: 3px solid var(--ccc-blue); border-radius: 18px; box-shadow: var(--ccc-shadow); padding: 20px 22px; margin: 22px 0 28px; text-align: center; }
.ccc-alert-box h2 { margin-top: 0; }
.ccc-alert-box .ccc-form { margin-bottom: 6px; }

/* Homepage reviews (v0.9.3) */
.ccc-stars { color: #ffb400; font-size: 1.5rem; letter-spacing: 3px; margin: 0 0 6px; text-shadow: 1px 1px 0 var(--ccc-blue); }

/* Checkout fine print + footer legal line (v0.9.4) */
.ccc-checkout-fineprint { font-size: .8rem; line-height: 1.5; opacity: .85; border-top: 2px dashed rgba(8,25,122,.35); padding-top: 10px; margin-top: 14px; }
.ccc-footer-legal { font-size: .85rem; }

/* Suggestion leaderboard (v0.9.6) */
.ccc-leaderboard { background: #fff; border: 3px solid var(--ccc-blue); border-radius: 18px; box-shadow: var(--ccc-shadow); max-width: 560px; margin: 20px auto 4px; padding: 16px 20px 10px; text-align: left; }
.ccc-leaderboard h3 { text-align: center; margin: 0 0 10px; }
.ccc-leaderboard ol { margin: 0 0 8px; padding-left: 24px; }
.ccc-leaderboard li { font-weight: 700; margin: 7px 0; overflow: hidden; }
.ccc-lb-count { float: right; background: var(--ccc-yellow); border: 2px solid var(--ccc-blue); border-radius: 999px; padding: 0 10px; font-size: .85rem; }
