/* Kashiro Pro — pharmacy finder */
:root {
    --pf-bg: #f8fafc;
    --pf-text: #0f172a;
    --pf-muted: #64748b;
    --pf-border: #cbd5e1;
    --pf-blue: #2563eb;
    --pf-blue-hover: #1d4ed8;
    --pf-blue-soft: #dbeafe;
    --pf-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
    --pf-shadow-hover: 0 6px 20px rgba(37, 99, 235, 0.15);
    --pf-radius: 14px;
    --pf-green: #16a34a;
    --pf-red: #dc2626;
    --pf-font: "Noto Kufi Arabic", "Noto Sans Arabic", system-ui, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

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

body.pf-app {
    min-height: 100dvh;
    font-family: var(--pf-font);
    background: var(--pf-bg);
    color: var(--pf-text);
    display: flex;
    flex-direction: column;
}

.pf-header {
    padding: 2rem 1rem 0.5rem;
    text-align: center;
}

.pf-header__brand {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: inherit;
}

.pf-header__logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(37, 99, 235, 0.35));
}

.pf-header__name {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--pf-blue);
    letter-spacing: -0.02em;
}

.pf-header__tag {
    margin: 0.5rem 0 0;
    color: var(--pf-muted);
    font-size: 0.95rem;
}

.pf-main {
    flex: 1;
    width: min(840px, 100%);
    margin: 0 auto;
    padding: 0 1rem 2rem;
}

.pf-search-wrap {
    margin-top: 1.5rem;
}

.pf-search {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pf-search__box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem 0.35rem 1rem;
    border: 1px solid var(--pf-border);
    border-radius: var(--pf-radius);
    box-shadow: var(--pf-shadow);
    transition: box-shadow 0.15s ease;
    background: #fff;
}

.pf-search__box:focus-within {
    box-shadow: var(--pf-shadow-hover);
    border-color: var(--pf-blue);
}

.pf-search__icon {
    width: 20px;
    height: 20px;
    color: var(--pf-muted);
    flex-shrink: 0;
}

.pf-search__input {
    flex: 1;
    border: 0;
    outline: none;
    font: inherit;
    font-size: 1rem;
    background: transparent;
    min-width: 0;
    padding: 0.65rem 0;
}

.pf-search__scan {
    border: 0;
    background: var(--pf-blue-soft);
    color: var(--pf-blue);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.pf-search__scan svg {
    width: 22px;
    height: 22px;
}

.pf-search__scan:hover {
    background: #bfdbfe;
}

.pf-search__submit {
    align-self: center;
    border: 0;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.6rem 1.25rem;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.pf-search__submit:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
}

.pf-location-wrap {
    margin-top: 0.85rem;
    text-align: center;
}

.pf-location-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 0;
    background: transparent;
    color: var(--pf-blue);
    font: inherit;
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0.35rem 0.5rem;
    border-radius: 999px;
    transition: background 0.15s ease;
}

.pf-location-btn:hover,
.pf-location-btn[aria-expanded="true"] {
    background: var(--pf-blue-soft);
}

.pf-location-btn.is-gps {
    color: var(--pf-green);
}

.pf-location-btn.is-custom {
    color: #b06000;
}

.pf-location-btn__icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.pf-location-edit {
    margin: 0.65rem auto 0;
    max-width: 420px;
    padding: 0.75rem;
    border: 1px solid var(--pf-border);
    border-radius: 12px;
    background: #f8f9fa;
    text-align: start;
    box-shadow: var(--pf-shadow);
}

.pf-location-edit__label {
    display: block;
    font-size: 0.75rem;
    color: var(--pf-muted);
    margin-bottom: 0.45rem;
}

.pf-location-edit__row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.pf-location-edit__input {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--pf-border);
    border-radius: 8px;
    padding: 0.55rem 0.65rem;
    font: inherit;
    font-size: 0.875rem;
    background: #fff;
}

.pf-location-edit__input:focus {
    outline: 2px solid var(--pf-blue-soft);
    border-color: var(--pf-blue);
}

.pf-location-edit__save {
    border: 0;
    background: var(--pf-blue);
    color: #fff;
    font: inherit;
    font-size: 0.8125rem;
    padding: 0.55rem 0.85rem;
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
}

.pf-location-edit__save:hover {
    background: var(--pf-blue-hover);
}

.pf-location-edit__gps {
    margin-top: 0.55rem;
    border: 0;
    background: transparent;
    color: var(--pf-blue);
    font: inherit;
    font-size: 0.8125rem;
    cursor: pointer;
    padding: 0.15rem 0;
    text-decoration: underline;
}

