/* ==========================================================================
   Design Tokens & CSS Variables (Soft Kids Fashion Theme)
   ========================================================================== */
:root {
    --bg-main: #FFFDF9;           /* ขาวครีมนุ่มนวล */
    --color-white: #FFFFFF;
    --color-cream: #FAF3E0;        /* ครีมพาสเทล */
    --color-pink: #FFD1DC;         /* ชมพูพาสเทล */
    --color-pink-hover: #F8B195;
    --color-blue: #E0F7FA;         /* ฟ้าอ่อนพาสเทล */
    --color-yellow: #FFF9C4;       /* เหลืองอ่อนพาสเทล */
    --color-text-dark: #333333;    /* เทาเข้ม อ่านง่าย */
    --color-text-muted: #666666;
    --color-accent: #E08282;      /* ชมพูเข้ม accent */
    
    --gradient-soft: linear-gradient(135deg, #FFF0F5 0%, #E6F0FA 50%, #FFFDE7 100%);
    --gradient-hero: linear-gradient(135deg, rgba(255,255,255,0.85) 0%, rgba(255,239,241,0.85) 100%);
    --gradient-card: linear-gradient(145deg, #FFFFFF, #FAF3E0);
    
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 15px 35px rgba(224, 130, 130, 0.15);
    
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ==========================================================================
   Base & Reset Styles
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Kanit', sans-serif;
    background-color: var(--bg-main);
    color: var(--color-text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-padding {
    padding: 90px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-tag {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--color-accent);
    background-color: var(--color-pink);
    padding: 4px 14px;
    border-radius: 20px;
    margin-bottom: 10px;
}

.section-title {
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--color-text-dark);
    margin-bottom: 10px;
}

.section-desc {
    color: var(--color-text-muted);
    font-size: 1rem;
}

.paragraph {
    color: var(--color-text-muted);
    margin-bottom: 15px;
    font-size: 1.05rem;
}

/* ==========================================================================
   Buttons & Ripple Effect
   ========================================================================== */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border: none;
    text-align: center;
}

.btn-primary {
    background-color: var(--color-accent);
    color: var(--color-white);
    box-shadow: 0 6px 20px rgba(224, 130, 130, 0.3);
}

.btn-primary:hover {
    background-color: #d16b6b;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--color-white);
    color: var(--color-text-dark);
    border: 1px solid #E0E0E0;
}

.btn-secondary:hover {
    background-color: var(--color-cream);
    transform: translateY(-2px);
}

.btn-outline {
    border: 1.5px solid var(--color-accent);
    color: var(--color-accent);
    background: transparent;
}

.btn-outline:hover {
    background-color: var(--color-accent);
    color: var(--color-white);
}

.ripple {
    position: relative;
    overflow: hidden;
}

.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: ripple-animation 0.6s linear;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ==========================================================================
   Loading Animation
   ========================================================================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-main);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader {
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--color-pink);
    border-top: 4px solid var(--color-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

.loader span {
    font-weight: 600;
    letter-spacing: 3px;
    color: var(--color-accent);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: rgba(255, 253, 249, 0.9);
    backdrop-filter: blur(10px);
    transition: var(--transition);
    border-bottom: 1px solid rgba(0,0,0,0.03);
}

.header.sticky {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    background-color: rgba(255, 255, 255, 0.95);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1.4rem;
    font-weight: 700;
}

.logo-main { color: var(--color-accent); }
.logo-sub { color: var(--color-text-dark); }

.nav-list {
    display: flex;
    gap: 25px;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--color-text-dark);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-accent);
    transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link.active {
    color: var(--color-accent);
    font-weight: 500;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--color-text-dark);
    border-radius: 3px;
    transition: var(--transition);
}

/* ==========================================================================
   Mobile Top Gallery (ซ่อนบน Desktop แสดงเฉพาะมือถือ)
   ========================================================================== */
.mobile-top-gallery {
    display: none; /* ซ่อนเป็นค่าเริ่มต้น */
}


