/* assets/css/style.css */

/* 1. Root Variables & Reset */
:root {
    --primary-green: #27AE60;
    --dark-green: #1D3522;
    --light-green-bg: #F0FDF4;
    --dark-text: #333;
    --light-text: #fff;
    --border-color: #ddd;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    --font-family: 'Poppins', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Universal Overflow Prevention */
html, body {
    overflow-x: hidden;
    width: 100%;
}
/* 2. Base & Typography */
body {
    font-family: var(--font-family);
    line-height: 1.7;
    color: var(--dark-text);
    background-color: #f9f9f9;
}

h1, h2, h3 {
    font-weight: 600;
    color: var(--dark-green);
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
p { margin-bottom: 1rem; }

a {
    color: var(--primary-green);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--dark-green);
}

.wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

img {
    max-width: 100%;
    height: auto;
}

/* 3. Header & Navigation */
.site-header {
    background: var(--light-text);
    padding: 1rem 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-green);
}

nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

nav a {
    color: var(--dark-text);
    font-weight: 600;
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
    transition: border-color 0.3s ease;
}

nav a:hover, nav a.active {
    border-color: var(--primary-green);
}

.hamburger {
    display: none;
    font-size: 2rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--dark-green);
}

/* 4. Main Content & Sections */
main {
    padding: 3rem 0;
}

section.content {
    background: var(--light-text);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

/* 5. Components (Buttons, Forms, Grids, Cards) */
button, input[type="submit"] {
    background: var(--primary-green);
    color: var(--light-text);
    border: none;
    padding: 12px 25px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

button:hover, input[type="submit"]:hover {
    background: var(--dark-green);
    transform: translateY(-2px);
}

form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

input, textarea {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    font-family: var(--font-family);
    transition: border-color 0.3s, box-shadow 0.3s;
    width: 100%;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 5px rgba(39, 174, 96, 0.5);
}

.notice {
    padding: 1rem;
    background: var(--light-green-bg);
    border-left: 5px solid var(--primary-green);
    margin-bottom: 1rem;
    border-radius: 5px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--light-text);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.client-grid .card { padding: 1.5rem; }
.client-grid img {
    width: 100%;
    max-height: 100px;
    object-fit: contain;
    margin-bottom: 1rem;
}

.gallery-grid a { display: block; }
.gallery-grid img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

/* 6. Page Specific: Home */
.hero-slider .swiper-container {
    width: 100%;
    height: 60vh;
    max-height: 550px;
}
.swiper-container {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}
.hero-slider .swiper-slide {
    background-color: #2c3e50;
}
.hero-slider .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hero-text-content {
    background: var(--light-text);
    text-align: center;
    padding: 2.5rem 1.5rem;
    margin: -60px auto 0 auto;
    position: relative;
    z-index: 10;
    max-width: 1000px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}
.hero-text-content h1 {
    color: var(--dark-green);
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}
.hero-text-content p {
    font-size: 1.1rem;
    color: var(--dark-text);
    max-width: 800px;
    margin: 0 auto;
}
.intro { 
    text-align: center; 
    padding-top: 3rem; 
}

/* 7. Footer */
footer {
    background: var(--dark-green);
    color: var(--light-text);
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}
footer p { margin: 0.5rem 0; }

/* 8. Admin Panel Styles */
.login-box {
    max-width: 400px;
    margin: 5rem auto;
    padding: 2rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: var(--shadow);
    text-align: center;
}
.login-box h2 { margin-bottom: 1.5rem; }
.login-box p { margin-top: 1.5rem; font-size: 0.9rem; }

.table-responsive-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    margin-top: 1.5rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}
.admin-table th, .admin-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
.admin-table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

/* 9. Lightbox Styles */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 1rem;
}
.lightbox.active {
    opacity: 1;
    visibility: visible;
}
.lightbox img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 3rem;
    color: #fff;
    cursor: pointer;
    line-height: 1;
}

