:root {
    --hero-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --premium-gold: #FFD700;
    --diamond-purple: #a855f7;
    --priority-cyan: #06b6d4;
}

/* Premium Filter Tabs (Replaces Hero) */
.premium-filter-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 2rem 1rem 1rem 1rem;
    background: linear-gradient(to bottom, #f8f9fa 0%, transparent 100%);
}

.filter-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    border-radius: 999px;
    border: 2px solid var(--premium-border);
    background-color: white;
    color: var(--premium-text-secondary);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.filter-tab:hover {
    border-color: var(--premium-primary);
    color: var(--premium-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.15);
}

.filter-tab.active {
    background-color: var(--premium-primary);
    color: white;
    border-color: var(--premium-primary);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.filter-tab i {
    font-size: 1.1rem;
}

/* Content Area */
.local-shop-content {
    padding: 0 1rem 2rem 1rem;
    min-height: 50vh;
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.spinner {
    border: 4px solid #f3f4f6;
    border-top: 4px solid var(--premium-primary);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Country Selector */
.country-selector {
    text-align: center;
    padding: 3rem;
}

.country-selector i {
    font-size: 3rem;
    color: var(--premium-text-secondary);
    margin-bottom: 1rem;
}

.country-selector p {
    font-size: 1.1rem;
    color: var(--premium-text-secondary);
    margin-bottom: 1.5rem;
}

.selected-country-display {
    text-align: center;
    padding: 1rem;
    margin-bottom: 2rem;
}

.selected-country-display span {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--premium-text);
}

.change-country-btn {
    background: none;
    border: none;
    color: var(--premium-primary);
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
    margin-left: 0.5rem;
}
 
/* Section Titles */
.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--premium-text);
    margin-bottom: 1.5rem;
    margin-top: 2rem;
}

/* Horizontal Scroll for Recommended Partners */
.horizontal-scroll {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.horizontal-scroll::-webkit-scrollbar {
    height: 8px;
}

.horizontal-scroll::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 4px;
}

/* Shops Grid */
.shops-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

/* Shop Card */
.shop-card {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 2px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
}

.shop-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

/* Horizontal Shop Card (for Recommended Partners) */
.shop-card-horizontal {
    min-width: 280px;
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 2px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
}

.shop-card-horizontal:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

/* Premium Borders */
.shop-card.premium,
.shop-card-horizontal.premium {
    border-color: var(--premium-gold);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.shop-card.diamond,
.shop-card-horizontal.diamond {
    border-color: var(--diamond-purple);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2), 0 0 15px rgba(250, 204, 21, 0.6);
}

.shop-card.priority,
.shop-card-horizontal.priority {
    border-color: var(--priority-cyan);
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.4);
}

/* Card Image */
.shop-card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.shop-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shop-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.2);
}

/* Card Info */
.shop-card-info {
    padding: 1rem;
}

.shop-name-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.shop-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--premium-text);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Badges - Exact App Style */
.shop-badge-container {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
}

.priority-badge {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: white;
    padding: 0.35rem 0.65rem;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(6, 182, 212, 0.4);
}

.priority-badge img {
    width: 12px;
    height: 12px;
    filter: brightness(0) invert(1);
}

.diamond-badge {
    background: linear-gradient(135deg, #a855f7, #9333ea);
    color: white;
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.4);
}

.premium-star-badge {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.4);
}

/* Location */
.shop-location-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--premium-text-secondary);
    font-size: 0.45rem;
    margin-bottom: 1rem;
}

/* Payment Tag - Renamed from tooltip for clarity */
.payment-type-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0rem;
    border-top: 1px solid #f0f2f5;
    font-size: 0.8rem;
    font-weight: 500;
}

.payment-secure {
    color: var(--premium-primary);
}

.payment-delivery {
    color: var(--premium-text-secondary);
}


/* No Results */
.no-results {
    text-align: center;
    padding: 3rem;
}

.no-results i {
    font-size: 3rem;
    color: var(--premium-text-secondary);
    margin-bottom: 1rem;
}

.no-results p {
    font-size: 1.1rem;
    color: var(--premium-text-secondary);
}

/* Error Message */
.error-message {
    text-align: center;
    padding: 3rem;
}

.error-message i {
    font-size: 3rem;
    color: var(--premium-danger);
    margin-bottom: 1rem;
}

