/* Cuddlecraft - Kids' Toys Website
   Bright, playful, responsive design */

:root {
    --pink: #E91E63;
    --pink-light: #FFE5EC;
    --blue: #5C6BC0;
    --blue-light: #E5F4FF;
    --yellow: #FFC107;
    --yellow-light: #FFF4E5;
    --green: #66BB6A;
    --green-light: #E5FFEE;
    --purple-light: #F5E5FF;
    --white: #FFFFFF;
    --dark: #333333;
    --gray: #666666;
    --shadow: 0 4px 20px rgba(0,0,0,0.1);
    --radius: 16px;
    --radius-sm: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito', sans-serif;
    color: var(--dark);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: 'Fredoka One', cursive;
    font-weight: 400;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s, opacity 0.2s;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========== HEADER ========== */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--white);
    box-shadow: var(--shadow);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo-wrap {
    position: relative;
    display: inline-block;
}

.logo {
    display: inline-block;
    position: relative;
    z-index: 2;
    font-family: 'Fredoka One', cursive;
    font-size: 1.75rem;
    color: var(--pink);
    text-shadow: 2px 2px 0 var(--yellow);
    transition: transform 0.3s ease, color 0.3s ease, text-shadow 0.3s ease;
}

.logo:not(.logo-revealed) {
    animation: logoReveal 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards,
               logoBounce 2.2s ease-in-out 0.9s infinite;
    opacity: 0;
    transform: translateY(-18px);
}

.logo.logo-revealed {
    opacity: 1;
    transform: translateY(0);
    animation: logoBounce 2.2s ease-in-out infinite;
}

.logo:hover {
    animation: none;
    transform: scale(1.12);
    color: var(--blue);
    text-shadow: 2px 2px 0 var(--yellow);
}

@keyframes logoReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes logoBounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0) scale(1); }
    40% { transform: translateY(-10px) scale(1); }
    60% { transform: translateY(-4px) scale(1); }
}

.logo-wrap:hover .logo.logo-revealed {
    animation: logoBounce 1.4s ease-in-out infinite;
}

.logo-wrap:hover .logo:hover {
    animation: none;
}

/* Colorful sprinkles around logo */
.logo-sprinkle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transform: scale(0);
    animation: sprinklePop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.logo-sprinkle-1 { width: 6px; height: 6px; background: var(--pink);    top: -2px;  left: -8px;  animation-delay: 0.25s; }
.logo-sprinkle-2 { width: 5px; height: 5px; background: var(--yellow); top: -6px;  right: 12px; animation-delay: 0.35s; }
.logo-sprinkle-3 { width: 5px; height: 5px; background: var(--blue);   bottom: 2px; left: -4px;  animation-delay: 0.45s; }
.logo-sprinkle-4 { width: 4px; height: 4px; background: var(--green);  bottom: -4px; right: 8px;  animation-delay: 0.55s; }
.logo-sprinkle-5 { width: 5px; height: 5px; background: #FF5722;       top: 4px;   right: -6px;  animation-delay: 0.4s; }

@keyframes sprinklePop {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Floating toy icons around logo */
.logo-toy {
    position: absolute;
    font-size: 0.85rem;
    line-height: 1;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    animation: toyFloatIn 0.5s ease-out forwards, toyFloat 3s ease-in-out infinite;
}

.logo-toy-1 { top: -10px;  left: -14px;  animation-delay: 0.4s, 1s; }
.logo-toy-2 { top: -8px;   right: -12px; animation-delay: 0.5s, 1.2s; }
.logo-toy-3 { bottom: -6px; right: -10px; animation-delay: 0.6s, 1.4s; }

@keyframes toyFloatIn {
    to { opacity: 0.9; }
}

@keyframes toyFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-3px) translateX(2px) rotate(5deg); }
    50% { transform: translateY(0) translateX(-1px) rotate(-3deg); }
    75% { transform: translateY(-2px) translateX(1px) rotate(4deg); }
}

.logo img {
    height: 48px;
    width: auto;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
}

.nav-menu a {
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    color: var(--dark);
}

.nav-menu a:hover {
    background: var(--pink-light);
    color: var(--pink);
}

.cart-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: linear-gradient(135deg, var(--pink), #FF5722);
    color: var(--white);
    border-radius: 50px;
    font-weight: 800;
}

.cart-link {
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.cart-link:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

.cart-link.bounce {
    animation: cartBounce 0.55s ease;
}

@keyframes cartBounce {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.35); }
    50% { transform: scale(0.92); }
    75% { transform: scale(1.12); }
}

.cart-count {
    background: var(--white);
    color: var(--pink);
    font-size: 0.85rem;
    padding: 2px 8px;
    border-radius: 20px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
}

