@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@700&family=Fredoka:wght@400;500;600;700&family=Mitr:wght@200;300;400;500;600;700&family=Mali:ital,wght@0,500;0,600;0,700;1,500;1,600;1,700&family=Prompt:wght@600;700;800&display=swap');

:root {
    --bee-brown: #4A2A14;
    --bee-yellow: #FFCB1B;
    --bee-orange: #FF5C00;
    --bg-cream: #FAF3E6;
    --bg-yellow-stripes: repeating-linear-gradient(45deg, #fce04b, #fce04b 10px, #fbd22a 10px, #fbd22a 20px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Mitr', sans-serif;
    background-color: var(--bee-brown);
    color: #333;
    overflow-x: hidden;
}

#app-container {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    position: relative;
}

/* NAVBAR */
.bee-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
    padding: 0 5%;
    width: 100%;
    box-sizing: border-box;
    background-color: var(--bee-brown);
    position: relative;
    z-index: 1000;
    box-shadow: 0 4px 0 0 var(--bee-brown);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex: 1; /* Equal weight for centering */
}

/* Force the right side action container to match the left side weight to keep center nav perfectly stable */
.bee-navbar > div:last-child {
    flex: 1;
    justify-content: flex-end;
}

.nav-logo img {
    height: 60px;
    width: auto;
}

.nav-logo-text h1 {
    font-family: 'Fredoka', cursive;
    color: #FFFFFF;
    font-size: 1.7rem;
    line-height: 1;
    margin: 0;
}

.nav-logo-text span {
    font-family: 'Dancing Script', cursive;
    color: var(--bee-yellow);
    font-size: 1.22rem;
}

.bee-nav-links {
    display: flex;
    list-style: none;
    gap: 18px;
    margin: 0;
}

.bee-nav-links a {
    text-decoration: none;
    color: #FFFFFF;
    font-size: 1.15rem; /* Reduced slightly */
    font-weight: 400; /* Reduced per brief: อ่านง่ายๆแต่ยังหนา */
    padding: 4px 10px; /* Adjusted padding */
    margin: 0; /* spacing handled by gap on .bee-nav-links */
    letter-spacing: 2px; /* airier text per client feedback (bar size unchanged) */
    border-radius: 8px;
    transition: all 0.3s;
}

.bee-nav-links a:hover, .bee-nav-links a.active {
    color: var(--bee-yellow);
    background: rgba(255, 203, 27, 0.1);
}

.bee-nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 12px;
    position: relative;
    z-index: 200;
    -webkit-tap-highlight-color: rgba(255,203,27,0.3);
    touch-action: manipulation;
}

.bee-nav-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #FFFFFF;
    margin: 5px 0;
    transition: 0.3s;
}

@media (max-width: 768px) {
    .nav-logo img {
        height: 50px;
    }
    .nav-logo-text h1 {
        font-size: 1.5rem;
    }
    .nav-logo-text span {
        font-size: 1.1rem;
    }
    .bee-nav-links {
        display: none;
        position: fixed;
        top: 80px;
        left: 0;
        width: 100%;
        background-color: var(--bee-brown);
        flex-direction: column;
        padding: 15px 0;
        text-align: center;
        z-index: 99999;
        box-shadow: 0 8px 24px rgba(0,0,0,0.35);
        border-top: 2px solid rgba(255,203,27,0.3);
    }
    .bee-nav-links.open {
        display: flex;
    }
    .bee-nav-links li {
        list-style: none;
    }
    .bee-nav-links a {
        display: block;
        padding: 14px 20px;
        font-size: 1.15rem;
        font-weight: 500;
        color: #FFFFFF;
        transition: background 0.2s, color 0.2s;
    }
    .bee-nav-links a:hover,
    .bee-nav-links a.active {
        background: rgba(255,203,27,0.15);
        color: var(--bee-yellow);
    }
    .bee-nav-toggle {
        display: block;
    }
}
.bee-navbar {
    position: relative;
    z-index: 1000;
}



