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

body {
    background: url("https://wsrv.nl/?url=https://florianbd.com/pic/1.jpg&output=webp&q=70&blur=5&w=1920");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    font-family: 'Poppins', sans-serif;
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Prevent body scroll, content scrolls internally */
    position: relative;
    text-rendering: optimizeLegibility;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}


body.loaded {
    opacity: 1;
}

/* Dark Mode Base */
html.dark-mode,
body.dark-mode {
    color: #e5e7eb;
    background: #0f172a;
    /* fallback under background image */
}

/* Ensure body background is dark on home */
html.dark-mode body,
body.dark-mode {
    background: #0f172a !important;
    background-image: none !important;
}

/* Inputs and slider in dark mode */
body.dark-mode .search-input {
    background: #0b1220;
    color: #e5e7eb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

body.dark-mode .news-card {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

/* Main Navigation Layout handled at the bottom of the file */

/* Glassmorphic Scroll Indicator */
.scroll-progress-container {
    position: fixed;
    top: 61px;
    /* Directly under the fixed nav */
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 1001;
    pointer-events: none;
}

.scroll-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00A651, #00ff87);
    box-shadow: 0 0 10px rgba(0, 255, 135, 0.5);
    transition: width 0.15s ease-out;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.2));
}

.nav-left .nav-title {
    color: white;
    font-size: 26px;
    font-weight: 700;
    margin: 0;
    transition: color 0.3s ease;
}

.nav-left i {
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.nav-left i:hover {
    transform: scale(1.1);
}

.nav-left .back-icon {
    width: 24px;
    height: 24px;
    cursor: pointer;
    transition: transform 0.2s ease;
    filter: brightness(0) invert(1);
    /* Makes the image white */
}

.nav-left .back-icon:hover {
    transform: scale(1.1);
}

.nav-center {
    flex: 1;
    display: flex;
    justify-content: center;
    margin: 0 5px;
}

.search-container {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 15px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    z-index: 2;
}

.search-input {
    width: 100%;
    padding: 12px 85px 12px 45px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 110px;
    background-color: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-size: 14px;
    color: #fff;
    outline: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-input:focus {
    background-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* High-Tech Search Icons */
.search-extra-icons {
    position: absolute;
    right: 15px;
    display: flex;
    gap: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    z-index: 2;
}

.search-extra-icons i {
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-extra-icons i:hover {
    color: #fff;
    transform: scale(1.2);
}

.nav-right {
    display: flex;
    align-items: center;
}

.chat-icon-container {
    position: relative;
    left: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.chat-icon-container:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.2);
}

.chat-icon-img {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1);
}

.nav-right .chat-icon {
    width: 42px;
    /* Slightly increased size */
    height: 42px;
    /* Slightly increased size */
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    /* Smooth transition for all properties */
}

/* Chat styles refined... */

/* Greeting Section */
.greeting-section {
    padding: 0px 0 0px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.greeting-text h2 {
    color: white;
    font-size: 20px;
    font-weight: 700;
    margin: -7px 0px;
}

.greeting-text p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    margin: 4px 0 0;
}

.weather-widget {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 10px 18px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.weather-widget:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.3);
}

.weather-info {
    text-align: right;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.temp {
    color: white;
    font-weight: 800;
    font-size: 18px;
    line-height: 1;
    margin-bottom: 2px;
}

.condition {
    color: rgba(255, 255, 255, 0.9);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.weather-icon {
    font-size: 28px;
    color: #ffd700;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.4));
    animation: weatherIconFloat 3s ease-in-out infinite;
}

@keyframes weatherIconFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.05) 25%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(255, 255, 255, 0.05) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.news-skeleton {
    width: 100%;
    height: 150px;
    border-radius: 75px;
}

.category-skeleton {
    min-width: 85px;
    height: 115px;
    /* Matched to img + text height */
    border-radius: 15px;
    /* More card-like for better visualization */
    flex-shrink: 0;
}

.nursery-skeleton {
    min-width: 75px;
    height: 105px;
    /* Matched to img + text height */
    border-radius: 15px;
    flex-shrink: 0;
}

.product-card-skeleton {
    width: 100%;
    height: 380px;
    /* Matched to standard product card height */
    border-radius: 20px;
}

/* Main Content */
/* Main Content - Independent Scrollable Area */
.main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    padding: 20px;
    padding-bottom: 20px;
    z-index: 1;
}

/* Force bottom nav to participate in layout (separation) */
#footerContainer,
.bottom-nav {
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    flex-shrink: 0;
    width: 100%;
    z-index: 3000;
}


/* Section Titles */
/* Neon Section Titles with Glitch */
.section-title {
    font-size: 22px;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
    letter-spacing: 1px;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
    position: relative;
    cursor: default;
}

.section-title:hover {
    text-shadow: 0 0 10px rgba(0, 255, 135, 0.5), 0 0 20px rgba(0, 255, 135, 0.2);
}



.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0px;
    margin-bottom: 5px;
    width: 100%;
    cursor: pointer;
}