/* ========== HERO ========== */
.hero {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, var(--pink-light) 0%, var(--blue-light) 40%, var(--yellow-light) 70%, var(--green-light) 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('https://images.unsplash.com/photo-1503454537195-1dcabb73ffb9?w=1600&q=80') center/cover;
    opacity: 0.25;
    z-index: 0;
    transform: translateY(-100%);
    animation: heroBgSlide 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
}

.hero h1 {
    font-size: clamp(2.2rem, 6vw, 3.5rem);
    color: var(--pink);
    text-shadow: 3px 3px 0 var(--yellow);
    margin-bottom: 12px;
    opacity: 0;
    animation: heroFadeIn 0.7s ease-out 0.2s forwards;
}

.hero .tagline {
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    font-weight: 800;
    color: var(--blue);
    margin-bottom: 28px;
    opacity: 0;
    animation: heroFadeIn 0.7s ease-out 0.45s forwards;
}

.hero .btn-primary {
    opacity: 0;
    animation: heroFadeIn 0.7s ease-out 0.7s forwards;
}

@keyframes heroBgSlide {
    to {
        transform: translateY(0);
    }
}

@keyframes heroFadeIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn-primary {
    display: inline-block;
    padding: 16px 36px;
    background: linear-gradient(135deg, var(--pink), #FF5722);
    color: var(--white);
    font-weight: 800;
    font-size: 1.1rem;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(233, 30, 99, 0.4);
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.btn-primary:hover {
    transform: scale(1.08);
    box-shadow: 0 10px 32px rgba(233, 30, 99, 0.5);
    background: linear-gradient(135deg, #FF5722, var(--pink));
}

/* ========== SECTIONS ========== */
.section {
    padding: 60px 20px;
}

.section-title {
    text-align: center;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    color: var(--pink);
    margin-bottom: 40px;
}

/* ========== FEATURED PRODUCTS ========== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 28px;
}

.product-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 3px solid transparent;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.15);
    border-color: var(--yellow);
}

.product-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-card:hover img {
    transform: scale(1.1);
}

.product-card-body {
    padding: 20px;
}

.product-card h3 {
    font-size: 1.2rem;
    color: var(--dark);
    margin-bottom: 8px;
}

.product-card .price {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--pink);
    margin-bottom: 12px;
}

.btn-add-cart {
    width: 100%;
    padding: 12px;
    background: var(--blue);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s ease;
}

.btn-add-cart:hover {
    background: var(--pink);
    transform: scale(1.03);
}

/* ========== TESTIMONIALS ========== */
.testimonials {
    background: var(--blue-light);
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.testimonial-card {
    background: var(--white);
    padding: 28px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-left: 4px solid var(--pink);
}

.testimonial-card .stars {
    color: var(--yellow);
    font-size: 1.2rem;
    margin-bottom: 12px;
}

.testimonial-card p {
    margin-bottom: 16px;
    font-style: italic;
    color: var(--gray);
}

.testimonial-card .author {
    font-weight: 800;
    color: var(--pink);
}

/* ========== ABOUT PAGE ========== */
.page-hero {
    padding: 50px 20px;
    text-align: center;
    background: linear-gradient(135deg, var(--pink-light), var(--blue-light));
}

.page-hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    color: var(--pink);
    margin-bottom: 8px;
}

.content-block {
    max-width: 800px;
    margin: 0 auto 40px;
}

.content-block h2 {
    font-size: 1.5rem;
    color: var(--blue);
    margin-bottom: 16px;
}

.content-block p {
    margin-bottom: 16px;
    color: var(--dark);
}

/* ========== SHOP PAGE ========== */
.shop-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 32px;
    align-items: start;
}

.filters {
    background: var(--white);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    position: sticky;
    top: 100px;
}

.filters h3 {
    font-size: 1.1rem;
    color: var(--pink);
    margin-bottom: 16px;
}

.filters label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    cursor: pointer;
}

.filters input, .filters select {
    margin-right: 8px;
}

.filter-group {
    margin-bottom: 20px;
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
}

.category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 32px;
    justify-content: center;
}

.category-pills a {
    padding: 10px 20px;
    background: var(--pink-light);
    color: var(--pink);
    border-radius: 50px;
    font-weight: 700;
}

.category-pills a:hover, .category-pills a.active {
    background: var(--pink);
    color: var(--white);
}

/* ========== BLOG PAGE ========== */
.blog-list {
    display: grid;
    gap: 32px;
    max-width: 800px;
    margin: 0 auto;
}

.blog-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 0;
    transition: box-shadow 0.2s;
}

.blog-card:hover {
    box-shadow: 0 8px 28px rgba(0,0,0,0.12);
}

.blog-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.blog-card-body {
    padding: 24px;
}

.blog-card h2 {
    font-size: 1.35rem;
    color: var(--pink);
    margin-bottom: 8px;
}

