/* =========================================
   1. BASE & VARIABLES
========================================= */
:root {
    /* Exact BlyLekker Logo Colors */
    --brand-navy: #002855; 
    --brand-orange: #FF6600;
    
    /* Layout Colors */
    --bg-white: #FFFFFF; 
    --bg-blue-grey: #F0F4F8; /* Subtle blue/grey for alternating sections */
    --card-bg: #FFFFFF;
    --text-main: #333333;
    --border-subtle: rgba(0, 40, 85, 0.1); /* Tinted navy border */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

body {
    background-color: var(--bg-white);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

a { 
    text-decoration: none; 
    color: inherit; 
}

/* =========================================
   2. NAVIGATION & SEARCH
========================================= */
.main-nav {
    background-color: var(--bg-white);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 15px 0;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 75px; 
    width: auto;
    display: block;
}

.search-form {
    display: flex;
    align-items: center;
    background: var(--bg-blue-grey);
    border: 1px solid var(--border-subtle);
    border-radius: 50px;
    padding: 5px 5px 5px 20px;
    width: 100%;
    max-width: 400px;
    transition: box-shadow 0.3s ease;
}

.search-form:focus-within {
    box-shadow: 0 0 0 2px rgba(255, 102, 0, 0.2);
    border-color: var(--brand-orange);
}

.search-input {
    border: none;
    background: transparent;
    outline: none;
    flex-grow: 1;
    font-size: 1rem;
    color: var(--text-main);
}

.search-btn {
    background-color: var(--brand-navy);
    color: white;
    border: none;
    border-radius: 40px;
    padding: 10px 25px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.search-btn:hover {
    background-color: var(--brand-orange);
}

@media (max-width: 768px) {
    .nav-container { 
        flex-direction: column; 
        gap: 15px; 
    } 
    .search-form { 
        max-width: 100%; 
    }
    .mobile-hidden {
        display: none;
    }
}

/* =========================================
   3. HERO SECTIONS & APP-LIKE INFO BARS
========================================= */
.hero {
    position: relative;
    width: 100%;
    height: 60vh;
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #FFF;
}

.hero h1 {
    font-size: clamp(2.5rem, 8vw, 6rem);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.hero h2 {
    font-size: 1.5rem;
    color: var(--brand-orange);
    margin-top: 10px;
}

.hero-province-label { 
    color: var(--brand-orange); 
    font-size: 1.2rem; 
    letter-spacing: 3px; 
    margin-bottom: 10px; 
    font-weight: bold; 
}
.town-hero { height: 40vh; }

/* Desktop Info Bar */
.town-info-bar { 
    background: #fff; 
    padding: 20px 5%; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.05); 
}
.info-widget { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    font-weight: bold; 
    color: var(--brand-navy); 
    font-size: 1.1rem; 
}
.weather-icon { 
    width: 50px; 
    height: 50px; 
    background: var(--bg-blue-grey); 
    border-radius: 50%; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}
.distance-icon {
    font-size: 1.5rem;
    background: var(--bg-blue-grey);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}
#distance-text { 
    transition: opacity 0.5s ease; 
}

/* Premium Pill Button */
.btn-premium-pill, .btn-explore-all {
    background-color: #ffffff;
    color: var(--brand-navy);
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 2px solid transparent;
    background-image: linear-gradient(#ffffff, #ffffff), linear-gradient(to right, var(--brand-navy), var(--brand-orange));
    background-origin: border-box;
    background-clip: padding-box, border-box;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    cursor: pointer;
    width: 100%;
}
.btn-premium-pill:hover, .btn-explore-all:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(255, 102, 0, 0.15);
    color: var(--brand-orange);
}

/* Mobile App-Like Info Dashboard */
@media (max-width: 768px) {
    .town-info-bar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
        padding: 20px 5%;
    }
    .info-widget {
        flex-direction: column;
        text-align: center;
        font-size: 0.9rem;
        gap: 5px;
    }
    .download-widget {
        grid-column: 1 / -1; /* Spans full width below weather and distance */
        margin-top: 10px;
    }
    .btn-premium-pill {
        width: 100%;
        padding: 15px;
    }
}

/* =========================================
   4. TOWN TABS & EXPLORE LAYOUT
========================================= */
.town-tabs-nav { 
    background: var(--bg-white); 
    border-bottom: 1px solid var(--border-subtle); 
    position: sticky; 
    top: 0; 
    z-index: 90; 
}
.tabs-container { 
    max-width: 1400px; 
    margin: 0 auto; 
    display: flex; 
    justify-content: flex-start; /* Changed for mobile scrolling */
    overflow-x: auto; 
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}
.tabs-container::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Edge */
}
.tab-link { 
    padding: 20px 25px; 
    color: var(--text-main); 
    font-weight: bold; 
    font-size: 0.95rem; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    border-bottom: 4px solid transparent; 
    transition: all 0.2s; 
    flex-shrink: 0;
}
.tab-link:hover { 
    color: var(--brand-orange); 
}
.tab-link.active { 
    color: var(--brand-orange); 
    border-bottom: 4px solid var(--brand-orange); 
}

