@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ============================================
   CSS Custom Properties - Company Theme
   Black Primary + Yellow (#FEDD00) Accents
   ============================================ */
:root {
    --primary: #000000;
    --primary-dark: #000000;
    --primary-light: #1a1a1a;
    --accent: #FEDD00;
    --accent-dark: #d4ba00;
    --accent-light: #fff176;

    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #e5e5e5;
    --gray-300: #d4d4d4;
    --gray-400: #a3a3a3;
    --gray-500: #737373;
    --gray-600: #525252;
    --gray-700: #404040;
    --gray-800: #262626;
    --gray-900: #171717;

    --success: #22c55e;
    --warning: #FEDD00;
    --error: #ef4444;

    --white: #ffffff;
    --black: #000000;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.12), 0 4px 6px -2px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.08);
    --shadow-accent: 0 4px 14px rgba(254, 221, 0, 0.4);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;
}

/* ============================================
   Base & Reset
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

/* When embedded in an iframe, hide overflow to prevent double scrollbars */
html.in-iframe, html.in-iframe body {
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--gray-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Store Locator Wrapper
   ============================================ */
.store-locator-wrapper {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================
   Search Header - Black with Yellow Accent
   ============================================ */
.search-header {
    background: var(--primary);
    padding: 2rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-xl);
    /* position relative needed for ::before accent bar */
}

.search-header::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent);
}

.search-form {
    max-width: 900px;
    margin: 0 auto;
}

.search-inner {
    display: flex;
    align-items: center;
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 0.5rem;
    box-shadow: var(--shadow-xl);
    transition: all var(--transition-base);
    border: 2px solid transparent;
}

.search-inner:focus-within {
    border-color: var(--accent);
    box-shadow: var(--shadow-accent);
}

.search-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    color: var(--primary);
    flex-shrink: 0;
}

.search-icon i {
    font-size: 1.2rem;
}

.search-input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    font-size: 1rem;
    font-family: inherit;
    color: var(--gray-800);
    background: transparent;
    padding: 0.75rem 0.5rem;
}

.search-input::placeholder {
    color: var(--gray-400);
}

.search-divider {
    width: 2px;
    height: 32px;
    background: var(--gray-200);
    margin: 0 0.75rem;
    flex-shrink: 0;
    border-radius: 1px;
}

.category-select {
    border: none;
    outline: none;
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 500;
    color: var(--gray-700);
    background: transparent;
    padding: 0.75rem 1rem;
    cursor: pointer;
    min-width: 160px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23000000' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

.search-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--accent);
    color: var(--primary);
    border: none;
    border-radius: var(--radius-md);
    padding: 1rem 1.75rem;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.search-btn:hover {
    background: var(--accent-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-accent);
}

.search-btn:active {
    transform: translateY(0);
}

.search-btn .btn-icon {
    transition: transform var(--transition-base);
}

.search-btn:hover .btn-icon {
    transform: translateX(4px);
}

/* Mobile Search */
@media (max-width: 768px) {
    .search-header {
        padding: 1.25rem 1rem;
    }

    .search-inner {
        flex-wrap: wrap;
        border-radius: var(--radius-md);
        padding: 0.75rem;
    }

    .search-icon {
        width: 40px;
        height: 40px;
    }

    .search-input {
        flex: 1 1 calc(100% - 50px);
        font-size: 16px; /* Prevents iOS zoom */
    }

    .search-divider {
        display: none;
    }

    .category-select {
        flex: 1;
        margin-top: 0.5rem;
        padding: 0.875rem;
        background-color: var(--gray-100);
        border-radius: var(--radius-md);
        min-width: auto;
        font-weight: 500;
    }

    .search-btn {
        flex: 1;
        margin-top: 0.5rem;
        justify-content: center;
        padding: 1rem;
    }

    .btn-text {
        display: inline;
    }
}

/* ============================================
   Content Area
   ============================================ */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ============================================
   Map Section
   ============================================ */
.map-section {
    position: relative;
    background: var(--gray-200);
}

#sl_map {
    width: 100%;
    height: 400px;
}

#sl_current_location {
    position: absolute;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    z-index: 10;
}

.store_locator_current_location {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary);
    padding: 0.85rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 0.9rem;
    color: var(--white);
    max-width: 100%;
    border-left: 4px solid var(--accent);
}

.store_locator_current_location b {
    color: var(--accent);
    font-weight: 700;
}

/* Map Info Window */
.store_locator_map_infowindow {
    padding: 1rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--gray-700);
    max-width: 300px;
}

.store_locator_map_infowindow b {
    display: block;
    color: var(--primary);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
}

.store_locator_map_infowindow a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.store_locator_map_infowindow a:hover {
    color: var(--accent-dark);
    text-decoration: underline;
}

@media (max-width: 768px) {
    #sl_map {
        height: 300px;
    }
}

/* ============================================
   Results Section
   ============================================ */
.results-section {
    padding: 2rem 1.5rem 3rem;
    background: var(--gray-50);
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto 2rem;
    padding-bottom: 1.25rem;
    border-bottom: 2px solid var(--gray-200);
}

.results-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.results-title i {
    color: var(--accent);
    font-size: 1.25rem;
}