/* 10. Media Queries for Responsiveness */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    .wrap { padding: 0 1rem; }
    .hamburger { display: block; }
    nav ul {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--light-text);
        box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
        border-top: 1px solid var(--border-color);
        gap: 0;
    }
    nav ul.active { display: flex; }
    nav li { width: 100%; }
    nav a {
        display: block;
        padding: 1rem 1.5rem;
        border-bottom: 1px solid #f0f0f0;
    }
    nav a:hover, nav a.active {
        border-color: transparent;
        background: var(--light-green-bg);
        color: var(--primary-green);
    }
    .hero-text-content {
        margin-top: -40px;
        padding: 2rem 1rem;
    }
    .hero-text-content h1 { font-size: 1.8rem; }
    .hero-slider .swiper-slide img {
        object-fit: contain;
    }
    main { padding: 1.5rem 0; }
    section.content { padding: 1.5rem; }
    .login-box {
        margin: 2rem auto;
        padding: 1.5rem;
        width: 90%;
    }
    .admin-table {
        white-space: normal;
    }
    .admin-table th, .admin-table td {
        padding: 10px;
    }
}

/* 11. Admin Panel Responsive Header */
.admin-header {
    background: #f7f7f7;
}
.admin-header .brand {
    color: var(--light-text);
}
.admin-header nav a {
    color: var(--dark-text);
    opacity: 0.9;
}
.admin-header nav a:hover {
    color: var(--primary-green);
    opacity: 1;
    border-color: var(--primary-green);
}
.admin-header .hamburger {
    color: var(--dark-text);
}
.admin-main {
    padding: 2rem 0;
}

@media (max-width: 768px) {
    .admin-header nav ul {
        background: #f5f5f5;
        box-shadow: 0 10px 15px rgba(0,0,0,0.1);
    }
    .admin-header nav a {
        color: var(--dark-text);
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }
    .admin-header nav a:hover {
        background: #e0e0e0;
        opacity: 1;
    }
    .admin-main {
        padding: 1.5rem 0;
    }
}

/* 12. Page Specific Styles */
.page-about .content {
    background-color: var(--primary-green);
    color: var(--light-text);
}
.page-about .content h1 {
    color: var(--light-text);
}

/* 13. Header Logo Styling */
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-green);
}
.brand:hover {
    color: var(--primary-green);
}
.header-logo {
    max-height: 60px;
    width: 80px;
}
.admin-header .brand {
    color: var(--light-text);
}

/* 14. Pagination Styling */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 2rem;
    flex-wrap: wrap;
}
.pagination a {
    color: var(--dark-text);
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.3s, color 0.3s;
}
.pagination a:hover {
    background-color: var(--light-green-bg);
    border-color: var(--primary-green);
}
.pagination a.active {
    background-color: var(--primary-green);
    color: var(--light-text);
    border-color: var(--primary-green);
    cursor: default;
}
.pagination a.disabled {
    color: #aaa;
    pointer-events: none;
    background-color: #f9f9f9;
}

/* 15. Product Page Styling */
.category-block {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}
.category-block:last-child {
    border-bottom: none;
    margin-bottom: 0;
}
.category-block h2 {
    color: var(--primary-green);
    border-left: 4px solid var(--primary-green);
    padding-left: 1rem;
    margin-bottom: 1.5rem;
}
.product-list {
    list-style-type: none;
    padding-left: 0;
}
.product-list li {
    background-color: var(--light-green-bg);
    padding: 12px 18px;
    margin-bottom: 8px;
    border-radius: 5px;
    border-left: 3px solid var(--primary-green);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.product-list li:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

/* 16. Category Grid Styling */
.category-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}
.category-card {
    text-decoration: none;
    color: var(--dark-text);
    padding: 0;
}
.category-card h3 {
    padding: 1rem 1.5rem;
    margin: 0;
    font-size: 1.2rem;
    color: var(--dark-green);
    transition: color 0.3s ease;
}
.category-card:hover h3 {
    color: var(--primary-green);
}
.category-image-wrapper {
    height: 200px;
    width: 100%;
    overflow: hidden;
}
.category-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.category-card:hover .category-image-wrapper img {
    transform: scale(1.1);
}

