/* =============================================
   AFRICA FOREST COMPANY - Styles Optimisés
   Structure: Variables > Base > Components > Sections > Responsive
   ============================================= */

/* ========== CSS VARIABLES ========== */
:root {
    --primary-green: #007A33;
    --secondary-green: #009940;
    --dark-green: #005C27;
    --accent-brown: #77554b;
    --light-brown: #a08070;
    --dark-brown: #5a3d35;
    --gold: #C9A962;
    --light-gold: #D4BC7D;
    --cream: #f9f6f3;
    --light-cream: #fdfcfb;
}

/* ========== BASE STYLES ========== */
* {
    font-family: 'Open Sans', sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
}

html {
    scroll-behavior: smooth;
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden !important;
}

/* Prevent any horizontal overflow */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* ========== REUSABLE COMPONENTS ========== */

/* Buttons */
.btn-primary {
    background-color: var(--gold);
    color: var(--dark-green);
    padding: 0.5rem 1.5rem;
    border-radius: 9999px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(201, 169, 98, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary:hover {
    background-color: var(--light-gold);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(201, 169, 98, 0.4);
}

.btn-secondary {
    border: 2px solid white;
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 9999px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
}

.btn-secondary:hover {
    background-color: white;
    color: var(--primary-green);
}

/* Section Badges & Titles */
.section-badge {
    display: inline-block;
    background-color: rgba(0, 122, 51, 0.1);
    color: var(--primary-green);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1.5rem;
}

/* Filter Buttons */
.filter-btn {
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.filter-btn.active {
    background-color: var(--gold);
    color: var(--dark-brown);
}

.filter-btn:not(.active) {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.filter-btn:not(.active):hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Form Elements */
.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #9ca3af;
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    background-color: #374151;
    border: 1px solid #4b5563;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    color: white;
    transition: all 0.3s ease;
}

.form-input::placeholder {
    color: #9ca3af;
}

.form-input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201, 169, 98, 0.2);
}

.form-input.error {
    border-color: #ef4444;
}

/* ========== HERO SECTION ========== */
.hero-bg {
    background: linear-gradient(135deg, rgba(0, 92, 39, 0.85) 0%, rgba(0, 122, 51, 0.80) 50%, rgba(0, 92, 39, 0.85) 100%),
                url('https://images.unsplash.com/photo-1448375240586-882707db888b?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

@media (max-width: 1024px) {
    .hero-bg {
        background-attachment: scroll;
    }
}

/* Stats Cards */
.stat-card {
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    padding: 1.5rem;
    text-align: center;
    color: white;
    border: 1px solid rgba(201, 169, 98, 0.3);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    background-color: rgba(255, 255, 255, 0.15);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 0.5rem;
}

.stat-card-mobile {
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 0.75rem;
    padding: 1rem;
    text-align: center;
    color: white;
    border: 1px solid rgba(201, 169, 98, 0.3);
}

/* ========== DIVIDERS ========== */
.wood-texture-divider {
    height: 8px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--accent-brown) 10%, 
        var(--light-brown) 30%,
        var(--gold) 50%,
        var(--light-brown) 70%,
        var(--accent-brown) 90%,
        transparent 100%
    );
    opacity: 0.6;
}

.section-divider {
    height: 4px;
    background: linear-gradient(to right, var(--primary-green), var(--gold), var(--primary-green));
}

/* ========== NAVIGATION ========== */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--gold);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link.active {
    color: var(--gold);
}

.mobile-nav-link.active {
    color: var(--gold);
    background-color: rgba(201, 169, 98, 0.1);
    padding-left: 12px;
    border-left: 3px solid var(--gold);
}

/* ========== TRUST CARDS ========== */
.trust-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-bottom: 4px solid;
    transition: all 0.3s ease;
}

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

.trust-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.trust-card:hover .trust-icon {
    transform: scale(1.1);
}

