/* [HIGHLIGHT-ADDED] New file: "Pharmacies proches de moi" (city pages, pilot Temara). */

.pharmacy-geo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 18px;
    border: 0;
    border-radius: 999px;
    background: #0d9488;
    color: #fff;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(13, 148, 136, 0.25);
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.pharmacy-geo-btn:hover {
    background: #0f766e;
    box-shadow: 0 3px 10px rgba(13, 148, 136, 0.35);
}

.pharmacy-geo-btn:focus-visible {
    outline: 3px solid #5eead4;
    outline-offset: 2px;
}

.pharmacy-geo-btn__icon {
    flex: 0 0 auto;
}

/* [HIGHLIGHT-ADDED] Screen-reader-only status line (#pharmacy-geo-status). */
.pharmacy-geo-sr {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.pharmacy-geo-btn__label-ar {
    font-weight: 500;
    opacity: 0.9;
}

.pharmacy-geo-btn.is-loading {
    cursor: progress;
    opacity: 0.85;
}

.pharmacy-geo-btn.is-loading .pharmacy-geo-btn__icon {
    animation: pharmacy-geo-pulse 1s ease-in-out infinite;
}

.pharmacy-geo-btn.is-loading .pharmacy-geo-btn__label-ar {
    display: none;
}

@keyframes pharmacy-geo-pulse {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* [HIGHLIGHT-ADDED] Hero CTA under the open count (size / colour basics are also in the
   critical CSS so the button is styled before this file loads). */
.pharmacy-geo-cta {
    position: relative;
    margin: 10px 0 4px; /* [HIGHLIGHT-MODIFIED] was 14px 0 6px */
}

.pharmacy-geo-btn--hero {
    width: 100%;
    max-width: 420px;
    min-height: 52px;
    padding: 12px 22px;
    justify-content: space-between;
    gap: 10px;
    border-radius: 14px;
    font-size: 1.05rem;
    font-weight: 700;
    box-shadow: 0 6px 16px rgba(13, 148, 136, 0.35);
    animation: pharmacy-geo-ring 1.6s ease-out 0.8s 2;
}

.pharmacy-geo-btn--hero .pharmacy-geo-btn__label {
    flex: 1 1 auto;
    text-align: left;
}

.pharmacy-geo-btn--hero .pharmacy-geo-btn__label-ar {
    flex: 0 0 auto;
    font-size: 0.95rem;
}

.pharmacy-geo-btn--hero:hover {
    box-shadow: 0 8px 20px rgba(13, 148, 136, 0.45);
}

.pharmacy-geo-cta__hint {
    margin: 4px 0 0; /* [HIGHLIGHT-MODIFIED] was 6px 0 0 */
    color: #475569;
    font-size: 0.85rem;
}

@keyframes pharmacy-geo-ring {
    0% { box-shadow: 0 6px 16px rgba(13, 148, 136, 0.35), 0 0 0 0 rgba(13, 148, 136, 0.45); }
    100% { box-shadow: 0 6px 16px rgba(13, 148, 136, 0.35), 0 0 0 14px rgba(13, 148, 136, 0); }
}

/* Panel */
.pharmacy-geo-panel {
    margin: 16px 0 20px;
    padding: 16px;
    border: 1px solid #99f6e4;
    border-radius: 12px;
    background: #f0fdfa;
}

.pharmacy-geo-panel[hidden] {
    display: none;
}

.pharmacy-geo-panel__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.pharmacy-geo-panel__title {
    margin: 0;
    padding: 0;
    color: #134e4a;
    font-size: 1.15rem;
    line-height: 1.3;
}

.pharmacy-geo-panel__close {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 4px 12px;
    border: 1px solid #99f6e4;
    border-radius: 999px;
    background: #fff;
    color: #0f766e;
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
}

.pharmacy-geo-panel__notice {
    margin: 0 0 10px;
    padding: 8px 12px;
    border-left: 4px solid #0d9488;
    border-radius: 4px;
    background: #fff;
    color: #1f2937;
    font-size: 0.9rem;
}

.pharmacy-geo-panel__notice.is-warning {
    border-left-color: #d97706;
    background: #fffbeb;
}

.pharmacy-geo-panel__list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pharmacy-geo-panel__list > li::before,
.pharmacy-geo-panel__list > li::marker {
    content: none;
}

.pharmacy-geo-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
}

.pharmacy-geo-item.is-open {
    border-color: #b7dfc1;
}

.pharmacy-geo-item__top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.pharmacy-geo-item__rank,
.pharmacy-geo-item__distance,
.pharmacy-geo-item__status {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.3;
}

.pharmacy-geo-item__rank {
    background: #134e4a;
    color: #fff;
}

.pharmacy-geo-item__distance {
    border: 1px solid #99f6e4;
    background: #f0fdfa;
    color: #0f766e;
}

.pharmacy-geo-item__status.is-open {
    border: 1px solid #b7dfc1;
    background: #e6f4ea;
    color: #1e7e34;
}

.pharmacy-geo-item__status.is-closed {
    border: 1px solid #f5c6cb;
    background: #fdecea;
    color: #c0392b;
}

.pharmacy-geo-item__status.is-soon {
    border: 1px solid #fcd34d;
    background: #fffbeb;
    color: #92400e;
}

/* [HIGHLIGHT-ADDED] No open-now badge on the source card. */
.pharmacy-geo-item__status.is-unknown {
    border: 1px solid #d1d5db;
    background: #f9fafb;
    color: #374151;
}

.pharmacy-geo-item__name {
    margin: 2px 0 0;
    color: #111827;
    font-size: 1rem;
    font-weight: 700;
}

.pharmacy-geo-item__name-ar {
    margin: 0;
    color: #374151;
    font-size: 0.95rem;
}

.pharmacy-geo-item__meta {
    margin: 0;
    color: #4b5563;
    font-size: 0.85rem;
}

.pharmacy-geo-item__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.pharmacy-geo-item__action,
.pharmacy-geo-panel__fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 6px 14px;
    border: 1px solid #0d9488;
    border-radius: 8px;
    background: #fff;
    color: #0f766e;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.pharmacy-geo-item__action.is-primary,
.pharmacy-geo-panel__fallback.is-primary {
    background: #0d9488;
    color: #fff;
}

.pharmacy-geo-item__action.is-ghost {
    border-color: #d1d5db;
    color: #374151;
}

.pharmacy-geo-item__action:hover,
.pharmacy-geo-panel__fallback:hover {
    background: #ccfbf1;
    color: #134e4a;
}

.pharmacy-geo-item__action:focus-visible,
.pharmacy-geo-panel__fallback:focus-visible,
.pharmacy-geo-panel__close:focus-visible {
    outline: 3px solid #5eead4;
    outline-offset: 2px;
}

.pharmacy-geo-panel__message {
    padding: 10px 12px;
    border-left: 4px solid #d97706;
    border-radius: 4px;
    background: #fff;
}

.pharmacy-geo-panel__message-text {
    margin: 0;
    color: #1f2937;
}

.pharmacy-geo-panel__message-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.pharmacy-geo-panel__privacy {
    margin: 10px 0 0;
    color: #6b7280;
    font-size: 0.78rem;
}

/* Per-card distance badge */
.pharmacy-distance-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border: 1px solid #99f6e4;
    border-radius: 999px;
    background: #f0fdfa;
    color: #0f766e;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
}