.view-all {
    color: #00A651;
    font-weight: 600;
    font-size: 13px;
    background: rgba(255, 255, 255, 0);
    padding: 6px 15px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;

}

.view-all:hover {
    background: #00A651;
    color: #fff;
    transform: translateX(3px);
}

.view-all i {
    font-size: 10px;
}

/* Ambient Glow Slider */
.news-slider-wrapper {
    position: relative;
    margin-bottom: 25px;
    min-height: 150px;
    /* Reserve space for slider */
}

.ambient-glow {
    position: absolute;
    top: 10%;
    left: 10%;
    right: 10%;
    bottom: 10%;
    background: #00A651;
    filter: blur(40px);
    opacity: 0.15;
    z-index: 1;
    border-radius: 500px;
    transition: background 0.8s ease;
}

.news-slider {
    position: relative;
    height: 150px;
    overflow: hidden;
    border-radius: 500px;
    z-index: 5;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.news-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
    /* Smoother transition for news cards */
    background: linear-gradient(135deg, #00A651, #008f45);
    border-radius: 500px;

}

/* Dark Mode: cards and text on home */
html.dark-mode .section-title,
body.dark-mode .section-title {
    color: #e5e7eb;
}

html.dark-mode .category-item span,
html.dark-mode .nursery-item span,
body.dark-mode .category-item span,
body.dark-mode .nursery-item span {
    color: #e5e7eb;
}

.news-card.active {
    opacity: 1;
    transition: opacity 0.6s ease-in-out;
    /* Ensure active state also has smooth transition */
}

.news-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 20px;
}

.news-text {
    flex: 1;
    color: white;
}

.plant-name {
    font-size: 26px;
    /* Increased font size for impact */
    font-weight: 700;
    margin-bottom: 6px;
    /* Adjusted margin */
    text-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
    /* Enhanced text shadow */
}

.plant-price {
    font-size: 17px;
    /* Slightly increased font size */
    font-weight: 500;
    /* Adjusted font weight */
    opacity: 0.95;
    /* Slightly increased opacity */
}

.news-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 5px solid rgba(255, 255, 255, 0.4);
    /* Slightly thicker and more opaque border */
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.5s ease;
}

/* Scanning Effect */
.news-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    z-index: 3;
    pointer-events: none;
    animation: scanLine 4s infinite linear;
}

@keyframes scanLine {
    0% {
        left: -100%;
    }

    100% {
        left: 200%;
    }
}

/* Futuristic Expiry Badge */
.expiry-badge {
    position: absolute;
    top: 105px;
    right: 90px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 8px 16px;
    border-radius: 30px;
    border: 1px solid rgba(0, 166, 81, 0.5);
    color: #00ff7f;
    font-size: 12px;
    font-weight: 700;
    z-index: 25;
    box-shadow: 0 0 15px rgba(0, 255, 127, 0.3), inset 0 0 10px rgba(0, 255, 127, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: badgeGlow 3s infinite alternate;
}

@keyframes badgeGlow {
    from {
        box-shadow: 0 0 10px rgba(0, 255, 127, 0.2);
        border-color: rgba(0, 166, 81, 0.3);
    }

    to {
        box-shadow: 0 0 20px rgba(0, 255, 127, 0.5);
        border-color: rgba(0, 255, 127, 0.8);
    }
}

.expiry-badge i {
    font-size: 12px;
    animation: rotateClock 5s infinite linear;
}

@keyframes rotateClock {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Expired Card State - Super Futuristic "Power Down" */
.news-card--expired {
    position: relative;
    pointer-events: none;
    transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.news-card--expired::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 30%, rgba(0, 0, 0, 0.8) 100%),
        rgba(20, 0, 0, 0.3);
    pointer-events: none;
    z-index: 4;
    border-radius: 500px;
}

.news-card--expired .news-image img {
    filter: saturate(0) brightness(0.3) contrast(1.2);
    transform: scale(0.98);
}

.news-card--expired .news-text {
    opacity: 0.3;
    filter: blur(1px);
    transform: scale(0.95);
    transition: all 1s ease;
}

.news-card--expired .expiry-badge {
    background: rgba(255, 0, 0, 0.2);
    border-color: #ff3b30;
    color: #ff3b30;
    box-shadow: 0 0 15px rgba(255, 59, 48, 0.5);
    animation: none;
}

/* Cyberpunk Expired Ribbon */
.expired-ribbon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-5deg);
    background: #ff3b30;
    color: white;
    padding: 12px 40px;
    font-weight: 900;
    font-size: 18px;
    letter-spacing: 4px;
    text-transform: uppercase;
    box-shadow: 0 0 30px rgba(255, 59, 48, 0.8), inset 0 0 15px rgba(0, 0, 0, 0.3);
    z-index: 6;
    white-space: nowrap;
    border-radius: 2px;
    border-left: 5px solid white;
    border-right: 5px solid white;
    animation: ribbonGlow 1.5s infinite alternate;
}