/* 17. New Homepage Sections Styling */
.home-section {
    padding: 3rem 0;
    border-top: 1px solid #f0f0f0;
}
.section-title {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
    padding-bottom: 0.5rem;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--primary-green);
}

/*
  THE CODE BELOW THIS LINE WILL BE REPLACED.
  I have commented out the conflicting rules and will replace them with the new, correct ones.
*/

/* 
  DELETED THIS RULE BLOCK BECAUSE IT IS CONFLICTING
.feature-slider {
    padding: 0 40px; 
} 
*/
.feature-card {
    background-color: #f9f9f9;
    padding: 2rem 1.5rem;
    text-align: center;
    border-radius: 8px;
    border: 1px solid #eee;
    height: 100%;
}
.feature-icon {
    max-height: 60px;
    margin-bottom: 1.5rem;
}
.feature-card h3 {
    color: var(--dark-green);
    margin-bottom: 0.5rem;
}
/*
  DELETED THIS RULE BLOCK BECAUSE IT IS CONFLICTING
.category-slider {
    padding: 0 40px;
}
*/
.swiper-button-next, .swiper-button-prev {
    color: var(--primary-green);
}
.how-we-work-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}
.hww-image img {
    width: 100%;
    border-radius: 8px;
    box-shadow: var(--shadow);
}
.advantage-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}
.advantage-item {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}
.advantage-item img {
    max-height: 50px;
}
@media (max-width: 768px) {
    .section-title { font-size: 1.8rem; }
    .how-we-work-section, .advantage-grid {
        grid-template-columns: 1fr;
    }
    /*
      DELETED THIS RULE BLOCK BECAUSE IT IS CONFLICTING
    .feature-slider, .category-slider {
        padding: 0;
    }
    */
}

/*
  ==============================================================
  === ADD THE NEW, CORRECTED CODE BELOW THIS LINE ===
  ==============================================================
*/

/* 18. Slider Wrapper and Arrow Fix */
.slider-wrapper {
    position: relative; /* Crucial for positioning the arrows */
    width: 100%;
    padding: 0 40px; /* Creates space on the sides for the arrows */
    margin: 0 auto;
}

/* We target the arrows specifically within our wrapper */
.slider-wrapper .swiper-button-next,
.slider-wrapper .swiper-button-prev {
    color: var(--primary-green);
}

/* Responsive adjustment for the wrapper on mobile */
@media (max-width: 768px) {
    .slider-wrapper {
        padding: 0; /* Remove side padding on mobile */
    }
}

/* 19. Services Grid Section Styling */
.services-grid {
    display: grid;
    grid-template-columns: 1fr; /* A single column by default for mobile */
    gap: 2.5rem; /* Space between the service items */
}

.service-item {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Two equal columns */
    gap: 2rem;
    align-items: center;
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden; /* Ensures nothing spills out */
}

/* This is the magic for the alternating layout */
.service-item:nth-child(even) .service-image {
    order: -1; /* On even-numbered items (2nd, 4th, etc.), move the image to the first position */
}

.service-text h3 {
    color: var(--primary-green);
    margin-bottom: 1rem;
}

.service-image img {
    width: 100%;
    height: 300px; /* Give the image a fixed height */
    object-fit: cover; /* Make the image fill the space without distortion */
    border-radius: 8px;
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
    .service-item {
        grid-template-columns: 1fr; /* Stack to a single column */
    }

    /* On mobile, we always want the image on top, so we reset the order */
    .service-item:nth-child(even) .service-image {
        order: initial;
    }
}