:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-primary);
}

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

header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    padding: 40px 20px;
}

header h1 {
    font-size: 3.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.header-icon {
    width: 56px;
    height: 56px;
    vertical-align: middle;
    flex-shrink: 0;
    filter: drop-shadow(2px 4px 8px rgba(0,0,0,0.55));
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.95;
}

main {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
    min-height: 400px;
}

.search-container {
    margin-bottom: 30px;
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

#medicineSearch {
    flex: 1;
    padding: 16px 20px;
    font-size: 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    outline: none;
    transition: all 0.3s ease;
}

#medicineSearch:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-btn {
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

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

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

.suggestions {
    background: var(--bg-secondary);
    border-radius: 8px;
    display: none;
}

.suggestions.show {
    display: block;
    border: 1px solid var(--border-color);
}

.suggestion-item {
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.2s ease;
}

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

.loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

/* Ad banner inside loading */
.ad-banner {
    margin-top: 28px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: white;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.ad-label {
    font-size: 0.7rem;
    color: #9ca3af;
    text-align: right;
    padding: 4px 10px 0;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.ad-content {
    padding: 8px 16px 12px;
}

.ad-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    height: 90px;
    background: linear-gradient(135deg, #f0f4ff, #faf0ff);
    border-radius: 8px;
    border: 2px dashed #c4b5fd;
}

.ad-placeholder-icon {
    font-size: 2rem;
}

.ad-placeholder-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: #7c3aed;
}

.ad-countdown {
    font-size: 0.78rem;
    color: #9ca3af;
    text-align: center;
    padding: 6px 12px 10px;
    border-top: 1px solid var(--border-color);
}

.ad-countdown span {
    font-weight: 700;
    color: var(--primary-color);
}

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

@keyframes spin {
    to { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}

.error {
    background: #fee2e2;
    color: var(--error-color);
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid var(--error-color);
}

.filters {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.city-filter {
    flex: 1;
    padding: 10px 15px;
    font-size: 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: white;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    min-width: 150px;
}

.city-filter:hover {
    border-color: var(--primary-color);
}

.city-filter:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.results-count {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    background: white;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.results {
    display: grid;
    gap: 20px;
}

.pharmacy-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.pharmacy-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.pharmacy-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}

.pharmacy-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
}

.availability-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.available {
    background: #d1fae5;
    color: #065f46;
}

.limited {
    background: #fed7aa;
    color: #92400e;
}

.unavailable {
    background: #fee2e2;
    color: #991b1b;
}

.medicine-info {
    margin-bottom: 15px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    display: flex;
    gap: 15px;
}

.product-image {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.medicine-content {
    flex: 1;
    min-width: 0;
}

.medicine-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.product-link {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 10px;
    transition: color 0.2s ease;
}

.product-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.stock-info {
    font-weight: 600;
}

.stock-info.available {
    color: #065f46;
}

.stock-info.limited {
    color: #92400e;
}

.stock-info.unavailable {
    color: #991b1b;
}

.medicine-details {
    display: grid;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.detail-row {
    display: flex;
    gap: 8px;
}

.detail-label {
    font-weight: 600;
    min-width: 80px;
}

.price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--success-color);
    margin-bottom: 10px;
}

.pharmacy-location {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.pharmacy-location strong {
    color: var(--text-primary);
}

.pharmacy-location a {
    color: var(--primary-color);
    text-decoration: none;
}

.pharmacy-location a:hover {
    text-decoration: underline;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

footer {
    text-align: center;
    color: white;
    margin-top: 40px;
    padding: 20px;
    opacity: 0.9;
}

footer p {
    margin: 5px 0;
}

/* ============================================================
   GROUPED BY NETWORK DISPLAY
   ============================================================ */

.network-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
}

.network-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: white;
    border-bottom: 1px solid var(--border-color);
}

.network-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.network-name-badge {
    color: white;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 5px 14px;
    border-radius: 20px;
    letter-spacing: 0.3px;
}

.network-summary {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Products row */
.products-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-secondary);
}

/* Product thumbnail card */
.product-thumb-card {
    display: flex;
    flex-direction: column;
    width: 145px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background: white;
    transition: all 0.2s ease;
    user-select: none;
}

.product-thumb-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
    transform: translateY(-2px);
}

.product-thumb-card.active {
    border-color: var(--primary-color);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.25);
    background: #eff6ff;
}

.product-thumb-card.out-of-stock {
    opacity: 0.6;
}

.product-thumb-img-wrap {
    width: 100%;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    overflow: hidden;
}

.product-thumb-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-thumb-placeholder {
    font-size: 2.5rem;
    color: var(--text-secondary);
}

.product-thumb-info {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.product-thumb-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-thumb-price {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--success-color);
}

.product-thumb-stock-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    align-self: flex-start;
}

.product-thumb-stock-badge.available {
    background: #d1fae5;
    color: #065f46;
}

.product-thumb-stock-badge.unavailable {
    background: #fee2e2;
    color: #991b1b;
}