@keyframes ribbonGlow {
    from {
        opacity: 0.8;
        transform: translate(-50%, -50%) rotate(-5deg) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) rotate(-5deg) scale(1.05);
        text-shadow: 0 0 10px white;
    }
}

/* Slider Dots */
.slider-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
    /* Smooth transition for all properties */
}

.dot.active {
    background-color: #00A651;
    transform: scale(1.3);
    /* Slightly increased scale for active dot */
    box-shadow: 0 0 0 3px rgba(0, 166, 81, 0.3);
    /* Added subtle shadow */
    transition: all 0.3s ease;
    /* Ensured smooth transition for active dot */
}

/* Category Section */
.category-section {
    margin-bottom: 30px;
}

.category-scroll {
    display: flex;
    gap: 25px;
    overflow-x: auto;
    padding: 5px 10px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    min-height: 115px;
    /* Reserve space for categories */
}

.category-scroll::-webkit-scrollbar {
    display: none;
}

/* Category Section */
.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    min-width: 85px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    padding: 8px;
}

.category-item:hover {
    transform: translateY(-5px);
}

.category-item img {
    width: 85px;
    height: 85px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.18);
    transition: all 0.4s ease;
}

.category-item:hover img {
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3);
    transform: scale(1.05);
}

.category-item span {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    text-align: center;
}

/* Nursery Section */
.nursery-section {
    margin-bottom: 30px;
}

.nursery-scroll {
    display: flex;
    gap: 35px;
    overflow-x: auto;
    padding: 5px 10px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    min-height: 105px;
    /* Reserve space for nurseries */
}

.nursery-scroll::-webkit-scrollbar {
    display: none;
}

.nursery-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    /* Adjusted gap */
    min-width: 75px;
    /* Slightly increased min-width */
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    /* Ensured smooth transition for all properties */
    padding: 8px;
    /* Added padding for better hover area */
    border-radius: 12px;
    /* Added border-radius */
}

.nursery-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    /* Added subtle shadow on hover */
}

.nursery-item img {
    width: 75px;
    /* Slightly increased size */
    height: 75px;
    /* Slightly increased size */
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.15);
    /* Enhanced shadow */
    transition: all 0.4s ease;
    /* Slightly longer transition for image effects */
}

.nursery-item:hover img {
    border-color: #00A651;
    box-shadow: 0 10px 32px rgba(0, 166, 81, 0.35);
    /* Further enhanced shadow on hover */
    transform: scale(1.05);
}

.nursery-item span {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    text-align: center;
}


/* Strictly Stationary Top Navigation */
.top-nav {
    background-color: #00A651;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    height: 61px;
}



/* Responsive Design */
@media (max-width: 480px) {
    .main-content {
        padding: 0 3px;
        padding-bottom: calc(120px + env(safe-area-inset-bottom));
    }

    .news-content {
        padding: 15px;
    }

    .plant-name {
        font-size: 20px;
    }

    .plant-price {
        font-size: 14px;
    }

    .news-image {
        width: 100px;
        height: 100px;
    }

    .category-item img {
        width: 90px;
        height: 90px;
    }

    .nursery-item img {
        width: 90px;
        height: 90px;
    }

    .section-title {
        margin-top: 0px;
        font-size: 20px;
    }
}

@media (max-width: 360px) {
    .top-nav {
        padding: 12px 15px;
    }

    .search-input {
        font-size: 13px;
        padding: 8px 12px 8px 30px;
    }

    .nav-right .chat-icon {
        width: 35px;
        height: 35px;
    }

    .news-content {
        padding: 12px;
    }

    .plant-name {
        font-size: 18px;
    }

    .news-image {
        width: 90px;
        height: 90px;
    }
}

