/* === VARIABLES === */
:root {
    /* Couleurs principales */
    --primary: #0078d7;
    --primary-dark: #005bb5;
    
    /* Couleurs des catégories */
    --ruby-primary: #e0115f;
    --ruby-secondary: #b10d48;
    --premium-primary: #b8860b;
    --premium-border: gold;
    --standard-border: silver;
    --gray-border: #ccc;
    
    /* Couleurs de fond et texte */
    --background: #f8f9fa;
    --text: #2c3e50;
    
    /* Effets */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 20px rgba(0, 0, 0, 0.2);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

/* === GLOBAL STYLES === */
body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}

main {
    flex: 1;
    padding: 16px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

/* === Utility Classes === */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.radius-sm { border-radius: var(--radius-sm); }
.radius-md { border-radius: var(--radius-md); }
.radius-lg { border-radius: var(--radius-lg); }

.transition-fast { transition: all var(--transition-fast); }
.transition-normal { transition: all var(--transition-normal); }

/* === Animations === */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shine {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}
/* === HEADER & SEARCH === */
header {
    background: var(--primary);
    color: white;
    text-align: center;
    padding: 1rem;
    box-shadow: var(--shadow-sm);
}

#search-section {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: white;
    padding: 1rem;
    box-shadow: var(--shadow-sm);
}

.search-bar {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 600px;
    margin: 0 auto;
}

.search-bar input {
    padding: 0.8rem;
    border: 1px solid var(--gray-border);
    border-radius: var(--radius-md);
    font-size: 1rem;
}

.search-bar button {
    padding: 0.8rem;
    border: none;
    border-radius: var(--radius-md);
    background: var(--primary);
    color: white;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background var(--transition-fast);
}

/* === MAP SECTION === */
#map-section {
    position: relative;
    z-index: 500;
    margin: 1rem 0;
    opacity: 1;
    visibility: visible;
    height: auto;
    transition: opacity 0.3s ease;
}

#map-section.hidden {
    opacity: 0;
    visibility: hidden;
    height: 0;
    overflow: hidden;
}

#map {
    width: 100%;
    height: 300px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

/* === GUIDE SECTION === */
.guide-container {
    padding: 1rem;
    margin: 1rem auto;
    max-width: 600px;
}

.guide-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    animation: fadeIn 0.5s ease-in-out;
}

.guide-step {
    display: flex;
    align-items: center;
    margin: 1rem 0;
    padding: 0.8rem;
    background: var(--background);
    border-radius: var(--radius-md);
}

.step-number {
    background: var(--primary);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-weight: bold;
}

