/* ========================================================
   SCROLL ANIMATION CLASSES
   ======================================================== */
.reveal {
    opacity: 0;
    transform: translateY(40px); /* Pushes the element down invisibly */
    transition: all 0.8s ease-out; /* Controls the speed of the slide up */
}
.reveal.show-reveal {
    opacity: 1;
    transform: translateY(0); /* Glides into place */
}

/* ========================================================
   HOME PAGE HERO
   ======================================================== */
.home-hero {
    position: relative;
    width: 100vw; /* THE FIX: Forces the width to match the actual screen */
    margin-left: calc(-50vw + 50%); /* THE FIX: Breaks out of the WordPress center box to the left */
    margin-right: calc(-50vw + 50%); /* THE FIX: Breaks out of the WordPress center box to the right */
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--white);
    padding-bottom: 50px;
}

.hero-image-slider {
    width: 100%;
    max-width: 100% !important; /* THE FIX: Removes the old 1200px limit */
    height: 500px !important; /* THE FIX: Locks the height to exactly 500px */
    background-color: #4CAF50;
    background-image: url('https://www.camagriculture.com/wp-content/uploads/2026/11/Website-Wallpaper.png');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 120px;
    animation: fadeInBackground 1.5s ease-in-out;
    transition: background-image 0.8s ease-in-out;
}

.slider-dots {
    display: flex;
    gap: 8px;
}

.slider-dots .dot {
    width: 12px;
    height: 12px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s;
}

.slider-dots .dot.active,
.slider-dots .dot:hover {
    background-color: var(--white);
}

.hero-cards-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: -80px;
    z-index: 10;
    padding: 0;
    max-width: 1200px;
    width: 100%;
    flex-wrap: wrap;
}

.hero-card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 35px 20px;
    text-align: center;
    flex: 1;
    min-width: 280px;
    border: 1px solid var(--border);
    transition: transform 0.3s ease, box-shadow 0.3s ease !important; /* Prepares the WHOLE card for smooth animation */
}

/* --- THE CARD HOVER ANIMATION --- */
.hero-card:hover {
    transform: translateY(-12px) !important; /* Lifts the entire white card up */
    box-shadow: 0 15px 30px rgba(15, 161, 83, 0.2) !important; /* Adds the soft green glow */
}

/* ========================================================
   CUSTOM IMAGE ICON CSS FOR FLOATING CARDS
   ======================================================== */
.hero-card .card-image-icon {
    width: 100px; 
    height: 100px;
    object-fit: contain;
    margin: 0 auto 15px auto; 
    display: block;
    transition: transform 0.4s ease !important; /* Prepares the image for a smooth zoom */
}

/* --- THE IMAGE ZOOM ANIMATION --- */
.hero-card:hover .card-image-icon {
    transform: scale(1.15) !important; /* Zooms the bottle slightly when you hover anywhere on the card */
}

@media (max-width: 900px) {
    .hero-card .card-image-icon {
        width: 75px;
        height: 75px;
        margin-bottom: 10px;
    }
}

.hero-card h3 {
    font-family: var(--font-khmer);
    font-size: 20px;
    color: var(--text);
    margin-bottom: 15px;
    font-weight: 700;
}

.hero-card p {
    font-family: var(--font-khmer);
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 25px;
    line-height: 1.6;
}

.btn-green {
    background-color: var(--brand-green);
    color: var(--white);
    padding: 10px 30px;
    border-radius: 5px;
    text-decoration: none;
    font-family: var(--font-khmer);
    font-weight: 700;
    display: inline-block;
    transition: background-color 0.3s ease;
}

.btn-green:hover,
.btn-green:visited,
.btn-green:active {
    background-color: #008b45;
    color: var(--white);
}

@keyframes fadeInBackground {
    0% {
        opacity: 0;
        transform: scale(1.02);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* -------MOBILE RESPONSIVE FIXES (HERO SECTION)------------*/
@media (max-width: 900px) {
    .hero-image-slider {
        height: 250px !important;
        min-height: 250px !important;
        padding-bottom: 45px;
        background-position: center;
    }

    .hero-cards-container {
        margin-top: -30px;
        flex-direction: row;
        flex-wrap: nowrap; 
        justify-content: space-between;
        padding: 0 5px;
        box-sizing: border-box;
        gap: 5px; 
    }

    .hero-card {
        width: 33.33%;
        min-width: 0;
        max-width: none;
        box-sizing: border-box;
        margin-bottom: 0;
        padding: 10px 5px;
    }

    .hero-card .card-image-icon {
        width: 50px;
        height: 50px;
        margin-bottom: 8px;
    }

    .hero-card h3 {
        font-size: 11px;
        margin-bottom: 8px;
    }

    .hero-card p {
        display: none; 
    }

    .hero-card .btn-green {
        padding: 5px 2px;
        font-size: 9px;
        width: 100%;
        box-sizing: border-box;
        text-align: center;
    }
}

/* ========================================================
   CUSTOM news section CSS
   ======================================================== */
.home-news {
    background-color: #eef7ed;
    padding: 60px 20px;
    width: 100%;
}

.news-container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-family: var(--font-khmer);
    font-size: 32px;
    font-weight: 700;
    color: #111111;
    margin-bottom: 40px;
}

.news-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.small-news-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.news-card {
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    background: var(--white);
}

.news-image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.news-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.news-card:hover .news-image-wrapper img {
    transform: scale(1.08);
}

.news-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px 15px 15px 15px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    color: var(--white);
}