/* Smooth scrolling for horizontal scrolls */
.category-scroll,
.nursery-scroll {
    scroll-behavior: smooth;
}

/* Loading animation for images */
img {
    transition: opacity 0.3s ease;
}

img[src] {
    opacity: 1;
}

/* Focus states for accessibility */
.search-input:focus,
.nav-item:focus,
.category-item:focus,
.nursery-item:focus {
    outline: 2px solid #00A651;
    outline-offset: 2px;
}

/* Smooth Item Transitions */
.category-item,
.nursery-item,
.product-card,
.news-card {
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
}

.category-item:hover,
.nursery-item:hover,
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.category-item:active,
.nursery-item:active,
.product-card:active {
    transform: scale(0.95);
}

/* Page load fade in up for sections */
.news-section,
.category-section,
.nursery-section,
.products-section {
    animation: fadeInUp 0.8s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-section {
    animation-delay: 0.1s;
}

.nursery-section {
    animation-delay: 0.2s;
}

.products-section {
    animation-delay: 0.3s;
}

/* Loading and error states */
.loading,
.error,
.no-nurseries,
.no-categories {
    text-align: center;
    padding: 20px;
    color: #6b7280;
    font-size: 14px;
}

.loading {
    color: #00A651;
}

.error {
    color: #ef4444;
}

.no-nurseries,
.no-categories {
    color: #6b7280;
}

.error-message {
    text-align: center;
    padding: 40px 20px;
    color: #ef4444;
}

.error-message h2 {
    margin-bottom: 15px;
    color: #dc2626;
}

.error-message p {
    margin-bottom: 20px;
    font-size: 16px;
}

.error-message button {
    padding: 10px 20px;
    background: #00A651;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.error-message button:hover {
    background: #008f45;
}

/* Enhanced Page Loader - Super Smooth & Professional - ZERO LAG */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #00A651 0%, #00d46a 100%);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    perspective: 1000px;
    contain: layout style paint;
}

.page-loader.fade-out {
    opacity: 0;
    transform: scale3d(1.1, 1.1, 1) translateZ(0);
    pointer-events: none;
}

.loader-content {
    text-align: center;
    color: white;
    animation: loaderContentFadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    will-change: transform, opacity;
    transform: translateZ(0);
}

