/* Browser Compatibility Fixes for Older Browsers */
/* This file provides fallbacks for modern CSS features */

/* ============================================
   CSS VARIABLES FALLBACKS
   ============================================ */

/* Replace var(--primary-green) with #2F7A3E */
/* Replace var(--secondary-brown) with #7A4B2B */
/* Replace var(--white) with #ffffff */
/* Replace var(--dark-green) with #1e5a2a */

.navbar {
    display: -webkit-box;      /* OLD - iOS 6-, Safari 3.1-6 */
    display: -moz-box;         /* OLD - Firefox 19- */
    display: -ms-flexbox;      /* TWEENER - IE 10 */
    display: -webkit-flex;     /* NEW - Chrome */
    display: flex;
    -webkit-box-pack: justify;
    -moz-box-pack: justify;
    -ms-flex-pack: justify;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    -webkit-box-align: center;
    -moz-box-align: center;
    -ms-flex-align: center;
    -webkit-align-items: center;
    align-items: center;
    padding: 1rem 0;
    position: relative;
}

.hamburger {
    display: none;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    -webkit-flex-direction: column;
    flex-direction: column;
    cursor: pointer;
    padding: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: #7A4B2B; /* Fallback for var(--secondary-brown) */
    margin: 3px 0;
    -webkit-transition: 0.3s;
    -moz-transition: 0.3s;
    -o-transition: 0.3s;
    transition: 0.3s;
    -webkit-border-radius: 3px;
    -moz-border-radius: 3px;
    border-radius: 3px;
}

.hamburger.active span:nth-child(1) {
    -webkit-transform: rotate(-45deg) translate(-5px, 6px);
    -moz-transform: rotate(-45deg) translate(-5px, 6px);
    -ms-transform: rotate(-45deg) translate(-5px, 6px);
    -o-transform: rotate(-45deg) translate(-5px, 6px);
    transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    -webkit-transform: rotate(45deg) translate(-5px, -6px);
    -moz-transform: rotate(45deg) translate(-5px, -6px);
    -ms-transform: rotate(45deg) translate(-5px, -6px);
    -o-transform: rotate(45deg) translate(-5px, -6px);
    transform: rotate(45deg) translate(-5px, -6px);
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: #2F7A3E; /* Fallback for var(--primary-green) */
    text-decoration: none;
    display: -webkit-box;
    display: -moz-box;
    display: -ms-flexbox;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -moz-box-align: center;
    -ms-flex-align: center;
    -webkit-align-items: center;
    align-items: center;
}

/* Flexbox gap fallback using margin */
.logo > * + * {
    margin-left: 0.5rem; /* Fallback for gap: 0.5rem */
}

.nav-links {
    display: -webkit-box;
    display: -moz-box;
    display: -ms-flexbox;
    display: -webkit-flex;
    display: flex;
    list-style: none;
}

/* Flexbox gap fallback for nav-links */
.nav-links li {
    margin-right: 2rem; /* Fallback for gap: 2rem */
}

.nav-links li:last-child {
    margin-right: 0;
}

.nav-links a {
    color: #7A4B2B; /* Fallback for var(--secondary-brown) */
    text-decoration: none;
    font-weight: 500;
    -webkit-transition: color 0.3s;
    -moz-transition: color 0.3s;
    -o-transition: color 0.3s;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #2F7A3E; /* Fallback for var(--primary-green) */
}

/* Scroll to Top Button */
.scroll-top {
    position: fixed;
    bottom: 20px;
    right: 160px;
    width: 50px;
    height: 50px;
    background: #2F7A3E; /* Fallback for var(--primary-green) */
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    border-radius: 50%;
    display: -webkit-box;
    display: -moz-box;
    display: -ms-flexbox;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -moz-box-align: center;
    -ms-flex-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -moz-box-pack: center;
    -ms-flex-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    color: #ffffff; /* Fallback for var(--white) */
    cursor: pointer;
    -webkit-box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    -moz-box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    -webkit-transition: background 0.3s;
    -moz-transition: background 0.3s;
    -o-transition: background 0.3s;
    transition: background 0.3s;
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    background: #1e5a2a; /* Fallback for var(--dark-green) */
}

/* Additional Flexbox elements that need vendor prefixes */
.cart-icon-container {
    display: -webkit-box;
    display: -moz-box;
    display: -ms-flexbox;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -moz-box-align: center;
    -ms-flex-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -moz-box-pack: center;
    -ms-flex-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
}

.hero-slider .slide-content > div {
    display: -webkit-box;
    display: -moz-box;
    display: -ms-flexbox;
    display: -webkit-flex;
    display: flex;
}

/* Gap fallback for buttons */
.hero-slider .slide-content > div > * + * {
    margin-left: 10px;
}

.services-grid {
    display: -webkit-box;
    display: -moz-box;
    display: -ms-flexbox;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    margin: -1rem; /* Negative margin to compensate for gap */
}

.service-card {
    margin: 1rem; /* Fallback for gap: 2rem */
    -webkit-box-flex: 1;
    -moz-box-flex: 1;
    -ms-flex: 1 1 calc(33.333% - 2rem);
    -webkit-flex: 1 1 calc(33.333% - 2rem);
    flex: 1 1 calc(33.333% - 2rem);
}

/* Audio Player Compatibility */
.audio-player-sticky {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9998;
    display: -webkit-box;
    display: -moz-box;
    display: -ms-flexbox;
    display: -webkit-flex;
    display: flex;
}

/* Chat Button Compatibility */
.chat-button,
.whatsapp-button {
    position: fixed;
    z-index: 9999;
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    border-radius: 50%;
    display: -webkit-box;
    display: -moz-box;
    display: -ms-flexbox;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -moz-box-align: center;
    -ms-flex-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -moz-box-pack: center;
    -ms-flex-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    cursor: pointer;
    -webkit-transition: all 0.3s;
    -moz-transition: all 0.3s;
    -o-transition: all 0.3s;
    transition: all 0.3s;
}

/* Responsive adjustments for older mobile browsers */
@media (max-width: 768px) {
    .nav-links {
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -ms-flex-direction: column;
        -webkit-flex-direction: column;
        flex-direction: column;
    }
    
    .nav-links li {
        margin-right: 0;
        margin-bottom: 1rem; /* Replace gap with margin */
    }
    
    .nav-links li:last-child {
        margin-bottom: 0;
    }
    
    .scroll-top {
        right: 10px;
        bottom: 10px;
        width: 45px;
        height: 45px;
    }
}

/* IE10+ specific fixes */
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
    /* IE10+ CSS */
    .navbar {
        display: -ms-flexbox;
    }
    
    .nav-links {
        display: -ms-flexbox;
    }
    
    .logo {
        display: -ms-flexbox;
    }
}