/* ==========================================================================
   Hero Section (Desktop)
   ========================================================================== */
.hero {
    position: relative;
    height: 100vh;
    min-height: 650px;
    background: url('https://images.unsplash.com/photo-1519238263530-99bdd11df2ea?auto=format&fit=crop&w=1920&q=80') center/cover no-repeat;
    display: flex;
    align-items: center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-hero);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 650px;
}

.hero-badge {
    display: inline-block;
    padding: 6px 16px;
    background-color: var(--color-yellow);
    color: var(--color-text-dark);
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 20px;
    margin-bottom: 15px;
}

.hero-title {
    font-size: 3.5rem;
    line-height: 1.1;
    color: var(--color-accent);
    font-weight: 700;
    margin-bottom: 10px;
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--color-text-dark);
    margin-bottom: 15px;
}

.hero-desc {
    color: var(--color-text-muted);
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.hero-buttons {
    display: flex;
    gap: 15px;
}

/* ==========================================================================
   Stats Counter
   ========================================================================== */
.stats-section {
    background: var(--gradient-soft);
    padding: 50px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    text-align: center;
}

.stat-card i {
    font-size: 2.2rem;
    color: var(--color-accent);
    margin-bottom: 10px;
}

.stat-card h3 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-text-dark);
}

.stat-card p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

/* ==========================================================================
   About Us
   ========================================================================== */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.about-features {
    margin-top: 20px;
}