@keyframes loaderContentFadeIn {
    from {
        opacity: 0;
        transform: translate3d(0, 20px, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.loader-logo {
    width: 90px;
    height: 90px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: loaderPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    position: relative;
    will-change: transform, box-shadow;
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.loader-logo::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    animation: loaderRipple 2s cubic-bezier(0, 0.2, 0.8, 1) infinite;
    will-change: transform, opacity;
    transform: translateZ(0);
}

.loader-logo i {
    color: #00A651;
    font-size: 42px;
    animation: loaderIconSpin 3s ease-in-out infinite;
    position: relative;
    z-index: 1;
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.loader-text {
    font-weight: 700;
    font-size: 22px;
    letter-spacing: 3px;
    text-transform: uppercase;
    background: linear-gradient(90deg, #ffffff 0%, rgba(255, 255, 255, 0.7) 50%, #ffffff 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: loaderTextShimmer 2.5s linear infinite;
    will-change: background-position;
    transform: translateZ(0);
}

/* GPU-Optimized Animations - Only transform and opacity */
@keyframes loaderPulse {

    0%,
    100% {
        transform: scale3d(0.95, 0.95, 1) translateZ(0);
    }

    50% {
        transform: scale3d(1.05, 1.05, 1) translateZ(0);
    }
}

@keyframes loaderRipple {
    0% {
        transform: scale3d(0.8, 0.8, 1) translateZ(0);
        opacity: 1;
    }

    100% {
        transform: scale3d(2, 2, 1) translateZ(0);
        opacity: 0;
    }
}

@keyframes loaderIconSpin {

    0%,
    100% {
        transform: rotate3d(0, 0, 1, 0deg) scale3d(1, 1, 1) translateZ(0);
    }

    25% {
        transform: rotate3d(0, 0, 1, -10deg) scale3d(1.1, 1.1, 1) translateZ(0);
    }

    75% {
        transform: rotate3d(0, 0, 1, 10deg) scale3d(0.9, 0.9, 1) translateZ(0);
    }
}

@keyframes loaderTextShimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* Smooth Item Transitions */
.category-item,
.nursery-item,
.product-card,
.news-card {
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
}

.category-item:active,
.nursery-item:active,
.product-card:active {
    transform: scale(0.92) !important;
}

/* Important Laggy Places Improvements */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 30px;
}

.loading::before {
    content: "";
    width: 30px;
    height: 30px;
    border: 3px solid rgba(0, 166, 81, 0.2);
    border-top: 3px solid #00A651;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Dark Mode Transition */
body {
    transition: background-color 0.4s ease, color 0.4s ease, opacity 0.5s ease;
}



/* Flying Add-to-Cart Animation */
.flying-plant {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 50%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Heart Explosion Animation */
.heart-particle {
    position: fixed;
    z-index: 10000;
    pointer-events: none;
    color: #ff4757;
    font-size: 20px;
    animation: heartFly 1s forwards ease-out;
}

@keyframes heartFly {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

/* Pull to Refresh Premium Styles */
.pull-to-refresh-container {
    position: fixed;
    top: -65px;
    left: 0;
    width: 100%;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    pointer-events: none;
    transition: transform 0.2s cubic-bezier(0.2, 0, 0.2, 1), opacity 0.2s ease;
    opacity: 0;
}

.pull-to-refresh-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 166, 81, 0.3);
    border: 1px solid rgba(0, 166, 81, 0.2);
    color: #00A651;
    font-size: 18px;
    transform: rotate(0deg);
}

.pull-to-refresh-container.visible {
    opacity: 1;
}

.pull-to-refresh-container.refreshing .pull-to-refresh-content {
    animation: refreshSpin 0.8s linear infinite;
}

@keyframes refreshSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

body.dark-mode .pull-to-refresh-content {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(0, 255, 135, 0.3);
    box-shadow: 0 4px 20px rgba(0, 255, 135, 0.2);
    color: #00ff87;
}


/* Page Shutter Transition */
.page-shutter {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    pointer-events: none;
}

.shutter-part {
    flex: 1;
    background: #00A651;
    width: 100%;
    transition: transform 0.6s cubic-bezier(0.77, 0, 0.175, 1);
}

.shutter-part.top {
    transform: translateY(-100%);
}

.shutter-part.bottom {
    transform: translateY(100%);
}

.page-shutter.active .shutter-part {
    transform: translateY(0);
    pointer-events: all;
}

/* For Fade-Scale fallback/combination */
.fade-scale-in {
    animation: fadeScaleIn 0.5s forwards ease-out;
}

@keyframes fadeScaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Scroll Reveal Animations */
body .scroll-reveal {
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.8s cubic-bezier(0.165, 0.84, 0.44, 1), transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
    will-change: opacity, transform;
}

body .scroll-reveal.active {
    opacity: 1;
    transform: scale(1);
}

/* Ensure snappy hover effects despite slow reveal transition */
body .scroll-reveal.active:hover {
    transition: all 0.3s ease !important;
}

/* Staggered delays for grids */
.product-card:nth-child(1) {
    transition-delay: 50ms;
}

.product-card:nth-child(2) {
    transition-delay: 100ms;
}

.product-card:nth-child(3) {
    transition-delay: 150ms;
}

.product-card:nth-child(4) {
    transition-delay: 200ms;
}

.product-card:nth-child(5) {
    transition-delay: 50ms;
}

.product-card:nth-child(6) {
    transition-delay: 100ms;
}

.product-card:nth-child(7) {
    transition-delay: 150ms;
}

.product-card:nth-child(8) {
    transition-delay: 200ms;
}

/* Section Header Animation */
.section-header.scroll-reveal {
    transform: translateX(-20px);
}

.section-header.scroll-reveal.active {
    transform: translateX(0);
}

/* Compare Banner */
.compare-banner {
    background: linear-gradient(135deg, #091e3b, #0c2b5e, #1a3c7a);
    border-radius: 70px;
    padding: 25px;
    margin-top: 10px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2), 0 0 20px rgba(50, 100, 255, 0.1);
    color: white;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: bannerGlowCompare 3s infinite alternate;
}

.compare-banner:hover {
    transform: scale(1.02);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.3);
}

@keyframes bannerGlowCompare {
    0% {
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2), 0 0 20px rgba(50, 100, 255, 0.1);
    }

    100% {
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2), 0 0 30px rgba(50, 100, 255, 0.3);
    }
}

/* --- HANGING MOON (DARK MODE ONLY) --- */
.hanging-moon-container {
    position: absolute;
    top: 100%;
    /* Attach to bottom of nav */
    right: 20px;
    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;
    }
}