/* =========================================
   TOWN & PROVINCE SPECIFIC STYLES
========================================= */

/* Hero Styling */
.town-hero { 
    position: relative;
    height: 45vh; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background-size: cover;
    background-position: center;
    padding: 0 20px;
}
.town-hero h1 {
    font-size: clamp(3rem, 8vw, 5rem);
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #FFF;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.hero-province-label { 
    color: var(--brand-orange); 
    font-size: 1.2rem; 
    letter-spacing: 3px; 
    margin-bottom: 10px; 
    font-weight: bold; 
    text-transform: uppercase;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

/* Province Specific Nav Adjustments */
.province-nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* Premium Download Pill (Fixed Width Glitch) */
.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;
}
.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);
}

/* Info Dashboard (Desktop) */
.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, .distance-icon { 
    width: 45px; 
    height: 45px; 
    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.3rem; }
#distance-text { transition: opacity 0.5s ease; }

/* Town Tab Navigation (Desktop Default) */
.town-tabs-nav { 
    background: var(--bg-white); 
    border-bottom: 1px solid var(--border-subtle); 
    position: sticky; 
    top: 105px; 
    z-index: 90; 
}
.tabs-container { 
    max-width: 1400px; 
    margin: 0 auto; 
    display: flex; 
    justify-content: center; 
    overflow-x: auto; 
    white-space: nowrap; 
}
.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; 
}
.tab-link:hover { color: var(--brand-orange); }
.tab-link.active { color: var(--brand-orange); border-bottom: 4px solid var(--brand-orange); }

/* Explore Layout */
.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; } }

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

/* Maintained Fixed Uniform Cards with Bottom Breathing Room */
.uniform-card { 
    display: flex; 
    flex-direction: column; 
    min-height: 480px; 
    height: 100%;
    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-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; }
.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; }

/* Dedicated padding below buttons to prevent squishing */
.card-actions { 
    margin-top: auto; 
    padding-top: 15px; 
    padding-bottom: 5px;
    border-top: 1px solid var(--border-subtle); 
    display: flex; 
    gap: 10px; 
    flex-wrap: wrap;
}

/* Map Settings */
#province-map { width: 100%; height: 500px; z-index: 1; background: var(--bg-blue-grey); border-bottom: 5px solid var(--brand-orange); }
.leaflet-container { background: transparent !important; }
.local-search-container { max-width: 600px; margin: -30px auto 40px; position: relative; z-index: 10; }
.local-search-input { width: 100%; padding: 15px 25px; font-size: 1.1rem; border: 2px solid var(--border-subtle); border-radius: 50px; box-shadow: 0 10px 20px rgba(0,40,85,0.1); outline: none; transition: all 0.3s ease; }
.local-search-input:focus { border-color: var(--brand-orange); box-shadow: 0 10px 25px rgba(255,102,0,0.15); }

/* =========================================
   MOBILE "WOW FACTOR" OVERRIDES
========================================= */
@media (max-width: 768px) {
    /* Transforms the info bar into a neat 2x2 mobile dashboard grid */
    .town-info-bar { 
        display: grid; 
        grid-template-columns: 1fr 1fr; 
        gap: 15px; 
        padding: 25px 5%; 
        border-radius: 0 0 20px 20px; 
        box-shadow: 0 10px 20px rgba(0,0,0,0.08); 
    }
    .info-widget { flex-direction: column; text-align: center; font-size: 0.9rem; gap: 5px; }
    
    /* Extends buttons to full width ONLY on mobile */
    .download-widget { grid-column: 1 / -1; margin-top: 10px; }
    .btn-premium-pill, .btn-explore-all { width: 100%; padding: 15px; justify-content: center; }
    
    /* Transforms Tabs into a Stacked Pill Grid */
    .town-tabs-nav { 
        position: relative; 
        top: 0; 
        padding: 15px 5%; 
        border-bottom: none; 
        background: transparent; 
    }
    .tabs-container { 
        flex-wrap: wrap; 
        gap: 10px; 
        justify-content: center; 
        white-space: normal;
    }
    .tab-link { 
        flex: 1 1 calc(50% - 10px); 
        padding: 12px 10px; 
        border: 2px solid var(--border-subtle); 
        border-radius: 50px; 
        background: white; 
        font-size: 0.8rem; 
        text-align: center;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05); 
    }
    .tab-link:hover { 
        color: var(--brand-navy); 
        border-color: var(--brand-orange); 
    }
    .tab-link.active { 
        background: var(--brand-orange); 
        color: white; 
        border-color: var(--brand-orange); 
    }
}