/* ========================================
    Header styling
   ======================================== */
header {
    background: linear-gradient(135deg, rgb(0, 168, 107, 0.70) 0%, rgb(227, 35, 50, 0.70) 100%);
    backdrop-filter: blur(50px);
    -webkit-backdrop-filter: blur(50px);
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    width: 100%;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.3s;
    flex-shrink: 0;
}

.logo:hover {
    opacity: 0.8;
}

.logo img {
    height: 75px;
    width: auto;
}

.logo-text h1 {
    color: white;
    font-size: 1.6rem;
    font-weight: bold;
}

.logo-text p {
    color: rgba(255,255,255,0.9);
    font-size: 0.9rem;
    font-style: italic;
}

/* Header Social Icons */
.header-social-icons {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.header-social-icons a {
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 50%;
}

.header-social-icons a:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.1);
}

.header-social-icons svg {
    width: 24px;
    height: 24px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-shrink: 0;
}

/* Language Toggle */
.language-toggle {
    display: flex;
    align-items: center;
}

.lang-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid white;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.lang-btn:hover {
    background: white;
    color: #00a86b;
}

/* Desktop Navigation */
.desktop-nav {
    display: flex;
    align-items: center;
}

.desktop-nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.desktop-nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    font-size: 1.1rem;
}

.desktop-nav a:hover {
    color: rgba(255,255,255,0.7);
}

.desktop-nav a.active {
    border-bottom: 2px solid white;
}

/* Mobile Bottom Navigation - ALWAYS use flex, control visibility */
.mobile-bottom-nav {
    display: flex;
    visibility: hidden;
    opacity: 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: white;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 100;
    padding: 0.5rem 0;
    border-top: 1px solid rgba(139, 111, 71, 0.1);
    justify-content: space-around;
    padding-bottom: 0.5rem;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

/* iOS-specific: Use margin-bottom instead of padding-bottom for better cache handling */
@supports (-webkit-touch-callout: none) {
    .mobile-bottom-nav {
        padding-bottom: 0;
        margin-bottom: 0;
    }
    
    /* Add spacer element approach instead */
    .mobile-bottom-nav::before {
        content: '';
        position: absolute;
        bottom: -20px;
        left: 0;
        right: 0;
        height: 20px;
        background: white;
        z-index: -1;
    }
}

/* Background extension that prevents gaps */
.mobile-bottom-nav::after {
    content: '';
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100vh;
    background: white;
    z-index: -2;
    transform: translateY(100%);
    transform: translateY(calc(100% - 80px));
}

.mobile-bottom-nav .nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #8b6f47;
    padding: 0.5rem;
    transition: all 0.3s ease;
    gap: 0.25rem;
    position: relative;
    z-index: 1;
}

.mobile-bottom-nav .nav-item svg {
    width: 24px;
    height: 24px;
    stroke-width: 2;
}

.mobile-bottom-nav .nav-item span {
    font-size: 0.75rem;
    font-weight: 500;
}

.mobile-bottom-nav .nav-item.active {
    color: #00a86b;
}

.mobile-bottom-nav .nav-item:active {
    background: rgba(0, 168, 107, 0.1);
}

/* Logo in bottom navigation - special styling */
.mobile-bottom-nav .nav-item-logo {
    flex: 1.2;
    padding: 0.25rem;
}

.mobile-bottom-nav .bottom-nav-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 50%;
    background: white;
    padding: 0.25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: transform 0.3s ease;
}

.mobile-bottom-nav .nav-item-logo:active .bottom-nav-logo {
    transform: scale(0.95);
}

/* Main Content - Add padding for fixed header */
main {
    min-height: calc(100vh - 200px);
    padding-top: 110px;
}