.pf-status {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
}

.pf-status--error {
    background: #fce8e6;
    color: #c5221f;
}

.pf-user-status {
    margin-top: 1.25rem;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--pf-muted);
    line-height: 1.5;
}

.pf-user-status strong {
    color: var(--pf-text);
}

.pf-section-title {
    margin: 0 0 1rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--pf-text);
}

.pf-results {
    margin-top: 1.75rem;
}

.pf-results__head {
    margin-bottom: 0.25rem;
}

.pf-product-hero {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.1rem;
    border-radius: var(--pf-radius);
    background: linear-gradient(135deg, #eff6ff 0%, #fff 55%);
    border: 1px solid #bfdbfe;
    box-shadow: var(--pf-shadow);
}

.pf-product-hero__img {
    width: 76px;
    height: 76px;
    object-fit: contain;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--pf-border);
    flex-shrink: 0;
}

.pf-product-hero__img--ph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.pf-product-hero__body {
    min-width: 0;
}

.pf-product-hero__label {
    margin: 0;
    font-size: 0.75rem;
    color: var(--pf-muted);
}

.pf-product-hero__name {
    margin: 0.15rem 0 0;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.35;
}

.pf-product-hero__price {
    margin: 0.35rem 0 0;
    color: var(--pf-blue);
    font-size: 0.875rem;
    font-weight: 600;
}

.pf-results__meta {
    margin: 0.85rem 0 0;
    color: var(--pf-muted);
    font-size: 0.8125rem;
}

.pf-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.pf-card {
    background: #fff;
    border: 1px solid var(--pf-border);
    border-radius: var(--pf-radius);
    padding: 1rem 1.1rem;
    box-shadow: var(--pf-shadow);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.pf-card:hover {
    box-shadow: var(--pf-shadow-hover);
}

.pf-card__top {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.pf-card__brand {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
}

.pf-card__logo {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid var(--pf-border);
    flex-shrink: 0;
}

.pf-card__logo--lg {
    width: 64px;
    height: 64px;
}

.pf-card__logo--default {
    object-fit: contain;
    padding: 0.35rem;
    background: #eff6ff;
}

.pf-card__brand-body {
    flex: 1;
    min-width: 0;
}

.pf-card__title {
    margin: 0 0 0.4rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--pf-text);
    line-height: 1.35;
}

.pf-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.pf-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.4;
}

.pf-badge--pharmacy {
    background: #dcfce7;
    color: #166534;
}

.pf-badge--restaurant {
    background: #ffedd5;
    color: #c2410c;
}

.pf-badge--shop {
    background: #e0e7ff;
    color: #3730a3;
}

.pf-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    background: #f1f5f9;
    color: var(--pf-muted);
}

.pf-offer {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    padding: 0.75rem;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
}

.pf-offers {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin-top: 0.75rem;
}

.pf-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1.25rem;
}

.pf-page-btn {
    font: inherit;
    font-size: 0.85rem;
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    border: 1px solid var(--pf-border);
    background: #fff;
    color: var(--pf-text);
    cursor: pointer;
}

.pf-page-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.pf-page-info {
    font-size: 0.85rem;
    color: var(--pf-muted);
}

.pf-offer__img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 10px;
    background: #fff;
    border: 1px solid var(--pf-border);
    flex-shrink: 0;
}

.pf-offer__img--ph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.pf-offer__body {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.pf-offer__label {
    font-size: 0.7rem;
    color: var(--pf-muted);
}

.pf-offer__name {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.35;
}

.pf-offer__price {
    font-size: 0.85rem;
    color: var(--pf-blue);
    font-weight: 600;
}

.pf-card__about {
    margin: 0.85rem 0 0;
    font-size: 0.875rem;
    line-height: 1.55;
    color: #334155;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pf-card__address,
.pf-card__phone {
    margin: 0.45rem 0 0;
    font-size: 0.8125rem;
    color: var(--pf-muted);
    line-height: 1.45;
    display: flex;
    gap: 0.35rem;
    align-items: flex-start;
}

.pf-card__address-icon,
.pf-card__phone-icon {
    flex-shrink: 0;
    line-height: 1.35;
}

.pf-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.95rem;
    padding-top: 0.85rem;
    border-top: 1px solid #eef2f7;
}

.pf-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    font: inherit;
    font-size: 0.8125rem;
    text-decoration: none;
    border: 1px solid var(--pf-border);
    background: #fff;
    color: var(--pf-text);
    cursor: pointer;
}

