* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: url(pic/background.jpg) center/cover no-repeat fixed;
    font-family: 'Poppins', sans-serif;
    color: #333;
    line-height: 1.6;
    opacity: 0;
    transition: opacity 300ms ease;
}

/* Dark Mode (category) */
body.dark-mode {
    color: #e5e7eb;
    background: #0f172a;
}

body.dark-mode .about-section,
body.dark-mode .product-card {
    background: #111827;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

body.dark-mode .about-text,
body.dark-mode .section-title,
body.dark-mode .product-card h4,
body.dark-mode .product-card .price {
    color: #e5e7eb;
}

.top-nav {
    background: #00A651;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--app-nav-height);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .1);
}

.back-icon {
    width: 24px;
    height: 24px;
    cursor: pointer;
    filter: brightness(0) invert(1);
}

.nav-title {
    color: white;
    font-size: 30px;
    /* Increased font size */
    font-weight: 700;
    /* Bolder font weight */
    margin: 0;
    position: relative;
    letter-spacing: 1.5px;
    overflow: hidden;
    background: linear-gradient(90deg, #ffffff, #98f8ff, #ffffff);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 4s ease-in-out infinite, scaleBounce 3s infinite alternate;
}

@keyframes gradientShift {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

@keyframes scaleBounce {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.cart-icon {
    position: relative;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.cart-icon-img {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ff4757;
    color: #fff;
    font-size: 10px;
    display: none;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

.main-content {
    padding: 0 5px 20px 5px;
}

.hero {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    height: 220px;
    margin: 16px 0;
    background: #ddd center/cover no-repeat;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    animation: fadeInUp .5s ease both;
    background-size: cover;
    background-position: center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, .1), rgba(0, 0, 0, .45));
}

.hero-content {
    position: absolute;
    bottom: 14px;
    left: 16px;
    color: #fff;
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 12px;
    align-items: center;
    z-index: 2;
    /* Ensure content is above overlay */
}

.hero-content h2 {
    font-size: 22px;
    margin-bottom: 6px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, .3);
    grid-column: 2;
}

.hero-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, .75);
    box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
    grid-row: span 2;
    z-index: 3;
    /* Ensure avatar is above overlay */
    background-color: #fff;
    /* Add background in case of transparent images */
    /* Ensure the avatar is always visible */
    min-width: 80px;
    min-height: 80px;
}

.hero-meta .count {
    font-size: 12px;
    opacity: .9;
}

.about-section {
    background: #fff;
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .08);
    margin-bottom: 14px;
    animation: fadeInUp .5s ease .05s both;
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.about-text {
    font-size: 13px;
    color: #555;
}

.products-section {
    margin-top: 6px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.see-all {
    background: transparent;
    border: none;
    color: #00A651;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

/* Product Card Styles matched to products.css - COMMENTED OUT TO USE STANDARD products.cssSTYLES
.product-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .08);
}

.product-image-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 12px;
}

.product-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #00A651;
    box-shadow: 0 6px 20px rgba(0, 166, 81, 0.2);
    transition: transform 0.3s ease;
}

.product-card:hover .product-image {
    transform: scale(1.1) rotate(5deg);
}

.product-name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 8px 0 4px 0;
}

.product-price {
    font-size: 18px;
    font-weight: 700;
    color: #00A651;
    margin-bottom: 8px;
}

.category-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #00A651, #00d46a);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 3px 10px rgba(0, 166, 81, 0.3);
}

.product-card .quick-add {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #00A651;
    color: #fff;
    border: none;
    display: grid;
    place-items: center;
    box-shadow: 0 8px 18px rgba(0, 166, 81, .25);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 26px rgba(0, 0, 0, .12);
}

.no-results {
    display: grid;
    place-items: center;
    color: #6b7280;
    padding: 16px;
}
*/



@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (min-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* Category grouping styles */
.category-section {
    margin-bottom: 24px;
    animation: fadeInUp 0.5s ease both;
}

.category-header {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 16px 4px;
    padding-left: 12px;
    border-left: 4px solid #00A651;
    text-transform: capitalize;
    display: flex;
    align-items: center;
}

body.dark-mode .category-header {
    color: #e5e7eb;
}

/* Nursery Info Styles */
.nursery-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 4px 0 8px 0;
    padding: 6px 0px;
    background: linear-gradient(135deg, rgba(0, 166, 81, 0.08), rgba(0, 212, 106, 0.08));
    border-radius: 20px;
    border: 1px solid rgba(0, 166, 81, 0.15);
}

.nursery-logo-img {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid #00A651;
}

.nursery-name {
    font-size: 9px;
    font-weight: 600;
    color: #00A651;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    max-width: 90px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- HANGING MOON (DARK MODE ONLY) --- */
.hanging-moon-container {
    position: absolute;
    top: 100%;
    /* Attach to bottom of nav */
    right: 70px;
    display: none;
    /* Hidden by default */
    flex-direction: column;
    align-items: center;
    z-index: 1001;
    pointer-events: none;
    transform-origin: top center;
    animation: moonSwing 4s ease-in-out infinite;
}

/* Show only in dark mode */
html.dark-mode .hanging-moon-container,
body.dark-mode .hanging-moon-container {
    display: flex;
}

.rope {
    width: 2px;
    height: 35px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.2));
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
}

.moon {
    width: 32px;
    height: 32px;
    background: radial-gradient(circle at 30% 30%, #fdfcf0, #ebe29d);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(253, 252, 240, 0.4), inset -2px -2px 5px rgba(0, 0, 0, 0.2);
    margin-top: -2px;
}

.moon i {
    font-size: 14px;
    color: #2D3436;
    opacity: 0.3;
}

@keyframes moonSwing {

    0%,
    100% {
        transform: rotate(-5deg);
    }

    50% {
        transform: rotate(5deg);
    }
}

#moonToggle.retracting {
    animation: moonRetract 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards !important;
}

@keyframes moonRetract {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }

    30% {
        transform: translateY(15px) scale(1.1);
        opacity: 1;
    }

    100% {
        transform: translateY(-150px) scale(0.5);
        opacity: 0;
    }
}