/* ========== ABOUT SECTION ========== */
.wood-pattern {
    background: linear-gradient(180deg, var(--cream) 0%, #f0ebe3 100%);
}

.operations-image {
    background: linear-gradient(135deg, rgba(0, 122, 51, 0.1) 0%, rgba(119, 85, 75, 0.1) 100%),
                url('https://africaforestcompany.rodevcreative.com/images/about_afc.jpg');
    background-size: cover;
    background-position: center;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.feature-icon {
    width: 3rem;
    height: 3rem;
    background-color: var(--primary-green);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Mission Card */
.mission-card {
    position: relative;
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--dark-green) 100%);
    border-radius: 1.5rem;
    padding: 2rem;
    color: white;
    box-shadow: 0 20px 40px rgba(0, 92, 39, 0.3);
    overflow: hidden;
    transition: all 0.5s ease;
}

.mission-card:hover {
    transform: scale(1.02);
    box-shadow: 0 25px 60px rgba(0, 122, 51, 0.4);
}

.value-item {
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.mission-card:hover .value-item {
    transform: translateX(8px);
}

.value-icon {
    width: 2rem;
    height: 2rem;
    background-color: rgba(201, 169, 98, 0.2);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
}

.value-icon::before {
    content: '✓';
    color: var(--gold);
    font-weight: bold;
}

/* Team Cards */
.team-card {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-top: 4px solid;
    transition: all 0.3s ease;
}

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

.contact-link {
    display: flex;
    align-items: center;
    color: #4b5563;
    transition: color 0.3s ease;
}

.contact-link:hover {
    color: var(--primary-green);
}

.contact-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
}

/* ========== ACTIVITIES SECTION ========== */
.activity-card {
    background: linear-gradient(135deg, #f9fafb 0%, white 100%);
    border-radius: 1rem;
    padding: 2rem;
    border: 1px solid #f3f4f6;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

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

.activity-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.activity-list {
    font-size: 0.875rem;
    color: #6b7280;
}

.activity-list li {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.activity-list li::before {
    content: '';
    width: 6px;
    height: 6px;
    background-color: var(--gold);
    border-radius: 50%;
    margin-right: 0.5rem;
}

/* ========== PRODUCTS SECTION ========== */
.catalog-container {
    background-color: rgba(90, 61, 53, 0.6);
    border-radius: 1.5rem;
    padding: 2rem;
    border: 1px solid rgba(201, 169, 98, 0.2);
}

@media (min-width: 1024px) {
    .catalog-container {
        padding: 3rem;
    }
}

.product-card {
    background-color: rgba(90, 61, 53, 0.8);
    border-radius: 1.5rem;
    overflow: hidden;
    border: 1px solid rgba(201, 169, 98, 0.2);
    transition: all 0.3s ease;
}

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

.product-image {
    height: 11rem;
    position: relative;
    overflow: hidden;
}

.product-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.product-spec {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    padding: 0.75rem;
    border: 1px solid rgba(201, 169, 98, 0.2);
}

/* Species Cards */
.species-card {
    text-align: center;
    padding: 1rem;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.species-card:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(201, 169, 98, 0.5);
    transform: scale(1.05);
}

.species-color-circle {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 0.75rem;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    ring: 2px solid rgba(255, 255, 255, 0.2);
}

.species-badge {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
}

/* ========== MODAL ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    overflow: hidden;
}

.modal-content {
    position: absolute;
    inset: 0;
    background: white;
    display: flex;
    flex-direction: column;
    max-width: 100vw;
    max-height: 100vh;
    max-height: 100dvh; /* Dynamic viewport height for mobile */
    overflow: hidden;
}

@media (min-width: 768px) {
    .modal-content {
        inset: 1.5rem;
        border-radius: 1.5rem;
        max-width: calc(100vw - 3rem);
        max-height: calc(100vh - 3rem);
    }
}

@media (min-width: 1024px) {
    .modal-content {
        inset: 3rem;
        max-width: calc(100vw - 6rem);
        max-height: calc(100vh - 6rem);
    }
}

.modal-header {
    background: linear-gradient(90deg, var(--primary-green) 0%, var(--dark-green) 100%);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .modal-header {
        padding: 1.5rem;
        border-radius: 1.5rem 1.5rem 0 0;
    }
}

.modal-close-btn {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
}

.modal-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Modal body - prevent horizontal overflow */
.modal-content .flex-1.overflow-y-auto {
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Modal grid - stack on mobile */
@media (max-width: 767px) {
    .modal-content .grid.lg\\:grid-cols-2 {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    
    .modal-content .grid.lg\\:grid-cols-2 > div {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }
}

/* Ensure images don't overflow */
#modal-main-image {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

#image-gallery-container {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

/* Thumbnails container - prevent overflow */
#modal-thumbnails {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    display: flex;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
}

/* Spec boxes - prevent text overflow */
.spec-box p {
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Uses tags - wrap properly */
#modal-uses {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    max-width: 100%;
}

.gallery-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.gallery-nav-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.gallery-nav-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.spec-box {
    background-color: #f9fafb;
    border-radius: 0.5rem;
    padding: 0.75rem;
}

@media (min-width: 768px) {
    .spec-box {
        border-radius: 0.75rem;
        padding: 1rem;
    }
}

.use-tag {
    background-color: rgba(0, 122, 51, 0.1);
    color: var(--primary-green);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.thumbnail {
    width: 4rem;
    height: 4rem;
    border-radius: 0.5rem;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.thumbnail:hover {
    border-color: var(--gold);
}

.thumbnail.active {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 2px rgba(0, 122, 51, 0.3);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ========== SUSTAINABILITY SECTION ========== */
.sustainability-card {
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 1px solid rgba(201, 169, 98, 0.2);
}

.sustainability-icon {
    width: 3rem;
    height: 3rem;
    background-color: var(--gold);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.commitment-item {
    display: flex;
    align-items: flex-start;
}

.commitment-icon {
    width: 2rem;
    height: 2rem;
    background-color: var(--primary-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 0.25rem;
    margin-right: 1rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.commitment-icon::before {
    content: '✓';
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
}

/* ========== COVERAGE SECTION ========== */
.coverage-card {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-top: 4px solid;
    transition: all 0.3s ease;
}

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

.coverage-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.coverage-list {
    font-size: 0.875rem;
    color: #6b7280;
}

.coverage-list li {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.coverage-list li::before {
    content: '';
    width: 6px;
    height: 6px;
    background-color: var(--gold);
    border-radius: 50%;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.map-stat {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid rgba(201, 169, 98, 0.3);
}

/* ========== CONTACT SECTION ========== */
.contact-info-card {
    background-color: #1f2937;
    border-radius: 1rem;
    padding: 1.5rem;
    border-left: 4px solid;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.contact-info-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* ========== FOOTER ========== */
.footer-link {
    color: #9ca3af;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: var(--gold);
}

.social-link {
    width: 2.5rem;
    height: 2.5rem;
    background-color: #1f2937;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.social-link:hover {
    background-color: var(--primary-green);
}

/* ========== FLOATING BUTTONS ========== */
.whatsapp-float {
    position: fixed;
    bottom: 6rem;
    right: 1.5rem;
    width: 3.5rem;
    height: 3.5rem;
    background-color: #25D366;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    z-index: 50;
    transition: all 0.3s ease;
    animation: pulse-whatsapp 2s infinite;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
}

@keyframes pulse-whatsapp {
    0%, 100% { box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4); }
    50% { box-shadow: 0 4px 25px rgba(37, 211, 102, 0.6); }
}

.back-to-top {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 3rem;
    height: 3rem;
    background-color: var(--primary-green);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 122, 51, 0.3);
    z-index: 50;
    transition: all 0.3s ease;
}

.back-to-top:hover {
    background-color: var(--dark-green);
    transform: translateY(-3px);
}

.back-to-top.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
}

/* ========== ANIMATIONS ========== */
@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.animate-fadeIn {
    animation: fadeIn 0.6s ease forwards;
}

@keyframes countUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== SCROLLBAR ========== */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

#species-modal .overflow-y-auto::-webkit-scrollbar {
    width: 8px;
}

#species-modal .overflow-y-auto::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#species-modal .overflow-y-auto::-webkit-scrollbar-thumb {
    background: var(--primary-green);
    border-radius: 4px;
}

/* ========== SELECT STYLING ========== */
select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23C9A962'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

/* ========== RESPONSIVE ========== */

/* Prevent horizontal overflow on mobile */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
        max-width: 100vw;
    }
    
    /* Modal fullscreen fix for mobile */
    .modal-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        overflow: hidden;
    }
    
    .modal-content {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
        overflow: hidden;
    }
    
    /* Modal inner content scrollable */
    .modal-content > .flex-1 {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Modal padding adjustments */
    .modal-content .p-4 {
        padding: 1rem;
    }
    
    /* Grid inside modal */
    .modal-content .grid {
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 400px) {
    .species-card {
        padding: 0.75rem;
    }
    
    .species-card h4 {
        font-size: 0.75rem;
    }
    
    .species-card p {
        font-size: 0.625rem;
    }
    
    .species-color-circle {
        width: 3rem;
        height: 3rem;
    }
}

@media (max-width: 768px) {
    .section-title {
        font-size: 1.75rem;
    }
    
    button, a[href] {
        min-height: 44px;
    }
}

/* ========== MOBILE ENHANCEMENTS ========== */

/* Haptic feedback simulation on touch */
@media (hover: none) and (pointer: coarse) {
    .btn-primary:active,
    .btn-secondary:active,
    .species-card:active,
    .filter-btn:active {
        transform: scale(0.97);
        transition: transform 0.1s ease;
    }
    
    .trust-card:active,
    .activity-card:active,
    .coverage-card:active {
        transform: scale(0.98);
    }
}

/* Prevent text selection on interactive elements */
.species-card,
.filter-btn,
.btn-primary,
.btn-secondary,
.thumbnail,
.gallery-nav-btn {
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Smooth iOS scrolling */
.overflow-y-auto,
.overflow-x-auto,
#mobile-menu {
    -webkit-overflow-scrolling: touch;
}

/* Safe area for notched phones */
@supports (padding: max(0px)) {
    .whatsapp-float {
        bottom: max(6rem, env(safe-area-inset-bottom) + 4rem);
        right: max(1.5rem, env(safe-area-inset-right) + 1rem);
    }
    
    .back-to-top {
        bottom: max(1.5rem, env(safe-area-inset-bottom) + 1rem);
        right: max(1.5rem, env(safe-area-inset-right) + 1rem);
    }
    
    footer {
        padding-bottom: max(4rem, env(safe-area-inset-bottom) + 2rem);
    }
}

/* Improved touch target sizes */
@media (max-width: 768px) {
    .nav-link,
    .mobile-nav-link,
    .footer-link {
        padding: 0.75rem 0;
        display: inline-block;
    }
    
    .contact-link {
        padding: 0.5rem 0;
    }
    
    /* Larger gallery navigation on mobile */
    .gallery-nav-btn {
        width: 3.5rem;
        height: 3.5rem;
    }
    
    /* Larger thumbnails on mobile */
    .thumbnail {
        width: 4.5rem;
        height: 4.5rem;
    }
}

/* Mobile menu animation */
#mobile-menu {
    transition: all 0.3s ease;
    transform-origin: top;
}

#mobile-menu.hidden {
    opacity: 0;
    transform: scaleY(0);
    pointer-events: none;
}

#mobile-menu:not(.hidden) {
    opacity: 1;
    transform: scaleY(1);
}

/* Sticky mobile CTA banner (optional - can be activated) */
.mobile-sticky-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 92, 39, 0.98), rgba(0, 92, 39, 0.95));
    padding: 1rem;
    z-index: 40;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--gold);
}

.mobile-sticky-cta.visible {
    transform: translateY(0);
}

/* Pull-to-refresh visual indicator */
.pull-indicator {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    background: var(--primary-green);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0 0 1rem 1rem;
    font-size: 0.875rem;
    z-index: 60;
    transition: transform 0.3s ease;
}

.pull-indicator.visible {
    transform: translateX(-50%) translateY(0);
}

/* Image loading skeleton */
.image-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

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

/* Swipe indicator animation */
@keyframes swipe-hint {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(10px); }
}

.swipe-hint {
    animation: swipe-hint 1.5s ease-in-out infinite;
}

/* Toast notification for mobile */
.toast {
    position: fixed;
    bottom: 5rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1f2937;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    z-index: 70;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    background: var(--primary-green);
}

.toast.error {
    background: #dc2626;
}

/* Landscape mobile optimization */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-bg {
        min-height: auto;
        padding: 6rem 0;
    }
    
    .modal-content {
        inset: 0.5rem;
    }
    
    .modal-header {
        padding: 0.75rem 1rem;
    }
}