.pf-btn--primary {
    background: var(--pf-blue);
    border-color: var(--pf-blue);
    color: #fff;
}

.pf-btn--primary:hover {
    background: var(--pf-blue-hover);
}

.pf-btn--wa {
    border-color: #25d366;
    color: #128c7e;
}

.pf-listing-ad {
    display: block;
    margin-bottom: 0.75rem;
    padding: 0.65rem 0.8rem;
    border-radius: 10px;
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border: 1px solid #fdba74;
    color: #9a3412;
    text-decoration: none;
}

.pf-listing-ad--static {
    display: block;
}

.pf-listing-ad__title {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 0.15rem;
}

.pf-listing-ad__body {
    display: block;
    font-size: 0.8125rem;
    line-height: 1.45;
}

.pf-search__submit:disabled {
    opacity: 0.72;
    cursor: wait;
}

.pf-empty {
    text-align: center;
    margin-top: 2.5rem;
    color: var(--pf-muted);
}

.pf-empty__hint {
    font-size: 0.8125rem;
}

.pf-loading {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

.pf-loading[hidden] {
    display: none !important;
}

.pf-loading__inner {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 1.1rem;
    border-radius: 999px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: var(--pf-blue);
    font-size: 0.9rem;
    font-weight: 600;
}

.pf-loading__spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #bfdbfe;
    border-top-color: var(--pf-blue);
    border-radius: 50%;
    animation: pf-spin 0.75s linear infinite;
}

.pf-loading__text {
    line-height: 1.2;
}

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

.pf-scanner {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.pf-scanner[hidden] {
    display: none !important;
}

.pf-scanner__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(32, 33, 36, 0.45);
}

.pf-scanner__panel {
    position: relative;
    width: min(480px, 100%);
    background: #fff;
    border-radius: 16px 16px 0 0;
    padding: 1rem 1rem 1.25rem;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
}

.pf-scanner__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.pf-scanner__head h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
}

.pf-scanner__close {
    border: 0;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--pf-muted);
}

.pf-scanner__view {
    width: 100%;
    min-height: 240px;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}

.pf-scanner__hint {
    margin: 0.75rem 0 0;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--pf-muted);
}

.pf-footer {
    text-align: center;
    padding: 1rem;
    font-size: 0.75rem;
    color: var(--pf-muted);
}

@media (min-width: 640px) {
    .pf-search {
        flex-direction: row;
        align-items: center;
    }

    .pf-search__box {
        flex: 1;
    }

    .pf-scanner {
        align-items: center;
    }

    .pf-scanner__panel {
        border-radius: 16px;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --pf-bg: #0f172a;
        --pf-text: #f1f5f9;
        --pf-muted: #94a3b8;
        --pf-border: #334155;
        --pf-blue-soft: rgba(37, 99, 235, 0.2);
        --pf-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    }

    .pf-search__box,
    .pf-btn,
    .pf-card {
        background: #1e293b;
    }

    .pf-product-hero {
        background: linear-gradient(135deg, rgba(37, 99, 235, 0.15) 0%, #1e293b 60%);
        border-color: #334155;
    }

    .pf-product-hero__img {
        background: #0f172a;
        border-color: #334155;
    }

    .pf-offer {
        background: #0f172a;
        border-color: #334155;
    }

    .pf-offer__img {
        background: #1e293b;
        border-color: #334155;
    }

    .pf-chip {
        background: #334155;
    }

    .pf-card__about {
        color: #cbd5e1;
    }

    .pf-card__logo--default {
        background: rgba(37, 99, 235, 0.12);
    }

    .pf-card__actions {
        border-color: #334155;
    }

    .pf-search__scan {
        background: #3c4043;
    }

    .pf-user-status {
        background: #303134;
    }

    .pf-location-edit {
        background: #303134;
    }

    .pf-location-edit__input {
        background: #202124;
        color: var(--pf-text);
    }

    .pf-location-btn:hover,
    .pf-location-btn[aria-expanded="true"] {
        background: #3c4043;
    }

    .pf-product__img {
        background: #303134;
        border-color: #5f6368;
    }

    .pf-card {
        border-color: #334155;
    }

    .pf-loading__inner {
        background: rgba(37, 99, 235, 0.12);
        border-color: #334155;
    }

    .pf-listing-ad {
        background: linear-gradient(135deg, rgba(251, 146, 60, 0.15) 0%, rgba(234, 88, 12, 0.08) 100%);
        border-color: #9a3412;
        color: #fdba74;
    }

    .pf-scanner__panel {
        background: #303134;
    }
}
