* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

html,
body {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    background-color: #f8fafc;
    color: #1e293b;
    direction: rtl;
}

.app-header {
    background: #e53e3e;
    color: #ffffff;
}

.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #e53e3e;
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.app-brand {
    flex: 1;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.brand-icon {
    color: #ffffff;
    font-size: 1.5rem;
}

.brand-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff !important;
}

.menu-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.8);
    color: #ffffff;
    font-size: 1.6rem;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 4px;
}

.menu-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.nav-tag {
    background: #fff;
    color: #e53e3e;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}

.sidebar {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100%;
    background: #fff;
    box-shadow: -2px 0 12px rgba(0,0,0,0.2);
    padding: 24px 20px;
    z-index: 9999;
    transition: right 0.3s ease;
}

.sidebar.active {
    right: 0;
}

.sidebar-brand {
    color: #e53e3e;
    font-size: 1.5rem;
    font-weight: 800;
    margin-top: 50px;
    border-bottom: 1px solid #eee;
    padding-bottom: 16px;
}

.sidebar-item,
.sidebar-link {
    display: block;
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid #eee;
    color: #333;
    font-size: 1rem;
    font-weight: 700;
    padding: 14px 12px;
    text-align: right;
    text-decoration: none;
    cursor: pointer;
}

.sidebar-item:hover {
    background: #fff5f5;
}

.close-btn {
    position: absolute;
    left: 16px;
    top: 16px;
    font-size: 30px;
    color: #e53e3e;
    cursor: pointer;
}

.static-page {
    max-width: 780px;
    margin: 30px auto;
    padding: 16px;
}

.static-page-card {
    background: #ffffff;
    border: 1px solid #fed7d7;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    padding: 28px 24px;
}

.static-page-title {
    color: #e53e3e;
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 16px;
    text-align: center;
}

.static-page-copy {
    color: #334155;
    line-height: 1.8;
    font-size: 1rem;
    margin-bottom: 14px;
    text-align: right;
}

.pharmacy-page {
    max-width: 800px;
    margin: 15px auto;
    padding: 0 12px;
}

.date-banner {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    color: #c53030;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
}

.search-panel {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.search-inputs-row {
    display: flex;
    gap: 8px;
    width: 100%;
    margin-bottom: 10px;
}

.search-inputs-row select,
.search-inputs-row input {
    flex: 1;
    min-width: 0;
}


.search-buttons-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    width: 100%;
}

.btn-search,
.btn-geo {
    flex: 0 0 45%;
    max-width: 45%;
    width: 45%;
}

.form-control {
    flex: 2;
    min-width: 150px;
    padding: 10px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    font-size: 0.95rem;
    background: white;
}

.btn-search {
    padding: 10px 16px;
    background: #e53e3e;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}

.btn-geo {
    padding: 10px 14px;
    background: #334155;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}

.promo-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #ffffff;
    border: 1px solid #fed7d7;
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
    padding: 16px;
    margin: 16px 0 20px;
}

.promo-image-wrap {
    flex: 0 0 120px;
}

.promo-image {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.promo-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.promo-title {
    color: #e53e3e;
    font-size: clamp(1.3rem, 2vw, 1.7rem);
    font-weight: 800;
    line-height: 1.6;
}

.promo-subtitle {
    color: #475569;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.6;
}

.promo-button {
    width: fit-content;
    background: #e53e3e;
    color: #ffffff;
    text-decoration: none;
    font-weight: 800;
    padding: 10px 16px;
    border-radius: 999px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.promo-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 14px rgba(229, 62, 62, 0.24);
}

@media (max-width: 640px) {
    .promo-banner {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .promo-image-wrap {
        flex-basis: auto;
        display: flex;
        justify-content: center;
    }

    .promo-button {
        align-self: center;
    }
}

#map {
    height: 300px;
    border-radius: 12px;
    margin-bottom: 15px;
    z-index: 1;
    position: relative;
    border: 1px solid #e2e8f0;
}

#loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
}

#loading .spinner-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.2);
    border-top-color: #e53e3e;
    border-left-color: #e53e3e;
    animation: spin 0.9s linear infinite;
}

#loading .loading-text {
    color: #fff;
    font-weight: bold;
    margin-top: 12px;
}

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

.pharmacy-grid {
    display: grid;
    gap: 12px;
}

.pharmacy-card {
    background: white;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
    border-right: 4px solid #e53e3e;
}

.pharmacy-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    gap: 8px;
}

.pharmacy-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: #1e3a8a;
}

.district-badge {
    background: #f1f5f9;
    color: #475569;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

.pharmacy-info {
    font-size: 0.9rem;
    margin-bottom: 5px;
    color: #475569;
}

.actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.btn-action {
    text-decoration: none;
    padding: 8px;
    border-radius: 6px;
    font-size: 0.85rem;
    text-align: center;
    flex: 1;
    font-weight: bold;
}

.btn-call { background: #16a34a; color: white; }
.btn-map { background: #2563eb; color: white; }

.loading-spinner,
.status-msg {
    text-align: center;
    padding: 20px;
    font-weight: bold;
    color: #718096;
}

.status-msg.error {
    color: #e53e3e;
}

.gps-marker-icon {
    background: transparent;
    border: none;
}

.gps-marker-pin {
    display: inline-block;
    font-size: 26px;
    color: #3182ce;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.ad-banner-728x90 {
    width: 100%;
    max-width: 728px;
    margin: 12px auto 0;
    overflow-x: hidden;
}

.responsive-banner-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.responsive-banner-frame {
    width: 100%;
    max-width: 728px;
    margin: 0 auto;
    overflow-x: hidden;
}

.responsive-banner-wrap {
    width: 100%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

.responsive-banner-frame {
    max-width: 100%;
    transform-origin: center top;
}

@media (max-width: 768px) {
    html,
    body {
        width: 100%;
        margin: 0;
        padding: 0;
        overflow-x: hidden;
    }

    .search-panel {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        width: 100%;
    }

    #citySelect,
    #cityInput {
        width: 100%;
    }

    #searchBtn,
    #geoBtn {
        width: 40% !important;
        flex: 0 0 40%;
    }

    #searchBtn,
    #geoBtn {
        display: flex;
        flex-direction: row;
        justify-content: center;
        gap: 10px;
        width: 100%;
    }

    .search-panel #searchBtn,
    .search-panel #geoBtn {
        width: 40% !important;
        flex: 0 0 40%;
    }

    .search-panel {
        flex-wrap: wrap;
    }

    .responsive-banner-frame iframe {
        max-width: 100% !important;
    }
}