.error-message p {
    font-size: 1.1rem;
    color: var(--premium-text-secondary);
}

/* Country Picker Modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.country-picker-modal {
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    background-color: white;
    border-radius: 12px;
    padding: 2rem;
    overflow-y: auto;
}

.country-picker-modal h2 {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1.5rem;
}

.modal-search-bar {
    display: flex;
    align-items: center;
    background-color: #f0f2f5;
    border-radius: 8px;
    padding: 0 1rem;
    margin-bottom: 1rem;
}

.modal-search-bar i {
    color: var(--premium-text-secondary);
    margin-right: 0.5rem;
}

.modal-search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    padding: 0.75rem 0;
    font-size: 1rem;
}

.country-list {
    max-height: 400px;
    overflow-y: auto;
}

.country-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.country-item:hover {
    background-color: #f9fafb;
}

.country-flag {
    font-size: 1.5rem;
    margin-right: 1rem;
}

.country-name {
    font-size: 1rem;
    font-weight: 500;
}

/* ==========================================================================
   MOBILE RESPONSIVE FIXES
   ========================================================================== */

/* For Tablets and Larger Phones */
@media (max-width: 768px) {
    .premium-filter-tabs {
        padding: 1.5rem 1rem 1rem 1rem;
    }
    
    .filter-tab {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .shops-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .shop-card-horizontal {
        min-width: 220px;
    }

    /* ✅ START: FINAL MOBILE HEADER LAYOUT */
    .header-container {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .header-top-row {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 1rem;
        width: 100%;
    }
    
    .premium-header .logo {
        flex-shrink: 0;
        margin: 0;
    }
    
    .premium-search-container {
        flex-grow: 1;
        margin: 0;
    }
    
    .premium-nav-icons {
        width: 100%;
        justify-content: space-around;
        padding-top: 0.5rem;
        gap: 0.75rem;
    }

    .premium-nav-icons .nav-icon .nav-icon-label {
        display: none;
    }
    /* ✅ END: FINAL MOBILE HEADER LAYOUT */
}

/* For ALL Mobile Phones (e.g., screen widths up to 600px) */
@media (max-width: 600px) {
    .premium-header .header-container {
        padding: 0.5rem 0.75rem;
    }

    .premium-header .logo img {
        max-height: 28px;
    }

    .premium-search-container input::placeholder {
        font-size: 0.85rem;
    }

    .local-shop-content {
        padding: 0 0.75rem 2rem 0.75rem;
    }

    .shops-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .shop-card-info {
        padding: 0.75rem;
    }
    .shop-name {
        font-size: 0.85rem;
    }
    .shop-location-container {
        font-size: 0.75rem;
        margin-bottom: 0.5rem;
    }
    .payment-type-badge {
        font-size: 0.7rem;
        padding: 0.5rem 0;
    }
}

/* ======================================================= */
/* ✅ ADDED: PAGE PRELOADER & CLEAR BUTTON STYLES         */
/* ======================================================= */

/* --- Page Preloader --- */
.preloader-overlay {
    position: fixed;
    inset: 0;
    background-color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.preloader-overlay .spinner {
    border: 6px solid #e9e9ed; /* --skeleton-color */
    border-top-color: #0d6efd; /* --premium-primary */
    width: 50px;
    height: 50px;
    border-radius: 50%;
    animation: spin 1s ease-in-out infinite;
}

.preloader-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* --- Clear Search Button ('X') --- */
#clearSearchBtn {
    display: none;
    color: #515154; /* --premium-text-secondary */
    font-size: 1rem;
    cursor: pointer;
    padding: 0 1rem;
    transition: color 0.2s ease;
}

#clearSearchBtn:hover {
    color: #1d1d1f; /* --premium-text */
}

.premium-search-container.has-text #clearSearchBtn {
    display: block;
}

@media (min-width: 769px) {
    /* --- Increase font size of shop location text on PC --- */
    .shop-location-container {
        font-size: 0.85rem; /* Increased from 0.45rem */
    }
}

@media (min-width: 769px) {
    
    /* 
     * This rule tells the browser to "dissolve" the wrapper on desktop,
     * making the logo and search bar behave as if they are direct
     * children of the main header container again. This restores the
     * original correct alignment and search bar width.
    */
    #page-local-shop .header-top-row {
        display: contents;
    }
}