.pagination-info {
    font-size: 0.9rem;
    color: var(--gray-600);
    font-weight: 500;
}

.pagination-info a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    background: var(--white);
    border: 2px solid var(--gray-200);
}

.pagination-info a:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--primary);
}

.loading-indicator {
    display: block;
    text-align: center;
    padding: 1rem;
}

/* ============================================
   Stores Grid
   ============================================ */
.stores-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.25rem;
}

@media (max-width: 400px) {
    .stores-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Store Card - Modern Hero Image Design
   ============================================ */
.store-card {
    background: var(--white);
    border: none;
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: var(--shadow-md);
}

.store-card:hover {
    box-shadow: var(--shadow-xl), 0 0 0 2px var(--accent);
    transform: translateY(-6px);
}

/* Hero Image Container */
.store-card-image {
    position: relative;
    overflow: hidden;
}

.store-card-image .store-logo {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
    display: block;
    transition: transform var(--transition-slow);
}

.store-card:hover .store-card-image .store-logo {
    transform: scale(1.05);
}

/* Distance badge floating on image */
.store-card-image .store-distance {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    margin: 0;
}

/* Accent bar for cards without images */
.store-card:not(:has(.store-card-image))::before {
    content: '';
    display: block;
    height: 6px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-dark) 100%);
}

/* Legacy logo styling (backward compatibility) */
.store-logo:not(.store-card-image .store-logo) {
    width: 70px;
    height: 70px;
    border-radius: var(--radius-md);
    object-fit: cover;
    flex-shrink: 0;
}

/* Store Info Section */
.store-info {
    padding: 1.25rem 1.5rem 0.5rem;
    min-width: 0;
}

.store-name {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    cursor: pointer;
    transition: color var(--transition-fast);
    line-height: 1.25;
}

.store-name:hover {
    color: var(--accent-dark);
}

/* Distance Badge - Floating Style */
.store-distance {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--primary);
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    box-shadow: var(--shadow-sm);
}

.store-distance i {
    font-size: 0.65rem;
}

/* Store Category Tags */
.store-category-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.75rem;
}

.store-category-tag {
    display: inline-flex;
    align-items: center;
    background: var(--accent);
    color: var(--primary);
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.3rem 0.7rem;
    border-radius: var(--radius-full);
    border: none;
    transition: all var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.store-category-tag:hover {
    background: var(--primary);
    color: var(--accent);
}

.store-card-body {
    padding: 1rem 1.5rem 1.25rem;
    flex: 1;
}

.store-detail {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    margin-bottom: 0.85rem;
    font-size: 0.9rem;
    color: var(--gray-600);
}

.store-detail:last-child {
    margin-bottom: 0;
}

.store-detail i {
    width: 18px;
    color: var(--accent-dark);
    margin-top: 0.15rem;
    flex-shrink: 0;
    text-align: center;
    font-size: 0.95rem;
}

.store-detail a {
    color: var(--gray-700);
    text-decoration: none;
    transition: color var(--transition-fast);
    font-weight: 500;
}

.store-detail a:hover {
    color: var(--primary);
}

.store-hours {
    background: var(--gray-100);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-top: 0.75rem;
    border-left: 3px solid var(--accent);
}

.store-hours-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.store-hours-title i {
    color: var(--accent-dark);
}

.store-hours-content {
    font-size: 0.875rem;
    color: var(--gray-700);
    line-height: 1.6;
}

.store-card-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: 0.75rem;
    background: var(--white);
    margin-top: auto;
}

.store-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    font-size: 0.8rem;
    font-weight: 700;
    font-family: inherit;
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    cursor: pointer;
    border: 2px solid transparent;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.store-btn-primary {
    background: var(--accent);
    color: var(--primary);
    border-color: var(--accent);
}

.store-btn-primary:hover {
    background: var(--primary);
    color: var(--accent);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.store-btn-secondary {
    background: var(--white);
    color: var(--primary);
    border-color: var(--gray-300);
}

.store-btn-secondary:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--gray-500);
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--gray-300);
}

.empty-state i {
    font-size: 3.5rem;
    color: var(--accent);
    margin-bottom: 1.25rem;
}

.empty-state h3 {
    margin: 0 0 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.empty-state p {
    margin: 0;
    font-size: 1rem;
    color: var(--gray-500);
}

/* ============================================
   Legacy Compatibility
   ============================================ */
.store_locator_sidebar {
    /* Container styling handled by .stores-grid */
}

.store_locator_sidebar_entry {
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.store_locator_sidebar_entry:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--accent);
}

.store_locator_sidebar_entry_distance {
    color: var(--accent-dark);
    font-weight: 700;
    background: var(--primary);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    color: var(--accent);
    font-size: 0.8rem;
}

.store_locator_pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem;
    font-size: 0.9rem;
}

/* ============================================
   Utility Classes
   ============================================ */
.text-muted {
    color: var(--gray-500);
}

.capitalize {
    text-transform: capitalize;
}

/* Logo for backward compatibility */
.logo {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-md);
    object-fit: cover;
}

/* ============================================
   Scrollbar Styling
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .search-header {
        display: none;
    }

    .map-section {
        display: none;
    }

    .store-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid var(--gray-300);
    }
}