.about-features li {
    margin-bottom: 10px;
    font-size: 1rem;
    color: var(--color-text-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.about-features i {
    color: var(--color-accent);
    background-color: var(--color-pink);
    padding: 5px;
    border-radius: 50%;
    font-size: 0.8rem;
}

.about-image img {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

/* ==========================================================================
   Services
   ========================================================================== */
.services {
    background-color: var(--color-white);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.service-card {
    background: var(--gradient-card);
    padding: 35px 25px;
    border-radius: var(--radius-md);
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.service-icon {
    width: 60px;
    height: 60px;
    background-color: var(--color-pink);
    color: var(--color-accent);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.service-card h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.service-card p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

/* ==========================================================================
   Products
   ========================================================================== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.product-card {
    background-color: var(--color-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.product-img {
    height: 260px;
    overflow: hidden;
}

.product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.product-card:hover .product-img img {
    transform: scale(1.08);
}

.product-info {
    padding: 25px;
    text-align: center;
}

.product-info h3 {
    font-size: 1.25rem;
    margin-bottom: 8px;
}

.product-info p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

/* ==========================================================================
   Timeline Process
   ========================================================================== */
.process {
    background: var(--gradient-soft);
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 4px;
    background-color: var(--color-pink);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -2px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    width: 50%;
}

.timeline-item:nth-child(odd) {
    left: 0;
    text-align: right;
}

.timeline-item:nth-child(even) {
    left: 50%;
    text-align: left;
}

.timeline-number {
    position: absolute;
    width: 45px;
    height: 45px;
    right: -22px;
    background-color: var(--color-accent);
    color: var(--color-white);
    border-radius: 50%;
    top: 15px;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    border: 4px solid var(--color-white);
}

.timeline-item:nth-child(even) .timeline-number {
    left: -22px;
}

.timeline-content {
    padding: 20px 25px;
    background-color: var(--color-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
}

.timeline-content h3 {
    font-size: 1.2rem;
    color: var(--color-accent);
    margin-bottom: 5px;
}

.timeline-content p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* ==========================================================================
   PG Section
   ========================================================================== */
.pg-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.pg-image img {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

/* ==========================================================================
   News Section
   ========================================================================== */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.news-card {
    background-color: var(--color-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
}

.news-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.news-img {
    height: 200px;
    overflow: hidden;
}

.news-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-content {
    padding: 25px;
}

.news-date {
    font-size: 0.85rem;
    color: var(--color-accent);
    margin-bottom: 8px;
    display: block;
}

.news-content h3 {
    font-size: 1.15rem;
    margin-bottom: 10px;
    line-height: 1.4;
}

.news-content p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.news-link {
    font-weight: 500;
    color: var(--color-accent);
    font-size: 0.9rem;
}

/* ==========================================================================
   Contact Section & Map
   ========================================================================== */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.contact-info h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--color-accent);
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
    color: var(--color-text-dark);
}

.contact-item i {
    color: var(--color-accent);
    font-size: 1.2rem;
    margin-top: 4px;
}

.map-responsive {
    overflow: hidden;
    padding-bottom: 75%;
    position: relative;
    height: 0;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
}

.map-responsive iframe {
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    position: absolute;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
    background-color: #2A2A2A;
    color: var(--color-white);
    padding: 40px 0;
    text-align: center;
}

.footer-brand h2 {
    color: var(--color-pink);
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.footer-brand p {
    color: #AAA;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.footer-copy p {
    color: #777;
    font-size: 0.85rem;
}

.footer-copy a {
    color: var(--color-pink);
}

/* ==========================================================================
   Back To Top
   ========================================================================== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background-color: var(--color-accent);
    color: var(--color-white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 900;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: #d16b6b;
    transform: translateY(-3px);
}

/* ==========================================================================
   AOS Simulation Animations
   ========================================================================== */
[data-animate] {
    opacity: 0;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

[data-animate="fade-up"] { transform: translateY(40px); }
[data-animate="slide-right"] { transform: translateX(-40px); }
[data-animate="slide-left"] { transform: translateX(40px); }
[data-animate="zoom-in"] { transform: scale(0.9); }

[data-animate].animated {
    opacity: 1;
    transform: translate(0) scale(1);
}

/* ==========================================================================
   Responsive Styles (Mobile & Tablet)
   ========================================================================== */

/* มือถือ (Max Width: 767px) */
@media (max-width: 767px) {
    /* แสดง Mobile Top Gallery ด้านบนสุด */
    .mobile-top-gallery {
        display: block;
        background-color: var(--bg-main);
        padding: 10px 0;
    }

    .mobile-gallery-container {
        display: flex;
        flex-direction: column;
        gap: 15px;
        padding: 0 15px;
    }

    .mobile-gallery-item {
        position: relative;
        border-radius: 0; /* รูปภาพสี่เหลี่ยมเต็มตัว ไม่ขอบมน */
        overflow: hidden;
        box-shadow: var(--shadow-soft);
    }

    .mobile-gallery-item img {
        width: 100%;
        height: auto; /* แสดงขนาดภาพเต็มสัดส่วนจริง */
        display: block;
    }

    .gallery-caption {
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        padding: 10px;
        background: linear-gradient(0deg, rgba(0,0,0,0.7) 0%, transparent 100%);
        color: var(--color-white);
        font-size: 0.85rem;
        text-align: center;
    }

    /* Mobile Header & Navigation */
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background-color: var(--color-white);
        padding: 40px;
        transition: var(--transition);
        box-shadow: var(--shadow-soft);
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-list {
        flex-direction: column;
        align-items: center;
        gap: 25px;
    }

    .nav-link {
        font-size: 1.2rem;
    }

    /* Hero Section บนมือถือ */
    .hero {
        height: auto;
        min-height: auto;
        padding: 80px 0 60px;
    }

    .hero-title {
        font-size: 2.3rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .hero-buttons {
        flex-direction: column;
    }

    /* Layout Grids */
    .about-grid,
    .pg-grid,
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    /* Timeline บนมือถือ */
    .timeline::after {
        left: 31px;
    }

    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 15px;
        text-align: left !important;
    }

    .timeline-item:nth-child(even) {
        left: 0;
    }

    .timeline-number {
        left: 10px !important;
    }
}

/* Tablet (Min Width: 768px and Max Width: 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-title {
        font-size: 3rem;
    }
}