/* Product detail panel */
.product-detail-panel {
    border-top: 2px solid var(--border-color);
    background: white;
}

.product-detail-content {
    padding: 20px;
}

.product-detail-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.detail-product-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 8px;
    background: var(--bg-secondary);
    flex-shrink: 0;
    border: 1px solid var(--border-color);
}

.product-detail-meta {
    flex: 1;
    min-width: 0;
}

.product-detail-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.4;
}

.product-detail-price {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--success-color);
    margin-bottom: 8px;
}

.detail-close-btn {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s;
    flex-shrink: 0;
    line-height: 1;
}

.detail-close-btn:hover {
    background: #fee2e2;
    border-color: var(--error-color);
    color: var(--error-color);
}

/* Locations */
.locations-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.locations-group-title {
    font-size: 0.875rem;
    font-weight: 700;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
}

.locations-group-title.available { color: #065f46; }
.locations-group-title.unavailable { color: #991b1b; }

.location-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 8px;
    background: var(--bg-secondary);
    margin-bottom: 8px;
    border: 1px solid var(--border-color);
}

.location-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 5px;
}

.location-status-dot.available {
    background: var(--success-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.location-status-dot.limited {
    background: var(--warning-color);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.location-status-dot.unavailable {
    background: #d1d5db;
}

.location-info {
    flex: 1;
    min-width: 0;
}

.location-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.location-address,
.location-phone,
.location-hours {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.location-phone a {
    color: var(--primary-color);
    text-decoration: none;
}

.location-phone a:hover {
    text-decoration: underline;
}

.location-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    flex-shrink: 0;
}

.location-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--success-color);
    white-space: nowrap;
}

.location-status-text {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 10px;
    white-space: nowrap;
}

.location-status-text.available { background: #d1fae5; color: #065f46; }
.location-status-text.limited { background: #fed7aa; color: #92400e; }
.location-status-text.unavailable { background: #fee2e2; color: #991b1b; }

/* ============================================================
   PWA INSTALL BANNER
   ============================================================ */
#pwa-install-banner {
    position: fixed;
    bottom: calc(16px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 12px 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 9999;
    max-width: calc(100vw - 32px);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

#pwa-install-banner span {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.pwa-banner-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

#pwa-install-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

#pwa-install-btn:hover {
    background: var(--primary-hover);
}

#pwa-dismiss-btn {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

#pwa-dismiss-btn:hover {
    background: var(--border-color);
}

/* PWA FAB — малък бутон в ъгъла след отхвърляне */
#pwa-fab {
    position: fixed;
    bottom: calc(16px + env(safe-area-inset-bottom));
    right: 16px;
    z-index: 9998;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: white;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.2s;
}

#pwa-fab:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

/* ============================================================
   RESPONSIVE DESIGN — mobile-first breakpoints
   ============================================================ */

/* ── Small phones (≤ 480px) ── */
@media (max-width: 480px) {
    body {
        padding: 0;
        background: linear-gradient(160deg, #667eea 0%, #764ba2 40%, #f9fafb 40%);
        /* iOS safe area */
        padding-bottom: env(safe-area-inset-bottom);
    }

    .container {
        max-width: 100%;
    }

    header {
        padding: 24px 16px 20px;
        margin-bottom: 0;
    }

    header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    main {
        border-radius: 16px 16px 0 0;
        padding: 20px 14px;
        min-height: calc(100vh - 130px);
    }

    .search-container {
        margin-bottom: 20px;
    }

    .search-box {
        flex-direction: row; /* keep on one line on small phone */
        gap: 8px;
    }

    #medicineSearch {
        padding: 14px 14px;
        font-size: 16px; /* prevents iOS zoom */
        border-radius: 10px;
    }

    .search-btn {
        padding: 14px 16px;
        font-size: 14px;
        border-radius: 10px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .filters {
        flex-direction: column;
        align-items: stretch;
        padding: 14px;
        gap: 10px;
    }

    .filter-group {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        min-width: unset;
    }

    .filter-group label {
        font-size: 0.85rem;
        white-space: nowrap;
        min-width: 70px;
    }

    .city-filter {
        flex: 1;
        padding: 9px 10px;
        font-size: 14px;
    }

    .results-count {
        text-align: center;
        font-size: 13px;
        padding: 6px 12px;
    }

    /* Network section */
    .network-header {
        padding: 12px 14px;
    }

    .network-name-badge {
        font-size: 0.85rem;
        padding: 4px 12px;
    }

    .network-summary {
        font-size: 0.8rem;
    }

    .products-row {
        gap: 8px;
        padding: 10px 10px 12px;
    }

    /* 2 columns on small phone */
    .product-thumb-card {
        width: calc(50% - 4px);
    }

    .product-thumb-img-wrap {
        height: 85px;
    }

    .product-thumb-info {
        padding: 7px;
    }

    .product-thumb-name {
        font-size: 0.75rem;
    }

    .product-thumb-price {
        font-size: 0.85rem;
    }

    /* Detail panel */
    .product-detail-content {
        padding: 14px;
    }

    .product-detail-header {
        flex-wrap: wrap;
        gap: 10px;
    }

    .detail-product-image {
        width: 64px;
        height: 64px;
    }

    .product-detail-name {
        font-size: 1rem;
    }

    .product-detail-price {
        font-size: 1.2rem;
    }

    .location-item {
        flex-wrap: wrap;
        padding: 10px 12px;
        gap: 8px;
    }

    .location-name {
        font-size: 0.9rem;
    }

    .location-address,
    .location-phone,
    .location-hours {
        font-size: 0.8rem;
    }

    .location-right {
        align-items: flex-start;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
        width: 100%;
        margin-top: 4px;
    }

    .location-price {
        font-size: 0.95rem;
    }

    footer {
        border-radius: 0;
        padding: 16px;
        margin-top: 20px;
        font-size: 0.85rem;
    }
}

/* ── Tablets / large phones (481px – 768px) ── */
@media (min-width: 481px) and (max-width: 768px) {
    body {
        padding: 16px;
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }

    header {
        padding: 28px 20px;
        margin-bottom: 0;
    }

    header h1 {
        font-size: 2.5rem;
    }

    main {
        padding: 28px 24px;
        border-radius: 14px;
    }

    .search-box {
        gap: 10px;
    }

    #medicineSearch {
        font-size: 16px;
    }

    .filters {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 12px;
    }

    .filter-group {
        flex: 1;
        min-width: 160px;
    }

    .products-row {
        gap: 10px;
        padding: 14px 16px;
    }

    /* 3 columns on tablet */
    .product-thumb-card {
        width: calc(33.333% - 7px);
    }

    .location-item {
        flex-wrap: wrap;
    }

    .location-right {
        align-items: flex-start;
        flex-direction: row;
        gap: 8px;
        width: 100%;
        margin-top: 6px;
    }
}

/* ── Desktop (769px+) ── */
@media (min-width: 769px) {
    .product-thumb-card {
        width: 145px;
    }
}

/* ── Touch improvements for all mobile ── */
@media (hover: none) and (pointer: coarse) {
    .search-btn,
    .city-filter,
    .product-thumb-card,
    .detail-close-btn {
        min-height: 44px; /* Apple HIG minimum touch target */
    }

    .product-thumb-card:hover {
        transform: none; /* disable hover lift on touch */
        box-shadow: none;
    }

    .product-thumb-card:active {
        transform: scale(0.97);
        border-color: var(--primary-color);
    }
}

/* ============================================================
   WELCOME SECTION (shown before any search)
   ============================================================ */
.welcome-section {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* How it works */
.how-it-works {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 20px 24px;
}

.how-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    flex: 1;
    min-width: 140px;
    max-width: 200px;
}

.how-step__icon {
    font-size: 1.8rem;
    flex-shrink: 0;
}

.how-step strong {
    display: block;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.how-step p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

.how-step__arrow {
    font-size: 1.4rem;
    color: var(--border-color);
    flex-shrink: 0;
    font-weight: 300;
}

/* Popular searches */
.popular-searches {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.popular-searches__label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.popular-searches__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.search-chip {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 7px 16px;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-chip:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #eff6ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
}

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

@media (max-width: 480px) {
    .how-it-works {
        padding: 14px;
        gap: 4px;
    }

    .how-step {
        min-width: 100%;
        max-width: 100%;
        padding: 6px 4px;
    }

    .how-step__arrow {
        transform: rotate(90deg);
        display: none; /* cleaner on mobile */
    }

    .search-chip {
        font-size: 0.85rem;
        padding: 8px 14px;
    }
}

/* ============================================================
   COOKIE CONSENT BANNER (GDPR)
   ============================================================ */
.cookie-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    display: flex;
    justify-content: center;
    padding: 12px 16px;
    padding-top: calc(12px + env(safe-area-inset-top));
    pointer-events: none;
}

.cookie-banner__content {
    background: #1f2937;
    color: #f9fafb;
    border-radius: 14px;
    padding: 16px 20px;
    max-width: 720px;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    pointer-events: all;
    flex-wrap: wrap;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.cookie-banner__text {
    flex: 1;
    font-size: 0.88rem;
    line-height: 1.6;
    color: #d1d5db;
    min-width: 200px;
}

.cookie-banner__text a {
    color: #93c5fd;
    text-decoration: underline;
}

.cookie-banner__actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.cookie-btn {
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.cookie-btn--accept {
    background: var(--primary-color);
    color: white;
}

.cookie-btn--accept:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.cookie-btn--decline {
    background: transparent;
    color: #9ca3af;
    border: 1px solid #4b5563;
}

.cookie-btn--decline:hover {
    background: #374151;
    color: #d1d5db;
}

@media (max-width: 480px) {
    .cookie-banner__content {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 14px 16px;
    }

    .cookie-banner__actions {
        justify-content: stretch;
    }

    .cookie-btn {
        flex: 1;
        text-align: center;
        padding: 11px 14px;
    }
}