.featured-card {
    min-height: 380px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.featured-card .news-image-wrapper {
    flex-grow: 1; 
    height: 100%; 
    width: 100%;
}

.featured-card .news-image-wrapper img {
    height: 100%;
    width: 100%;
    object-fit: cover; 
}

.featured-card .news-overlay h3 {
    font-family: var(--font-khmer);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.5;
    margin: 0;
}

.small-card {
    min-height: 180px;
}

.small-card .news-overlay h3 {
    font-family: var(--font-khmer);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
}

.news-btn-wrapper {
    text-align: center;
    margin-top: 35px;
}

@media (max-width: 900px) {
    .news-grid {
        grid-template-columns: 1fr;
    }
    .featured-card {
        min-height: 280px;
    }
}

@media (max-width: 550px) {
    .small-news-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .small-news-grid .news-card:nth-child(n+3) {
        display: none;
    }
    .small-card {
        min-height: 150px;
    }
    .small-card .news-overlay {
        padding: 20px 10px 10px 10px;
    }
    .small-card .news-overlay h3 {
        font-size: 11px;
        line-height: 1.4;
    }
}

/* ========================================================
   products section CSS
   ======================================================== */
.home-products {
    background-color: var(--white);
    padding: 60px 20px;
    width: 100%;
}

.products-container {
    max-width: 1200px;
    margin: 0 auto;
}

.products-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 30px;
}

.section-title-left {
    font-family: var(--font-khmer);
    font-size: 32px;
    font-weight: 700;
    color: #111111;
    margin: 0;
}

.view-all-link {
    font-family: var(--font-khmer);
    color: var(--brand-green);
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    transition: color 0.3s ease;
}

.view-all-link:hover {
    color: #008b45;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
}

/* --- THE FIX: GLOBAL PRODUCT CARD ALIGNMENT --- */
.product-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 15px;
    position: relative;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important; /* FIX: Forces the card to stretch on all screens */
    box-sizing: border-box !important; 
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.product-card:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-5px);
}