.content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.page-header {
    background: white;
    color: #8b6f47;
    text-align: center;
    padding: 4rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.page-header p {
    font-size: 1.2rem;
}

/* ========================================
   Responsive Breakpoints
   ======================================== */

/* Large Desktop - 1200px and up */
@media (min-width: 1200px) {
    .mobile-bottom-nav {
        visibility: hidden;
        opacity: 0;
        pointer-events: none;
    }
    
    .desktop-nav {
        display: flex;
    }
    
    .logo-image,
    .logo-text {
        display: block;
    }
    
    main {
        padding-bottom: 0;
    }
}

/* Desktop and Large Tablets - 1025px to 1199px */
@media (min-width: 1025px) and (max-width: 1199px) {
    .mobile-bottom-nav {
        visibility: hidden;
        opacity: 0;
        pointer-events: none;
    }
    
    .desktop-nav {
        display: flex;
    }
    
    .logo-image,
    .logo-text {
        display: block;
    }
    
    main {
        padding-bottom: 0;
    }
}

/* Tablets and iPad Pro - 769px to 1024px */
@media (min-width: 769px) and (max-width: 1024px) {
    /* Show bottom nav on tablets */
    .mobile-bottom-nav {
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
    }
    
    /* Hide desktop nav on tablets */
    .desktop-nav {
        display: none;
    }
    
    /* Hide logo from top on tablets */
    .logo {
        display: none;
    }
    
    .logo-image,
    .logo-text {
        display: none;
    }
    
    /* Adjust header for tablets */
    .header-content {
        justify-content: flex-end;
    }
    
    .header-social-icons {
        margin-right: auto;
    }
    
    /* Add bottom padding for bottom nav */
    main {
        padding-top: 80px;
        padding-bottom: 100px;
    }
}

/* Mobile and Small Tablets - up to 768px */
@media (max-width: 768px) {
    /* FORCE SHOW mobile bottom nav */
    .mobile-bottom-nav {
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
    }
    
    /* Hide desktop navigation */
    .desktop-nav {
        display: none;
    }
    
    /* Hide logo image in top header */
    .logo-image {
        display: none;
    }
    
    /* Hide logo text */
    .logo-text {
        display: none;
    }
    
    /* Adjust header for mobile */
    header {
        padding: 0.75rem 0;
    }
    
    .header-content {
        padding: 0 1rem;
        gap: 0.5rem;
        justify-content: flex-end;
    }
    
    /* Hide the logo link entirely */
    .logo {
        display: none;
    }
    
    /* Smaller social icons */
    .header-social-icons {
        gap: 0.5rem;
        margin-right: auto;
    }
    
    .header-social-icons svg {
        width: 20px;
        height: 20px;
    }
    
    /* Adjust language toggle */
    .lang-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
    
    /* Adjust main content padding for bottom nav */
    main {
        padding-top: 80px;
        padding-bottom: 100px;
        min-height: calc(100vh - 160px);
    }
    
    .content {
        padding: 2rem 1rem 4rem 1rem;
    }
    
    .page-header {
        padding: 2rem 1rem;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    .page-header p {
        font-size: 1rem;
    }
}

/* iOS-specific fixes for viewport issues */
@supports (-webkit-touch-callout: none) {
    @media (max-width: 1024px) {
        html {
            height: 100%;
            height: -webkit-fill-available;
        }
        
        body {
            min-height: 100%;
            min-height: -webkit-fill-available;
        }
        
        /* Force recalculation on iOS */
        .mobile-bottom-nav {
            transform: translateZ(0);
            -webkit-transform: translateZ(0);
        }
        
        main {
            padding-bottom: 120px;
        }
    }
}

/* Extra small devices - 480px and below */
@media (max-width: 480px) {
    .header-social-icons {
        gap: 0.25rem;
    }
    
    .header-social-icons svg {
        width: 18px;
        height: 18px;
    }
    
    .mobile-bottom-nav .nav-item svg {
        width: 22px;
        height: 22px;
    }
    
    .mobile-bottom-nav .nav-item span {
        font-size: 0.7rem;
    }
    
    .mobile-bottom-nav .bottom-nav-logo {
        width: 45px;
        height: 45px;
    }
}