.guide-info {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.guide-card.hidden,
.guide-card.after-search {
    display: none !important;
}
/* === BASE STORE CARD === */
.store-card {
    position: relative;
    border: 1px solid var(--gray-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin: 1rem auto;
    max-width: 500px;
    background: white;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast);
    overflow: hidden;
    animation: fadeIn 0.5s ease-out;
}

/* === RUBY STYLE === */
.store-card.ruby {
    background: linear-gradient(135deg, #fff5f8 0%, #ffdce5 100%);
    border: 2px solid var(--ruby-primary);
    box-shadow: var(--shadow-lg);
}

.store-card.ruby::before {
    content: 'RUBY';
    position: absolute;
    top: -10px;
    left: -10px;
    background: linear-gradient(135deg, var(--ruby-primary), var(--ruby-secondary));
    color: white;
    padding: 5px 15px 5px 20px;
    font-weight: bold;
    transform: rotate(-3deg);
    box-shadow: var(--shadow-sm);
    z-index: 2;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.store-card.ruby h3 {
    color: var(--ruby-secondary);
    font-size: 1.5rem;
    margin-top: 1.5rem;
}

/* === PREMIUM STYLE === */
.store-card.premium {
    border: 2px solid var(--premium-border);
    background: linear-gradient(to right, #fff8e1, #ffecb3);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.store-card.premium::before {
    content: 'PREMIUM';
    position: absolute;
    background: var(--premium-primary);
    color: white;
    font-weight: bold;
    text-align: center;
    width: 150px;
    right: -38px;
    top: 25px;
    transform: rotate(45deg);
    padding: 5px 0;
    z-index: 10;
    font-size: 0.8rem;
    box-shadow: var(--shadow-sm);
}

/* === STANDARD STYLE === */
.store-card.standard {
    border: 2px solid var(--primary);
    background: linear-gradient(to bottom, var(--background), #e9ecef);
    box-shadow: 0 4px 15px rgba(0, 120, 215, 0.15);
}

.store-card.standard h3 {
    color: var(--primary-dark);
    font-weight: 600;
}

/* === GRAY STYLE === */
.store-card.gris {
    border: 1px solid var(--gray-border);
    background: var(--background);
}

.store-card.gris::before {
    content: '🔍 Source externe';
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(108, 117, 125, 0.9);
    color: white;
    padding: 4px 12px;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 4px;
}

.store-card.gris h3 {
    margin-right: 140px;
}

/* === CARD CONTENT STYLES === */
.store-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin-right: 60px;
    margin-bottom: 8px;
}

.store-info {
    margin-top: 12px;
}

.contact-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 8px 0;
}

.details-btn {
    display: block;
    width: 90%;
    margin: 25px auto 15px;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--premium-primary), var(--premium-primary));
    color: white;
    text-align: center;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
}

.store-card.ruby .details-btn {
    background: linear-gradient(135deg, var(--ruby-primary), var(--ruby-secondary));
    box-shadow: 0 4px 15px rgba(224, 17, 95, 0.3);
}
/* === BASE BADGE STYLES === */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

/* === CATEGORY BADGES === */
.category-badge {
    extends: .badge;
    border-radius: 20px;
    margin-right: 8px;
}

.category-badge.ruby {
    background: linear-gradient(135deg, var(--ruby-primary), var(--ruby-secondary));
    color: white;
}

.category-badge.premium {
    background: linear-gradient(135deg, #ffd700, var(--premium-primary));
    color: white;
}

.category-badge.standard {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    color: #475569;
}

/* === DISTANCE BADGE === */
.distance-badge {
    extends: .badge;
    background: #f0f0f0;
    border-radius: 12px;
    font-size: 0.9rem;
    color: #666;
    margin-left: auto;
}

.distance-badge::before {
    content: '📍';
    margin-right: 4px;
}

/* === PRODUCT TAGS === */
.product-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    font-size: 0.875rem;
    color: #4b5563;
}

.premium .product-tag {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(184, 134, 11, 0.3);
    color: var(--premium-primary);
}

.ruby .product-tag {
    background: rgba(224, 17, 95, 0.1);
    border: 1px solid rgba(224, 17, 95, 0.3);
    color: var(--ruby-primary);
}

/* === PROMO TAG === */
.promo-tag {
    extends: .badge;
    background: var(--ruby-primary);
    color: white;
    font-size: 0.75rem;
    margin-left: 8px;
}

.promo-tag::before {
    content: '🏷️';
    margin-right: 4px;
}

/* === NEW BADGE === */
.new-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #22c55e;
    color: white;
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: bold;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    z-index: 2;
}

.new-badge::before {
    content: '🆕';
    margin-right: 4px;
}

/* === DISCOUNT BADGE === */
.discount-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--ruby-primary);
    color: white;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: bold;
    box-shadow: var(--shadow-sm);
    z-index: 3;
}

/* === PHONE BUTTON === */
.phone-button {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: #2ab21e;
    color: white;
    text-decoration: none;
    border-radius: 25px;
    transition: background-color var(--transition-fast);
}

.phone-button:hover {
    background: #229619;
    text-decoration: none;
}
/* === CATEGORIES FILTER === */
.categories-filter {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-border);
    border-radius: var(--radius-full);
    background: white;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.filter-btn:hover {
    background: var(--background);
}

.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary-dark);
}

/* === SUGGESTIONS === */
.suggestions-container {
    position: absolute;
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    background: white;
    border: 1px solid var(--gray-border);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
}

.suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.suggestion-item:hover {
    background-color: var(--background);
}

.suggestion-name {
    font-weight: 500;
}

.suggestion-detail {
    color: #666;
    font-size: 0.9em;
}

/* === MEDIA QUERIES === */
@media (max-width: 768px) {
    .search-bar {
        padding: 8px;
    }
    
    .store-card {
        margin: 8px;
        padding: 16px;
    }
    
    .details-btn {
        width: 100%;
        margin: 16px 0;
        padding: 12px;
    }
    
    .product-tag {
        font-size: 0.8125rem;
        padding: 4px 10px;
    }
    
    .filter-buttons {
        flex-direction: column;
    }
    
    .filter-btn {
        width: 100%;
        text-align: center;
    }
}

/* === LOADING === */
.loading-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    z-index: 1000;
    text-align: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 10px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}