.product-tag {
    position: absolute;
    top: -10px;
    left: 10px;
    color: var(--white);
    font-family: var(--font-khmer);
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.tag-green { background-color: var(--brand-green); }
.tag-orange { background-color: #f39c12; }
.tag-blue { background-color: #2980b9; }

.product-image {
    width: 100%;
    height: 140px;
    object-fit: contain;
    margin-top: 15px;
    margin-bottom: 15px;
}

.product-card h4 {
    font-family: var(--font-khmer);
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 10px 0;
    text-align: center;
}

.product-card p {
    font-family: var(--font-khmer);
    font-size: 11px;
    color: var(--muted);
    line-height: 1.5;
    margin: 0 0 15px 0;
    text-align: center;
    flex-grow: 1; /* Pushes the footer down on desktop */
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #eee;
    padding-top: 10px;
    margin-top: auto !important; /* Absorbs ALL empty space and snaps to the bottom globally */
    width: 100%;
    box-sizing: border-box;
}

.product-weight {
    font-size: 12px;
    font-weight: 600;
    color: #555;
}

.btn-call-now {
    background-color: var(--brand-yellow-soft);
    color: #111;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

/* --- UPGRADED PRODUCT CARD HOVER ANIMATION --- */
.product-card:hover {
    box-shadow: 0 15px 30px rgba(15, 161, 83, 0.15) !important; /* Adds a beautiful soft green glow */
    transform: translateY(-8px) !important; /* Makes the card float up slightly higher */
}

.product-image {
    width: 100%;
    height: 140px;
    object-fit: contain;
    margin-top: 15px;
    margin-bottom: 15px;
    transition: transform 0.4s ease; /* Prepares the image for a smooth zoom */
}

/* --- THE IMAGE ZOOM EFFECT --- */
.product-card:hover .product-image {
    transform: scale(1.12); /* Zooms the product image in when the card is hovered */
}

@media (max-width: 1100px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 15px;
        row-gap: 20px;
    }
}

@media (max-width: 650px) {
    .products-header {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    .products-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
        row-gap: 20px !important;
    }
    .product-card {
        padding: 10px 5px !important;
        display: flex !important;
        flex-direction: column !important;
        height: 100% !important;
    }
    .product-tag {
        font-size: 8px !important;
        padding: 2px 4px !important;
        top: -6px !important;
        left: 5px !important;
    }
    .product-image {
        height: 70px !important;
        margin-top: 10px !important;
        margin-bottom: 5px !important;
    }
    .product-card h4 {
        font-size: 11px !important;
        margin-bottom: 5px !important;
        flex-grow: 1 !important; /* BULLETPROOF FIX: Forces the title to stretch and push footer to the bottom on mobile */
        display: flex;
        align-items: flex-start;
        justify-content: center;
    }
    .product-card p {
        display: none !important;
    }
    .product-footer {
        flex-direction: column !important;
        gap: 5px !important;
        padding-top: 8px !important;
        margin-top: auto !important; /* BULLETPROOF FIX: Safely glued to the bottom */
        width: 100% !important;
    }
    .product-weight {
        font-size: 10px !important;
    }
    .btn-call-now {
        font-size: 8px !important;
        padding: 5px !important;
        width: 100% !important;
        text-align: center !important;
        box-sizing: border-box !important;
    }
}
/* ========================================================
   END products section CSS
   ======================================================== */

/* ========================================================
   Video Slider Section CSS
   ======================================================== */
.home-3d-video-slider {
    background-color: var(--white);
    padding: 70px 20px;
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.video-container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.videoSwiper {
    width: 100%;
    padding-top: 30px;
    padding-bottom: 50px;
    padding-left: 60px;
    padding-right: 60px;
    box-sizing: border-box;
}

.videoSwiper .swiper-slide {
    width: 500px;
    max-width: 70vw;
    aspect-ratio: 16 / 9;
    height: auto;
    background: var(--white);
    border-radius: 12px;
    box-sizing: border-box;
    padding: 10px;
    border: 1px solid #d1d1d1;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    position: relative;
}

.videoSwiper .swiper-slide img,
.videoSwiper .swiper-slide iframe {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.slide-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--brand-green);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.slide-play-btn i {
    margin-left: 4px;
}

.videoSwiper .swiper-slide:hover .slide-play-btn {
    background-color: var(--white);
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.videoSwiper .swiper-button-next,
.videoSwiper .swiper-button-prev {
    color: #000000;
    background: transparent;
    box-shadow: none;
}

.videoSwiper .swiper-button-prev { left: 0; }
.videoSwiper .swiper-button-next { right: 0; }

.videoSwiper .swiper-button-next:after,
.videoSwiper .swiper-button-prev:after {
    font-size: 45px;
    font-weight: 900;
}

@media (max-width: 768px) {
    .home-3d-video-slider {
        padding: 40px 10px;
    }
    .videoSwiper {
        padding-left: 30px;
        padding-right: 30px;
    }
    .videoSwiper .swiper-slide {
        width: 250px;
        padding: 5px;
    }
    .slide-play-btn {
        width: 45px;
        height: 45px;
        font-size: 16px;
    }
    .videoSwiper .swiper-button-next:after,
    .videoSwiper .swiper-button-prev:after {
        font-size: 25px;
    }
}
/* ========================================================
   partner section CSS
   ======================================================== */

.home-partners {
    background-color: var(--white);
    padding: 60px 20px 80px 20px;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
}

/* .partners-container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
} */
 .partners-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center; /* Centers the logos horizontally */
    align-items: center;
    gap: 50px;               /* Adjust spacing between logos */
    flex-wrap: wrap;
}

.home-partners .section-title {
    font-family: var(--font-khmer);
    font-size: 38px;
    font-weight: 700;
    color: #243d25;
    margin-bottom: 40px;
}

.partnerSwiper {
    width: 100%;
    padding: 20px 50px;
    box-sizing: border-box;
}

.partnerSwiper .swiper-slide {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100px;
}

.partnerSwiper .swiper-slide img {
    max-width: 100%;
    max-height: 80px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.partnerSwiper .swiper-slide img:hover {
    transform: scale(1.1);
}

.partner-next,
.partner-prev {
    color: #e0e0e0 !important;
    background: transparent;
    transition: color 0.3s ease;
}

.partner-next:after,
.partner-prev:after {
    font-size: 24px !important;
    font-weight: bold;
}

.partner-next:hover,
.partner-prev:hover {
    color: var(--brand-green) !important;
}

@media (max-width: 768px) {
    .home-partners {
        padding: 40px 10px;
    }
    .home-partners .section-title {
        font-size: 28px;
        margin-bottom: 20px;
    }
    .partnerSwiper {
        padding: 10px 30px;
    }
}



/* ========================================================
   FULLSCREEN VIDEO LIGHTBOX (POPUP)
   ======================================================== */
.video-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 9999999;
    display: none;
    justify-content: center;
    align-items: center;
}

.video-lightbox.show {
    display: flex;
}

.lightbox-content {
    width: 95%;
    max-width: 1000px;
    aspect-ratio: 16 / 9;
    background: #000000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    position: relative;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #ffffff;
    font-size: 40px;
    cursor: pointer;
    z-index: 10000000;
    transition: color 0.3s ease;
}

.lightbox-close:hover {
    color: #0fa153;
}

/* ========================================================
   MOBILE CUT-OFF FIX (PREVENTS HORIZONTAL SCROLLING)
   ======================================================== */
@media (max-width: 900px) {
    html, body {
        overflow-x: hidden !important;
        width: 100%;
        position: relative;
    }

    .home-news,
    .home-products,
    .news-container,
    .products-container,
    .home-team-slider,
    .home-3d-video-slider {
        box-sizing: border-box !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    .products-grid,
    .news-grid {
        box-sizing: border-box !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
        width: 100% !important;
    }
}