@media (min-width: 1024px) {
    .tabs-container {
        justify-content: center;
    }
}

.explore-layout { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 40px; 
    align-items: start; 
}
.explore-map-container { 
    background: #fff; 
    padding: 10px; 
    border-radius: 8px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); 
    border: 1px solid var(--border-subtle); 
}
#town-specific-map { 
    width: 100%; 
    height: 400px; 
    border-radius: 4px; 
}
@media (max-width: 900px) { 
    .explore-layout { 
        grid-template-columns: 1fr; 
    } 
}

/* =========================================
   5. GRIDS & INTERACTIVE CARDS
========================================= */
.content-section {
    padding: 60px 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.directory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    padding: 40px 0;
}

/* Uniform Cards (Fixed Height to align perfectly) */
.uniform-card { 
    display: flex; 
    flex-direction: column; 
    height: 480px; 
    background: var(--card-bg); 
    border: 1px solid var(--border-subtle); 
    border-radius: 8px; 
    overflow: hidden; 
    box-shadow: 0 4px 10px rgba(0, 0, 85, 0.03); 
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); 
}

.uniform-card:hover { 
    transform: translateY(-7px); 
    box-shadow: 0 15px 25px rgba(0, 40, 85, 0.12), 0 0 0 1px rgba(255, 102, 0, 0.05); 
}

/* Premium vs Basic Logic */
.premium-card { border-bottom: 4px solid var(--brand-navy); }
.premium-card:hover { border-bottom: 4px solid var(--brand-orange); }
.basic-card { border-bottom: 4px solid #aaa; }
.basic-card:hover { border-bottom: 4px solid #666; }

.uniform-card .listing-image { 
    height: 200px; 
    flex-shrink: 0; 
    background-color: #e0e0e0; 
    background-size: cover; 
    background-position: center; 
    position: relative; 
}
.badge { 
    position: absolute; 
    top: 15px; 
    left: 0; 
    color: #FFF; 
    padding: 5px 15px; 
    font-size: 0.8rem; 
    font-weight: bold; 
    text-transform: uppercase; 
}
.uniform-card .listing-content { 
    flex-grow: 1; 
    display: flex; 
    flex-direction: column; 
    padding: 20px; 
}
.uniform-card .listing-title { 
    color: var(--brand-navy); 
    font-size: 1.3rem; 
    margin-bottom: 10px; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
}
.uniform-card .listing-tagline { 
    display: -webkit-box; 
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical; 
    overflow: hidden; 
    color: #666; 
    margin: 0; 
    font-size: 0.95rem;
}

/* Card Buttons */
.card-actions { 
    margin-top: auto; 
    padding-top: 15px; 
    border-top: 1px solid var(--border-subtle); 
    display: flex; 
    gap: 10px; 
    flex-wrap: wrap;
}
.btn-primary { 
    background: var(--brand-navy); 
    color: white; 
    padding: 10px 15px; 
    border: none; 
    border-radius: 4px; 
    cursor: pointer; 
    font-weight: bold; 
    transition: 0.2s; 
    text-align: center;
}
.btn-primary:hover { background: var(--brand-orange); }
.btn-secondary { 
    background: transparent; 
    color: var(--brand-navy); 
    border: 2px solid var(--brand-navy); 
    padding: 8px 15px; 
    border-radius: 4px; 
    cursor: pointer; 
    font-weight: bold; 
    transition: 0.2s; 
    text-align: center;
}
.btn-secondary:hover { background: var(--brand-navy); color: white; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 10px; }
.page-link { padding: 8px 16px; background: white; border: 1px solid var(--border-subtle); border-radius: 4px; color: var(--brand-navy); font-weight: bold; transition: all 0.2s; }
.page-link.active { background: var(--brand-navy); color: white; border-color: var(--brand-navy); }
.page-link:hover:not(.active) { background: var(--bg-blue-grey); color: var(--brand-orange); }

/* =========================================
   6. FOOTER
========================================= */
.site-footer {
    background-color: var(--bg-white);
    color: var(--text-main);
    border-top: 5px solid var(--brand-orange);
    padding: 60px 5% 20px;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.03);
}
.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}
.footer-logo { height: 85px; margin-bottom: 15px; display: block; }
.social-icons { margin-top: 15px; display: flex; gap: 10px; }
.footer-col h4 { color: var(--brand-orange); margin-bottom: 20px; font-size: 1.2rem; text-transform: uppercase; letter-spacing: 1px; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 12px; font-weight: 500; }
.footer-col ul a, .contact-col a { color: var(--text-main); transition: color 0.2s; }
.footer-col ul a:hover, .contact-col a:hover { color: var(--brand-orange); }
.contact-col p { margin-bottom: 15px; font-size: 0.95rem; }
.contact-col a { color: var(--brand-navy); font-weight: bold; }
.footer-bottom {
    text-align: center;
    padding-top: 25px;
    border-top: 1px solid var(--border-subtle);
    color: #666;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.legal-links a { color: #666; transition: color 0.2s; }
.legal-links a:hover { color: var(--brand-orange); }