/* Meowelo type system — Fredoka (display) · Nunito (body/UI) · Lora italic (story voice). Loaded once, here. */
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Nunito:ital,wght@0,300..900;1,300..900&family=Lora:ital,wght@0,400..700;1,400..700&display=swap');

:root {
    /* Core Brand Colors */
    --color-main-blue: #6ED4FF;
    --color-sky-blue: #ADF4F6;
    --color-soft-bg: #F5FCFF;
    --color-deep-blue: #2F95C8;
    
    --color-cta-red: #FF5A7A;
    --color-cta-hover: #E04865;
    
    --color-soft-pink: #FFB3C1;
    --color-warm-cream: #FFF8F2;
    --color-soft-lavender: #E6E6FA;

    --color-primary-text: #2B2B2B;
    --color-secondary-text: #6B7280;
    --color-border: #E5F3FA;

    /* Customizer Base Variable Defaults (Prevents breakage before customizer loads) */
    --font-display: 'Fredoka', 'Nunito', system-ui, sans-serif;   /* headings, brand */
    --font-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif; /* body, UI */
    --font-story: 'Lora', Georgia, serif;                         /* story voice: quotes, emotional lines */
    --font-family: var(--font-body);
    --font-base: 16px;
    --border-radius: 24px;
    --container-width: 1152px;
    --hero-bg: #ADF4F6;
    --hero-gradient-start: #C8F7F8;
    --hero-gradient-mid: #ADF4F6; /* matches new sky-blue */
    --hero-gradient-end: #6ED4FF; /* fallback for var(--color-main-blue) */
    --shop-card-bg: #ffffff;

    /* Customizer Variable Mapping */
    --color-cream: var(--color-soft-bg, #F5FCFF);
    --color-beige: var(--color-warm-cream, #FFF8F2);
    --color-brown: var(--color-primary-text, #2B2B2B);
    --color-gold: var(--color-cta-red, #FF5A7A);
    --color-blue: var(--color-deep-blue, #2F95C8);
    --color-green: var(--color-main-blue, #6ED4FF);
    --color-pink: var(--color-soft-pink, #FFB3C1);
    --color-text: var(--color-primary-text, #2B2B2B);
    --color-text-light: var(--color-secondary-text, #6B7280);
    --color-accent: var(--color-cta-red, #FF5A7A);
    --color-secondary: var(--color-deep-blue, #2F95C8);
}

body {
    font-family: var(--font-family, 'Nunito', sans-serif);
    font-size: var(--font-base, 16px);
    background-color: var(--color-soft-bg, #F5FCFF);
    color: var(--color-primary-text, #2B2B2B);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.15;
}
h1 { letter-spacing: -0.02em; }
/* Tailwind font-extrabold/black on headings: Fredoka tops out at 700 — a soft, premium weight */
h1.font-bold, h2.font-bold, h3.font-bold, h4.font-bold,
h1.font-extrabold, h2.font-extrabold, h3.font-extrabold, h1.font-black, h2.font-black { font-weight: 600; }

/* Story voice — used sparingly: the emotional line of a book, story text, pull quotes */
.font-story, blockquote, .theme-content blockquote { font-family: var(--font-story); font-style: italic; }
.cozy-tab-content em, #char-bio em, .theme-content em { font-family: var(--font-story); font-size: 1.04em; }
.font-display { font-family: var(--font-display); }
.font-body { font-family: var(--font-body); }

/* Brand wordmark in the header/footer */
#navbar > a:first-child, footer a.text-2xl { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; }

/* Reading text on blog posts: serif, a touch larger, comfortable measure */
.post-body, .prose-story { font-family: var(--font-story); font-style: normal; font-size: 1.125rem; line-height: 1.8; }
.post-body h2, .post-body h3, .prose-story h2, .prose-story h3 { font-family: var(--font-display); font-style: normal; }

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--color-cream);
}
::-webkit-scrollbar-thumb {
    background: var(--color-pink);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-main-blue);
}

/* Animations */
.fade-in {
    opacity: 1;
    transition: none;
}
.fade-in.visible {
    opacity: 1;
}

.hover-lift {
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.hover-lift:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 32px -4px rgba(43, 43, 43, 0.08);
}

/* Glassmorphism */
.glass {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(43, 43, 43, 0.05);
}

/* Custom Buttons */
.btn-premium {
    padding: 0.85rem 2rem;
    border-radius: var(--border-radius, 9999px);
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--color-accent);
    color: white;
}

.btn-primary:hover {
    filter: brightness(1.08);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 90, 122, 0.25);
}

/* Card Styling */
.book-card {
    background: white;
    border-radius: 40px;
    overflow: hidden;
    border: 1px solid rgba(43, 43, 43, 0.06);
    box-shadow: 0 4px 20px -2px rgba(43, 43, 43, 0.02);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.book-card .p-8 {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.book-card .mt-auto {
    margin-top: auto;
}

/* Navbar Sticky */
.navbar-scrolled {
    padding-top: 0.6rem !important;
    padding-bottom: 0.6rem !important;
    background-color: rgba(255, 248, 242, 0.98) !important;
    border-color: rgba(43, 43, 43, 0.08) !important;
    box-shadow: 0 10px 30px rgba(43, 43, 43, 0.06) !important;
}

/* Product Badge */
.badge {
    display: inline-block;
    padding: 0.3rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: 1px solid transparent;
}

/* Official Meowelo Emotional Category Colors */
.cat-comfort { background-color: #FFF8F2; color: #2B2B2B; border-color: rgba(43,43,43,0.1); }
.cat-adventure { background-color: #FFB3C1; color: #2B2B2B; border-color: rgba(255,179,193,0.3); }
.cat-atmosphere { background-color: #E9E1FF; color: #2B2B2B; border-color: rgba(233,225,255,0.4); }
.cat-meditation { background-color: #AEEBFF; color: #2B2B2B; border-color: rgba(174,235,255,0.4); }
.cat-imagination { background-color: #6ED4FF; color: #ffffff; border-color: rgba(110,212,255,0.4); }
.cat-seasons { background-color: #F5FCFF; color: #2B2B2B; border-color: rgba(229,243,250,1); }
.cat-reflection { background-color: #2F95C8; color: #ffffff; border-color: rgba(47,149,200,0.4); }

/* WooCommerce additions mapped to static classes */
.qty-btn {
    width: 3rem;
    height: 100%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: #2B2B2B;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
}
.qty-btn:hover {
    background: #6ED4FF;
    color: #ffffff;
}

@keyframes toastDrop {
    0% { opacity: 0; transform: translateY(-20px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
.animate-toast-drop {
    animation: toastDrop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Gallery image styles */
.gallery-thumb { transition: all 0.3s cubic-bezier(0.25,1,0.5,1); border: 2px solid transparent; }
.gallery-thumb.active { border-color: #2B2B2B; transform: scale(1.05); }
.gallery-main-img { transition: opacity 0.15s ease, filter 0.15s ease, transform 0.15s ease; }
.gallery-main-img.swapping { opacity: 0; filter: blur(5px); transform: scale(0.98); }


/* Hide scrollbars */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* --- REDESIGNED ANNOUNCEMENT BAR & FLOATING HEADER UX --- */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.animate-gradient-shift {
    background-size: 200% 200%;
    animation: gradientShift 6s ease infinite;
}

#announcement-bar {
    transition: max-height 0.4s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s ease, padding 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    overflow: hidden;
}

#announcement-bar.collapsed {
    max-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    opacity: 0 !important;
    border: none !important;
}

/* Floating Navbar dynamic smooth top glide */
#navbar {
    transition: top 0.4s cubic-bezier(0.25, 1, 0.5, 1), transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease, left 0.3s ease, -webkit-transform 0.3s ease;
}

/* --- COZY UNIFIED FILTER SYSTEM UX & STYLING --- */
.pill-active-theme {
    background-color: var(--color-primary-text) !important;
    color: white !important;
    border-color: var(--color-primary-text) !important;
    box-shadow: 0 4px 12px -2px rgba(43, 43, 43, 0.15) !important;
}

.cozy-tag-btn {
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.cozy-tag-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(43, 43, 43, 0.04);
}

/* --- PREMIUM 3D BOOK MOCKUP --- */
.cozy-3d-book-wrapper {
    position: relative;
    width: 270px;
    height: 360px;
    margin: 0 auto;
    perspective: 1200px;
}
.cozy-3d-book {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transform: rotateY(-18deg) rotateX(10deg);
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}
.cozy-3d-book-wrapper:hover .cozy-3d-book {
    transform: rotateY(-4deg) rotateX(2deg) translateY(-8px);
}
.book-cover {
    position: absolute;
    inset: 0;
    border-radius: 4px 16px 16px 4px;
    box-shadow: 12px 12px 30px rgba(43, 43, 43, 0.18);
    background-color: var(--color-warm-cream);
    overflow: hidden;
    border: 1px solid rgba(43, 43, 43, 0.05);
    z-index: 10;
}
.book-spine-shadow {
    position: absolute;
    left: 0;
    top: 0;
    width: 16px;
    height: 100%;
    background: linear-gradient(to right, rgba(0,0,0,0.18) 0%, rgba(0,0,0,0.06) 25%, rgba(255,255,255,0.08) 35%, rgba(0,0,0,0) 100%);
    z-index: 20;
    border-radius: 4px 0 0 4px;
}
.book-thickness {
    position: absolute;
    right: -8px;
    top: 6px;
    width: 8px;
    height: calc(100% - 12px);
    background: linear-gradient(to right, #e2e2e2 0%, #ffffff 50%, #eaeaea 100%);
    box-shadow: 2px 2px 4px rgba(0,0,0,0.08);
    border-radius: 0 4px 4px 0;
    z-index: 5;
    transform: rotateY(90deg) translateZ(-4px);
}
.book-bottom-thickness {
    position: absolute;
    bottom: -8px;
    left: 6px;
    height: 8px;
    width: calc(100% - 12px);
    background: linear-gradient(to bottom, #d8d8d8 0%, #ffffff 50%, #eaeaea 100%);
    box-shadow: 2px 2px 4px rgba(0,0,0,0.08);
    border-radius: 0 0 4px 4px;
    z-index: 5;
    transform: rotateX(-90deg) translateZ(-4px);
}

/* --- PREMIUM 3D SWING & SLIDE BOUNCE TRANSITIONS --- */
@keyframes bookExit {
    0% { transform: scale(1) rotateY(0deg) translateX(0); opacity: 1; filter: blur(0); }
    100% { transform: scale(0.9) rotateY(-18deg) translateX(-40px); opacity: 0; filter: blur(4px); }
}

@keyframes bookEnter {
    0% { transform: scale(0.9) rotateY(18deg) translateX(40px); opacity: 0; filter: blur(4px); }
    70% { transform: scale(1.04) rotateY(-3deg) translateX(-3px); opacity: 1; filter: blur(0); }
    100% { transform: scale(1) rotateY(0deg) translateX(0); opacity: 1; }
}

.book-exit-active {
    animation: bookExit 0.3s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.book-enter-active {
    animation: bookEnter 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.255) forwards;
}

/* --- PREMIUM COZY TABS SYSTEM --- */
.cozy-tabs-container {
    margin-top: 2rem;
    border-top: 1px solid rgba(43, 43, 43, 0.08);
}
.cozy-tab-btn {
    position: relative;
    padding: 0.85rem 0.5rem;
    font-weight: 700;
    font-size: 0.875rem; /* text-sm */
    letter-spacing: 0.025em;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
    border-bottom: 2px solid transparent;
}
.cozy-tab-btn.active {
    color: var(--color-primary-text);
}
.cozy-tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--color-primary-text);
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}
.cozy-tab-btn.active::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}
.cozy-tab-content {
    transition: opacity 0.2s ease-in-out;
}

/* --- STICKY CART BAR (RESPONSIVE) --- */
#sticky-cart-bar {
    position: fixed;
    z-index: 50;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.4s ease;
    opacity: 0;
    pointer-events: none;
}
#sticky-cart-bar.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Base Pill / Bar styling */
.sticky-cart-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 10px 40px -10px rgba(43, 43, 43, 0.15);
    border: 1px solid rgba(43, 43, 43, 0.08);
}

/* Top positioning */
#sticky-cart-bar.pos-top {
    top: 0; left: 0; right: 0;
    transform: translateY(-100%);
}
#sticky-cart-bar.pos-top.visible {
    transform: translateY(0);
}

/* Bottom positioning */
#sticky-cart-bar.pos-bottom {
    bottom: 0; left: 0; right: 0;
    transform: translateY(100%);
}
#sticky-cart-bar.pos-bottom.visible {
    transform: translateY(0);
}

/* Mobile defaults to full-width bottom usually, but we respect classes */
#sticky-cart-bar .sticky-cart-content {
    padding: 0.75rem 1.25rem;
    width: 100%;
}

/* Floating Pill Desktop styling */
@media (min-width: 768px) {
    #sticky-cart-bar.style-floating-pill {
        display: flex;
        justify-content: center;
        pointer-events: none; /* Let clicks pass through the container */
    }
    #sticky-cart-bar.style-floating-pill .sticky-cart-content {
        pointer-events: auto;
        width: auto;
        min-width: 400px;
        max-width: 600px;
        border-radius: 9999px;
        margin: 1.5rem auto;
        padding: 0.75rem 1rem 0.75rem 1.25rem;
    }
}

/* Meowelo 12-book collection — therapeutic focus badges (one per book) */
.cat-safety       { background-color: #A9C4E8; color: #2C3E6B; border-color: rgba(91,125,177,0.3); }
.cat-growth       { background-color: #F7E1E8; color: #6B3A4A; border-color: rgba(244,182,194,0.4); }
.cat-courage      { background-color: #F4D35E; color: #1B3A2F; border-color: rgba(46,107,79,0.3); }
.cat-awareness    { background-color: #E8ECF5; color: #4A6FA5; border-color: rgba(64,224,208,0.4); }
.cat-change       { background-color: #E1AD01; color: #4A2A10; border-color: rgba(204,85,0,0.3); }
.cat-hope         { background-color: #A8D8EA; color: #9B1B30; border-color: rgba(212,160,23,0.4); }
.cat-confidence   { background-color: #FFD93D; color: #2B2B2B; border-color: rgba(107,191,89,0.4); }
.cat-gratitude    { background-color: #FFF8E7; color: #B3232B; border-color: rgba(227,11,92,0.3); }
.cat-perseverance { background-color: #191970; color: #FFFFFF; border-color: rgba(212,160,23,0.5); }
.cat-acceptance   { background-color: #C8B6E2; color: #3F3556; border-color: rgba(143,168,200,0.4); }
.cat-belonging    { background-color: #F2E9D8; color: #5B3A1E; border-color: rgba(212,160,23,0.4); }

/* Blog post body: readable typography without the Tailwind typography plugin */
.post-body h2 { font-size: 1.5rem; margin: 2rem 0 .75rem; }
.post-body h3 { font-size: 1.2rem; margin: 1.5rem 0 .5rem; }
.post-body p { margin: 0 0 1.1rem; }
.post-body ul, .post-body ol { margin: 0 0 1.1rem 1.25rem; padding-left: .5rem; }
.post-body li { margin: .35rem 0; }
.post-body a { color: var(--color-deep-blue); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.post-body blockquote { border-left: 4px solid var(--color-deep-blue); background: var(--color-soft-bg); padding: .5rem 1.25rem; border-radius: 0 1rem 1rem 0; margin: 1.25rem 0; }

/* Book Bag journey tracker */
.journey-item.in-bag { border-color: var(--color-deep-blue); }
.journey-item.in-bag .journey-mark { display: inline-block; }
#cart-toast.hidden { display: none; }
