/* ========== BASE & LAYOUT ========== */
body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: Arial;
    background: url('../../images/Lime Plant Crop 3.PNG'); /* BACKGROUND: Main page background image */
    background-size: cover;
    color: #000000; /* COLOR: Main text color */
}

.wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ========== HEADER ========== */
header {
    background: royalblue; /* BACKGROUND: Header bar */
    padding: 3rem;
    text-align: center;
    font-size: 1.5rem;
    letter-spacing: 5px;
    font-family: Brush Script;
    position: relative;
}

header img {
    height: 140px;
    position: absolute;
    top: .5rem;
    left: 1rem;
}

/* ========== MAIN NAVIGATION ========== */
header nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2rem;
    margin-top: 1rem;
}

header nav a {
    display: inline-block;
    margin: 0 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.2); /* BACKGROUND: Nav link background (semi-transparent white) */
    border: 2px solid #fff; /* COLOR: Nav link border (white) */
    border-radius: 6px;
    color: #fff; /* COLOR: Nav link text (white) */
    text-decoration: none;
    font-weight: bold;
    transition: background 0.2s, color 0.2s;
}

header nav a:hover {
    background: #fff; /* BACKGROUND: Nav link hover (solid white) */
    color: #2E8B57;   /* COLOR: Nav link hover text (sea green) */
}

/* ========== MAIN CONTENT ========== */
main {
    flex: 1;
    margin: 2rem auto;
    max-width: 1500px;
    background: rgba(255, 255, 255, 0.3); /* BACKGROUND: Main content (semi-transparent white) */
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); /* COLOR: Main content shadow */
}

/* ========== SLIDE-IN SECTION ANIMATION ========== */
.slide-section {
    opacity: 0;
    transform: translateX(60px);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.23, 1, 0.32, 1);
    will-change: opacity, transform;
    background: rgba(255,255,255,0.7); /* BACKGROUND: Section (semi-transparent white) */
    border-left: 6px solid #2e8b57;   /* COLOR: Section accent border (sea green) */
    border-radius: 8px;
    margin: 2rem 0;
    padding: 1.5rem 2rem;
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.07); /* COLOR: Section shadow */
}
.slide-section.in-view {
    opacity: 1;
    transform: none;
}

/* ========== PRODUCT TABS NAVIGATION ========== */
.product-tabs {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    background: url('/images/grass-bg.jpg') center/cover no-repeat, #f6f8fa; /* BACKGROUND: Grass image + fallback */
    border-radius: 8px;
    border: 1px solid #d1d9e6; /* COLOR: Tabs border (light blue-gray) */
    padding: 0.75rem 0;
    margin: 1.5rem 0 2rem 0;
    font-size: 1.05rem;
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.04); /* COLOR: Tabs shadow */
}

.product-tabs a {
    color: #23406e; /* COLOR: Product tab text (dark blue) */
    text-decoration: none;
    padding: 0.4rem 1.1rem;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s, opacity 0.2s;
    font-weight: 500;
    opacity: 0.85;
    cursor: not-allowed;
}

.product-tabs a:not(.disabled):hover,
.product-tabs a:not(.disabled):focus {
    background: #e3edfa; /* BACKGROUND: Tab hover (light blue) */
    color: #1a2a4a;      /* COLOR: Tab hover text (darker blue) */
    opacity: 1;
    cursor: pointer;
    outline: none;
}

.product-tabs a.disabled {
    background: #f0f1f3; /* BACKGROUND: Disabled tab (light gray) */
    color: #a0a7b8;      /* COLOR: Disabled tab text (gray-blue) */
    cursor: not-allowed;
    opacity: 0.6;
}

/* ========== TABLE & IMAGE ROW ========== */
.table-image-row {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    margin: 2rem 0;
}

.table-image-row .table-side-image {
    max-width: 300px;
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.08); /* COLOR: Image shadow */
    object-fit: cover;
}

/* ========== IMAGE CAROUSEL ========== */
.image-carousel {
    position: relative;
    width: 500px;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.08); /* COLOR: Carousel shadow */
    background: #fff; /* BACKGROUND: Carousel */
    margin-left: 5rem; /* LAYOUT: Space to the left of carousel */
}

.carousel-img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
}

.carousel-img.active {
    opacity: 1;
    pointer-events: auto;
}

.carousel-controls {
    position: absolute;
    bottom: 10px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
    z-index: 2;
}

.carousel-controls button {
    background: rgba(44, 62, 80, 0.7); /* BACKGROUND: Carousel button (dark blue, semi-transparent) */
    color: #fff; /* COLOR: Carousel button text */
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.2s;
}

.carousel-controls button:hover {
    background: #2e8b57; /* BACKGROUND: Carousel button hover (sea green) */
}