.blog-card .meta {
    font-size: 0.9rem;
    color: var(--gray);
    margin-bottom: 12px;
}

.blog-card p {
    color: var(--dark);
    margin-bottom: 16px;
}

.read-more {
    font-weight: 700;
    color: var(--blue);
}

.read-more:hover {
    color: var(--pink);
}

.comments {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid var(--pink-light);
}

.comments h3 {
    font-size: 1.2rem;
    color: var(--blue);
    margin-bottom: 16px;
}

.comment {
    background: var(--pink-light);
    padding: 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}

.comment .author {
    font-weight: 800;
    color: var(--pink);
    margin-bottom: 4px;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 12px;
    border: 2px solid var(--blue-light);
    border-radius: var(--radius-sm);
    font-family: inherit;
}

.comment-form button {
    padding: 12px 24px;
    background: var(--blue);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 700;
    cursor: pointer;
}

/* ========== CONTACT PAGE ========== */
.contact-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 48px;
    max-width: 1000px;
    margin: 0 auto;
}

.contact-form {
    background: var(--white);
    padding: 32px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.contact-form label {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--dark);
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 14px;
    margin-bottom: 20px;
    border: 2px solid var(--blue-light);
    border-radius: var(--radius-sm);
    font-family: inherit;
}

.contact-form textarea {
    min-height: 140px;
    resize: vertical;
}

.contact-form button {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--pink), #FF5722);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 800;
    font-size: 1.05rem;
    cursor: pointer;
}

.contact-info {
    background: linear-gradient(135deg, var(--pink-light), var(--blue-light));
    padding: 32px;
    border-radius: var(--radius);
    height: fit-content;
}

.contact-info h3 {
    font-size: 1.25rem;
    color: var(--pink);
    margin-bottom: 20px;
}

.contact-info p {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.contact-info a {
    font-weight: 700;
    color: var(--blue);
}

.contact-info a:hover {
    color: var(--pink);
}

.social-links {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.social-links a {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 800;
    transition: transform 0.2s;
}

.social-links a:hover {
    transform: scale(1.1);
}

.social-links .ig { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743); }
.social-links .fb { background: #1877F2; }
.social-links .tw { background: #1DA1F2; }

/* ========== FOOTER ========== */
.footer {
    background: var(--dark);
    color: var(--white);
    padding: 48px 20px 24px;
    margin-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto 40px;
}

.footer h4 {
    font-size: 1.1rem;
    color: var(--yellow);
    margin-bottom: 16px;
}

.footer ul {
    list-style: none;
}

.footer ul li {
    margin-bottom: 8px;
}

.footer a {
    color: rgba(255,255,255,0.85);
}

.footer a:hover {
    color: var(--white);
}

.newsletter-form {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.newsletter-form input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.1);
    color: var(--white);
    font-family: inherit;
}

.newsletter-form input::placeholder {
    color: rgba(255,255,255,0.6);
}

.newsletter-form button {
    padding: 12px 20px;
    background: var(--pink);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 700;
    cursor: pointer;
}

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.2);
    font-size: 0.9rem;
    color: rgba(255,255,255,0.7);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
    .shop-layout {
        grid-template-columns: 1fr;
    }
    .filters {
        position: static;
    }
    .contact-layout {
        grid-template-columns: 1fr;
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
    .blog-card {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 20px;
        box-shadow: var(--shadow);
    }
    .nav-menu.open {
        display: flex;
    }
    .menu-toggle {
        display: block;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .newsletter-form {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    .shop-grid {
        grid-template-columns: 1fr;
    }
}

/* ========== ANIMATIONS: Scroll reveal ========== */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.reveal-active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ========== ANIMATIONS: Page loader ========== */
.page-loader {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, var(--pink-light), var(--blue-light));
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-spinner {
    width: 52px;
    height: 52px;
    border: 4px solid var(--blue-light);
    border-top-color: var(--pink);
    border-radius: 50%;
    animation: loaderSpin 0.9s linear infinite;
}

.loader-text {
    font-weight: 800;
    color: var(--pink);
    font-size: 1.1rem;
}

@keyframes loaderSpin {
    to { transform: rotate(360deg); }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .hero::before,
    .hero h1,
    .hero .tagline,
    .hero .btn-primary,
    .reveal,
    .product-card img,
    .btn-primary,
    .btn-add-cart,
    .cart-link.bounce,
    .logo,
    .logo-sprinkle,
    .logo-toy {
        animation: none !important;
        transition-duration: 0.01ms !important;
    }
    .reveal {
        opacity: 1;
        transform: none;
    }
    .btn-add-cart:hover {
        transform: none;
    }
    .logo {
        opacity: 1;
        transform: none;
    }
    .logo-sprinkle,
    .logo-toy {
        opacity: 0.8;
        transform: none;
    }
}