.pharmacy-header > .pharmacy-distance-badge,
.pharmacy-header-badges > .pharmacy-distance-badge {
    margin-left: 6px;
}

.pharmacy-card.is-geo-highlight {
    outline: 3px solid #0d9488;
    outline-offset: 3px;
    transition: outline-color 0.3s ease;
}

.pharmacy-card:focus {
    outline: none;
}

.pharmacy-card.is-geo-highlight:focus {
    outline: 3px solid #0d9488;
}

@media (max-width: 768px) {
    .pharmacy-geo-btn {
        width: 100%;
    }

    /* [HIGHLIGHT-ADDED] */
    .pharmacy-geo-btn--hero {
        max-width: none;
    }

    .pharmacy-geo-panel {
        padding: 12px;
    }

    .pharmacy-geo-panel__list {
        grid-template-columns: 1fr;
    }

    .pharmacy-geo-item__action {
        flex: 1 1 auto;
    }
}

/* [HIGHLIGHT-ADDED] Phones: keep "Pharmacies proches de moi" on one line. */
@media (max-width: 480px) {
    .pharmacy-geo-btn--hero {
        flex-wrap: wrap;
        justify-content: flex-start;
        row-gap: 2px;
        min-height: 46px; /* [HIGHLIGHT-ADDED] was 52px from the base rule */
        padding: 8px 16px; /* [HIGHLIGHT-MODIFIED] was 10px 16px */
        font-size: 1rem;
    }

    .pharmacy-geo-btn--hero .pharmacy-geo-btn__label {
        white-space: nowrap;
    }

    /* Arabic label on its own line, under the French one (32px = icon + gap). */
    .pharmacy-geo-btn--hero .pharmacy-geo-btn__label-ar {
        flex-basis: 100%;
        padding-left: 32px;
        text-align: left;
        font-size: 0.88rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pharmacy-geo-btn.is-loading .pharmacy-geo-btn__icon,
    .pharmacy-geo-btn--hero { /* [HIGHLIGHT-MODIFIED] hero ring added */
        animation: none;
    }
}