/* ========== LIGHTBOX FOR CAROUSEL IMAGES ========== */
.carousel-lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0; top: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85); /* BACKGROUND: Carousel lightbox overlay */
    justify-content: center;
    align-items: center;
}
.carousel-lightbox.active {
    display: flex;
}
.carousel-lightbox img {
    max-width: 98vw;
    max-height: 96vh;
    border-radius: 10px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.4); /* COLOR: Lightbox image shadow */
    display: block;
}
.carousel-lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    color: #fff; /* COLOR: Lightbox close button */
    font-size: 3rem;
    text-decoration: none;
    font-weight: bold;
    z-index: 10000;
    cursor: pointer;
    transition: color 0.2s;
}
.carousel-lightbox-close:hover {
    color: #2e8b57; /* COLOR: Lightbox close button hover (sea green) */
}

/* ========== PH MAP LIGHTBOX ========== */
.ph-map-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 2rem 0;
}

.ph-map-img {
    max-width: 100%;
    width: 450px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(44,62,80,0.12); /* COLOR: Map image shadow */
    display: block;
}

.ph-map-caption {
    text-align: center;
    font-size: 0.95rem;
    color: #23406e; /* COLOR: Caption text */
    margin-top: 0.5rem;
}

.ph-map-lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0; top: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85); /* BACKGROUND: Lightbox overlay (dark) */
    justify-content: center;
    align-items: center;
}
.ph-map-lightbox:target {
    display: flex;
}
.ph-map-lightbox img {
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
    border-radius: 10px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.4); /* COLOR: Lightbox image shadow */
    display: block;
}
.ph-map-lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    color: #fff; /* COLOR: Lightbox close button */
    font-size: 3rem;
    text-decoration: none;
    font-weight: bold;
    z-index: 10000;
    transition: color 0.2s;
}
.ph-map-lightbox-close:hover {
    color: #2e8b57; /* COLOR: Lightbox close button hover (sea green) */
}

/* ========== DIRECTIONS FLEX (CONTACT PAGE) ========== */
.directions-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 3rem;
    align-items: flex-start;
}

.directions-map {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(44,62,80,0.12);
    flex-shrink: 0;
}

.directions-address {
    max-width: 400px;
}

/* ========== BACK TO TOP BUTTON ========== */
#toTopBtn {
    display: none;
    position: fixed;
    bottom: 40px;
    right: 40px;
    z-index: 99;
    font-size: 1.2rem;
    border: none;
    outline: none;
    background: royalblue; /* BACKGROUND: To Top button */
    color: white;          /* COLOR: To Top button text */
    cursor: pointer;
    padding: 0.7rem 1.2rem;
    border-radius: 50px;
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.15); /* COLOR: To Top button shadow */
    transition: background 0.2s;
}
#toTopBtn:hover {
    background: #2E8B57; /* BACKGROUND: To Top button hover (sea green) */
}

/* ========== FOOTER ========== */
footer {
    width: 100%;
    background: royalblue; /* BACKGROUND: Footer bar */
    color: #fff;           /* COLOR: Footer text */
    text-align: center;
    padding: 1rem 0;
    font-size: 1rem;
    position: relative;
    left: 0;
    bottom: 0;
    box-sizing: border-box;
}

/* Responsive footer for mobile */
@media (max-width: 600px) {
    footer {
        font-size: 0.9rem;
        padding: 0.5rem 0.2rem;
    }
}

/* ========== RESPONSIVE STYLES ========== */

/* Product Tabs: Stack vertically on mobile */
@media (max-width: 600px) {
    .product-tabs {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        padding: 0.5rem 0.5rem;
        font-size: 1rem;
    }
    .product-tabs a {
        display: block;
        width: 100%;
        text-align: center;
        padding: 0.7rem 0.5rem;
        font-size: 1.05rem;
    }
}

/* Header, Nav, Main, Footer: Mobile adjustments */
@media (max-width: 600px) {
    header {
        font-size: 1.2rem;
        padding: 0.5rem;
    }

    header img {
        height: 80px;
        position: relative;
        top: 0.5rem;
        left: 0;
    }

    header nav {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
        margin-top: 0.5rem;
    }

    header nav a {
        width: 50%;
        text-align: center;
        font-size: 1rem;
        padding: 0.75rem 0;
    }

    main {
        margin: 1rem;
        padding: 1rem;
        max-width: 100%;
        font-size: 1rem;
    }

    footer {
        font-size: 0.9rem;
        padding: 0.5rem;
    }
}

/* Table & Image Row: Stack on smaller screens */
@media (max-width: 900px) {
    .table-image-row {
        flex-direction: column;
        align-items: center;
    }
    .table-image-row .table-side-image {
        max-width: 90vw;
        margin-top: 1rem;
    }
    .image-carousel {
        margin-left: 0;
        margin-top: 2rem;
        width: 90vw;
        max-width: 400px;
        height: 250px;
    }
}

/* Even smaller screens: further reduce carousel size */
@media (max-width: 600px) {
    .image-carousel {
        width: 98vw;
        max-width: 98vw;
        height: 180px;
    }
    .carousel-controls button {
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }
    .table-image-row {
        margin: 1rem 0;
    }
    table {
        font-size: 0.95rem;
    }
}

/* ========== SPECIFIC PAGE STYLES ========== */

/* Products Page: Background and layout */
.products-page {
    background: lightgrey;
    background-size: cover;
}