/* WAVY DIVIDERS */
.wavy-bottom {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    line-height: 0;
    z-index: 2;
}
.wavy-bottom svg {
    display: block;
    width: 100%;
    height: 40px;
}
.wavy-top {
    position: absolute;
    top: -1px;
    left: 0;
    width: 100%;
    line-height: 0;
    z-index: 1;
}
.wavy-top svg {
    display: block;
    width: 100%;
    height: 40px;
}

/* FOOTER */
.bee-footer {
    background: var(--bee-brown, #4A2A14);
    padding: 60px 5% 40px;
    text-align: center;
    position: relative;
    overflow: visible;
    z-index: 50;
    margin-top: -2px;
}
.footer-mascot-peek {
    position: absolute;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: auto;
    z-index: 10;
    pointer-events: none;
}
.reviews-title-stroke {
    font-family: 'Mitr', 'Fredoka', sans-serif;
    font-size: 3.5rem;
    color: white;
    margin: 0;
    line-height: 1;
    font-weight: 500;
    -webkit-text-stroke: 12px white;
    filter: drop-shadow(2px 3px 3px rgba(0,0,0,0.1));
    letter-spacing: 1px;
}
.reviews-title-fill {
    font-family: 'Mitr', 'Fredoka', sans-serif;
    font-size: 3.5rem;
    color: #111;
    margin: 0;
    line-height: 1;
    position: absolute;
    left: 0;
    top: 0;
    z-index: 3;
    font-weight: 500;
    letter-spacing: 1px;
}
.reviews-subtitle {
    font-family: 'Mali', 'Dancing Script', cursive;
    font-size: 2.2rem;
    color: #FF5C00;
    margin-top: -15px;
    margin-bottom: 20px;
    margin-left: 120px;
    position: relative;
    z-index: 5;
    transform: rotate(-5deg);
    font-weight: 500;
}
.footer-logo-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
}
.footer-logo-row img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}
.f-brand h2 {
    font-family: 'Fredoka', sans-serif;
    font-size: 2rem;
    color: white;
    line-height: 0.9;
    margin: 0;
}
.f-brand span {
    font-family: 'Dancing Script', cursive;
    color: var(--bee-yellow, #FFCB1B);
    font-size: 1.1rem;
    font-weight: 500;
}
.footer-links-grid {
    display: flex;
    justify-content: center;
    gap: 80px;
    flex-wrap: wrap;
    text-align: center;
    margin-bottom: 30px;
}
.footer-links-grid div {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.footer-links-grid h4 {
    font-family: 'Mitr', sans-serif;
    color: var(--bee-yellow, #FFCB1B);
    font-size: 1.1rem;
    font-weight: 400;
    margin: 0 0 4px;
}
.footer-links-grid a {
    color: rgba(255,255,255,0.75);
    font-family: 'Mitr', sans-serif;
    font-size: 0.95rem;
    text-decoration: none;
    transition: color 0.2s;
}
.footer-links-grid a:hover {
    color: var(--bee-yellow, #FFCB1B);
}
.footer-copyright {
    color: rgba(255,255,255,0.5);
    font-family: 'Mitr', sans-serif;
    font-size: 0.85rem;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .footer-links-grid { gap: 30px; }
    .footer-mascot-peek { width: 70px; top: -55px; }
}

/* BOTTOM FLOATING SOCIAL BUTTON */
.social-fab-wrap {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999;
}
.social-fab-btn {
    width: 60px;
    height: 60px;
    background: var(--bee-yellow, #FFCB1B);
    border: 3px solid #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}
.social-fab-btn svg {
    width: 30px;
    height: 30px;
    fill: var(--bee-brown, #4A2A14);
    transition: transform 0.3s;
}
.social-fab-wrap.open .social-fab-btn {
    background: var(--bee-orange, #FF5C00);
    border-color: var(--bee-orange, #FF5C00);
}
.social-fab-wrap.open .social-fab-btn svg {
    fill: #fff;
    transform: rotate(45deg);
}
.fab-pulse {
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 3px solid var(--bee-yellow, #FFCB1B);
    animation: fabPulse 2s ease-out infinite;
    pointer-events: none;
}
.social-fab-wrap.open .fab-pulse { display: none; }
@keyframes fabPulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.4); opacity: 0; }
}
/* Social menu items */
.social-fab-menu {
    position: absolute;
    bottom: 70px;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    transform: translateY(10px);
}
.social-fab-wrap.open .social-fab-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
.social-fab-item {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: transform 0.2s;
    text-decoration: none;
    overflow: hidden;
}
.social-fab-item:hover {
    transform: scale(1.15);
}
.social-fab-item img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}
.social-fab-item svg {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

/* SPLIT FOOTER LAYOUT */
.footer-split-layout {
    display: grid;
    grid-template-columns: 1fr 1fr auto 1fr 1fr;
    gap: 30px;
    align-items: start;
    max-width: 1300px;
    margin: 0 auto 40px;
}
.footer-split-layout .f-section { text-align: left; }
.footer-split-layout .f-left { text-align: right; }

@media (max-width: 1024px) {
    .footer-split-layout {
        grid-template-columns: 1fr 1fr;
        gap: 40px 20px;
        text-align: center;
    }
    .footer-split-layout .f-section, .footer-split-layout .f-left {
        text-align: center;
    }
    .footer-logo-wrapper {
        grid-column: 1 / -1;
        grid-row: 1;
        display: flex;
        justify-content: center;
        margin-bottom: 20px;
    }
}

/* Custom Book Viewer Modal */
.custom-book-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    overflow: auto;
}
.custom-book-modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}
.book-modal-content {
    position: relative;
    max-width: 90vw;
    width: 1200px;
    background: transparent;
    border-radius: 10px;
    padding: 20px 0;
}
.close-book {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 45px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2010;
    transition: color 0.3s;
    line-height: 1;
}
.close-book:hover {
    color: var(--bee-yellow, #FFCB1B);
}
.book-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    width: 100%;
}
.book-nav {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}
.book-nav:hover {
    background: var(--bee-yellow, #FFCB1B);
    border-color: var(--bee-yellow, #FFCB1B);
    color: var(--bee-brown, #4A2A14);
}
.book-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: rgba(255,255,255,0.1);
    color: white;
    border-color: transparent;
}
.book-spread {
    display: flex;
    background: #fff;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    max-height: 80vh;
    width: 100%;
}
/* Spine effect */
.book-spread::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 40px;
    transform: translateX(-50%);
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(0,0,0,0.05) 45%, rgba(0,0,0,0.15) 50%, rgba(0,0,0,0.05) 55%, rgba(255,255,255,0) 100%);
    pointer-events: none;
    z-index: 10;
}
.book-page {
    flex: 1;
    width: 50%;
    position: relative;
    background: #fdfdfd;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}
.book-page img {
    width: 100%;
    height: 100%;
    max-height: 80vh;
    object-fit: contain;
    display: block;
    transition: opacity 0.3s ease;
}
.book-pagination {
    text-align: center;
    color: white;
    font-family: 'Mitr', sans-serif;
    font-size: 1.1rem;
    margin-top: 15px;
    letter-spacing: 1px;
}

@media (max-width: 768px) {
    .book-container {
        position: relative;
    }
    .book-nav {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        z-index: 20;
        background: rgba(0,0,0,0.6);
        border: none;
    }
    .prev-page { left: -10px; }
    .next-page { right: -10px; }
    
    .book-spread { 
        display: block; /* Switch to 1 page layout */
    }
    .book-spread::after { display: none; } /* No spine on mobile */
}

/* =========================================
   E-COMMERCE PRODUCT MODAL
========================================= */
.ecommerce-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(74, 42, 20, 0.85); /* Dark brown overlay */
    backdrop-filter: blur(5px);
    overflow: auto;
}

.ecommerce-modal.show {
    display: flex;
    justify-content: center;
    align-items: flex-start;            /* เริ่มจากบน กันตัดครึ่ง */
    padding: 40px 20px;
}

.ecommerce-content {
    position: relative;
    background: #FFFFFF;
    width: 100%;
    max-width: 480px;
    border-radius: 24px;
    padding: 24px 22px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
    font-family: 'Mitr', sans-serif;
    margin-bottom: 40px;                /* padding ล่างกันปุ่มโดนบัง */
}

/* ปรับขนาดรูปสินค้าลงให้ space พอสำหรับ control ใหม่ */
.eco-img-placeholder {
    aspect-ratio: auto !important;
    height: 240px;                      /* จำกัดความสูงแทน square 1:1 */
    width: 100%;
}

@media (max-width: 767px) {
    .ecommerce-modal.show { padding: 20px 12px; }
    .ecommerce-content { padding: 20px 16px; }
    .eco-img-placeholder { height: 200px; }
}

/* Window Controls (Top Right) */
.ecommerce-controls {
    position: absolute;
    top: -15px;
    right: -10px;
    display: flex;
    gap: 5px;
    z-index: 2010;
}

.eco-btn-control {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 3px solid #FFF;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}
.eco-btn-control:hover { transform: scale(1.1); }

.eco-minimize {
    background-color: #FF9800; /* Orange */
    color: white;
}
.eco-close {
    background-color: #FF0000; /* Red */
    color: white;
}

/* Product Image Placeholder */
.eco-img-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: #111; /* Black placeholder */
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
}
.eco-img-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Thumbnail Gallery */
.eco-gallery {
    display: none; /* Flex when active */
    gap: 8px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 5px;
    scrollbar-width: none;
}
.eco-gallery::-webkit-scrollbar { display: none; }
.eco-thumb {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    flex-shrink: 0;
    object-fit: contain;
    background: #111;
    opacity: 0.6;
    transition: all 0.2s;
}
.eco-thumb.active, .eco-thumb:hover {
    border-color: #FFCB1B;
    opacity: 1;
}

/* Text Detail block */
.eco-details {
    color: #4A2A14;
    margin-bottom: 20px;
}
.eco-title {
    font-size: 1.4rem;
    font-weight: 500;
    line-height: 1.2;
    margin-bottom: 8px;
    word-break: break-all;
}
.eco-lines {
    color: #8C6F5A;
    font-size: 0.95rem;
    line-height: 1.4;
    font-weight: 500;
    margin-bottom: 20px;
    word-break: break-all;
}

/* Variations Block */
.eco-variants-group {
    margin-bottom: 15px;
}
.eco-variants-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: #4A2A14;
    margin-bottom: 10px;
    word-break: break-all;
}
.eco-squares-wrap {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}
.eco-square-var {
    width: 45px;
    height: 45px;
    background: #000;
    border-radius: 8px;
    cursor: pointer;
}
.eco-pills-wrap {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}
.eco-pill-var {
    border: 1px solid #C4A484;
    color: #8C6F5A;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
}

/* Bottom Actions */
.eco-actions {
    display: flex;
    gap: 15px;
}
.eco-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 10px;
    border-radius: 30px;
    font-family: 'Mitr', sans-serif;
    font-size: 1.1rem;
    font-weight: 500;
    color: white;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: transform 0.2s, background 0.2s;
}
.eco-action-btn:hover {
    transform: translateY(-2px);
}
.eco-btn-cart {
    background-color: var(--bee-yellow, #FFCB1B);
    color: var(--bee-brown, #4A2A14);
}
.eco-btn-cart svg {
    color: var(--bee-brown, #4A2A14) !important;
}
/* Mockup shows orange, so let's adjust */
.eco-btn-cart.orange-mockup {
    background-color: #FFA500;
    color: #FFF;
}
.eco-btn-cart.orange-mockup svg { color: #FFF !important; }

.eco-btn-checkout {
    background-color: #2EBA4A; /* Mockup Green */
}



/* GLOBAL FOOTER MOBILE FIX */
@media (max-width: 640px) {
    .bee-footer > div:nth-of-type(2) {
        flex-direction: column !important;
        align-items: center !important;
    }
    .f-section {
        text-align: center !important;
        align-items: center !important;
    }
}


/* nav-cart-btn hover (replaces inline onmouseover/onmouseout) */
.nav-cart-btn { transition: transform 0.2s; }
.nav-cart-btn:hover { transform: scale(1.1); }
