/* =============================================================
   PatchitUP Locations Plugin — Stylesheet
   Layout: Cards LEFT | Map RIGHT
   ============================================================= */
@import url('https://fonts.googleapis.com/css2?family=Fira+Sans:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

:root {
    --piu-blue:        #2A7DD1;
    --piu-blue-dark:   #34679a;
    --piu-blue-light:  #e8f1fb;
    --piu-gray-light:  #f2f4f7;
    --piu-gray-mid:    #d1d5db;
    --piu-text-dark:   #1a2533;
    --piu-text-mid:    #4a5568;
    --piu-text-light:  #7a8696;
    --piu-white:       #ffffff;
    --piu-green:       #27ae60;
    --piu-red:         #e74c3c;
    --piu-radius:      12px;
    --piu-shadow-sm:   0 2px 8px rgba(52,103,154,0.10);
    --piu-shadow-md:   0 6px 24px rgba(52,103,154,0.14);
}
.wp-block-uagb-container.location-main.uagb-is-root-container {
    max-width: 100% !important;
    padding: 0;
}
/* ── Wrapper ─────────────────────────────────────────────────── */
.piu-wrap {
    font-family: "Fira Sans", sans-serif;
    color: var(--piu-text-dark);
    background: var(--piu-gray-light);
    min-height: 100vh;
}

/* ── Hero ────────────────────────────────────────────────────── */
.piu-hero {
    position: relative;
    background: url('images/location-hero.jpeg') no-repeat;
    background-position: center;
    background-size: cover;
    padding: 52px 32px 60px;
    text-align: center;
    color: var(--piu-white);
}
.piu-hero:before {
    content: "";
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #34679a 0%, #2a7dd1 100%);
    inset: 0;
    position: absolute;
    opacity: 0.9;
}
.piu-hero__title {
    font-family: 'Fira Sans', sans-serif;
    font-size: clamp(28px, 5vw, 42px);
    font-weight: 700;
    color: #FFFFFF;
    line-height: 1.1;
    margin-bottom: 10px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    letter-spacing: 0;
}
.piu-hero__sub {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 28px;
    position: relative;
}
.piu-zip-wrap {
    position: relative;
    display: flex;
    justify-content: center;
    max-width: 520px;
    border-radius: 50px;
    margin: 0 auto;
    box-shadow: 0 6px 32px rgba(0,0,0,0.18);
    overflow: hidden;
}

.piu-zip-input {
    flex: 1;
    padding: 15px 22px;
    font-size: 16px;
    font-family: 'Fira Sans', sans-serif;
    font-weight: 600;
    border: none;
    outline: none;
    color: var(--piu-text-dark);
    background: transparent;
    min-width: 0;
    border: 0;
    background: #FFFFFF;
}
.piu-zip-input::placeholder {color: #7a8696; font-weight: 400;}
.piu-zip-btn {
    padding: 13px 24px;
    color: var(--piu-white);
    background: var(--piu-blue-dark);
    border: none;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}
.piu-zip-btn:hover {
    background: #2a7dd1;
}
.piu-zip-btn:hover:not(:disabled) {
   color: var(--piu-white);
    background: #2a7dd1;
}

.piu-zip-btn:disabled { opacity: 0.7; cursor: not-allowed; }

.piu-zip-result {
    z-index: 9;
    position: relative;
    display: block;
    background: rgba(255, 255, 255, 0.12);
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    padding: 10px 16px;
    margin: 12px auto 0;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    max-width: 520px;
}

.piu-zip-msg a { color: var(--piu-white); text-decoration: underline; }
.piu-zip-msg--error    { color: #ffffff; }
.piu-zip-msg--found    { color: #ffffff; }
.piu-zip-msg--notfound { color: #FFFFFF; }

/* ── State Filter Pills ───────────────────────────────────────── */
.piu-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: var(--piu-white);
    border-bottom: 2px solid var(--piu-blue-light);
    overflow-x: auto;
    box-shadow: var(--piu-shadow-sm);
    position: sticky;
    z-index: 99;
    top: 84px;
}

.piu-filter-label {
    font-weight: 760;
    font-size: 0.82rem;
    color: var(--piu-text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

.piu-pill {
        padding: 7px 16px;
    border: 1px solid var(--piu-gray-mid);
    background: #f2f4f7;
    color: var(--piu-text-mid);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    border-radius: 50px;
}

.piu-pill:hover {
    border-color: var(--piu-blue);
    color: var(--piu-blue);
}

.piu-pill.active {
    background: var(--piu-blue);
    border-color: var(--piu-blue);
    color: var(--piu-white);
    box-shadow: 0 2px 10px rgba(42,125,209,0.35);
}

/* ── Main Layout: Cards LEFT | Map RIGHT ──────────────────────── */
.piu-main {
    display: grid;
    grid-template-columns: 540px 1fr;
    gap: 0;
    min-height: 620px;
}

/* ── Cards Column (LEFT) ─────────────────────────────────────── */
.piu-cards-wrap {
    background: var(--piu-gray-light);
    border-right: 2px solid var(--piu-blue-light);
    height: calc(100vh - 134px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.piu-cards-header {
    padding: 12px 16px;
    background: var(--piu-white);
    border-bottom: 1px solid var(--piu-blue-light);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--piu-text-light);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    flex-shrink: 0;
    display: none;
}

.piu-cards {
    overflow-y: auto;
    flex: 1;
    padding: 16px 14px 48px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.piu-cards::-webkit-scrollbar { width: 5px; }
.piu-cards::-webkit-scrollbar-track { background: transparent; }
.piu-cards::-webkit-scrollbar-thumb { background: var(--piu-gray-mid); border-radius: 99px; }

/* ── Map (RIGHT) ─────────────────────────────────────────────── */
.piu-map-wrap {
    position: relative;
    background: #e9edf2;
}

#piu-map {
    width: 100%;
    height: 100%;
    min-height: 620px;
}

.piu-map-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--piu-gray-light);
    font-size: 1rem;
    color: var(--piu-text-light);
    z-index: 10;
}

/* ── Single Card ─────────────────────────────────────────────── */
.piu-card {
    background: var(--piu-white);
    border-radius: var(--piu-radius);
    box-shadow: var(--piu-shadow-sm);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.15s, border-color 0.15s;
    animation: piuFadeUp 0.4s both;
    border: 1.5px solid rgba(52,103,154,0.08);
}

.piu-card:hover {
    box-shadow: 0 12px 40px rgba(52,103,154,0.18);
    transform: translateY(-4px);
    border-color: #2a7dd1;
}

.piu-card--active {
    border-color: var(--piu-blue) !important;
    box-shadow: 0 0 0 3px rgba(42,125,209,0.18), var(--piu-shadow-md) !important;
    transform: translateY(-2px);
}

.piu-card--soon { opacity: 0.72; }

/* Top color bar (replaces left stripe) */
.piu-card__top-bar {
    height: 5px;
    width: 100%;
    flex-shrink: 0;
    background: linear-gradient(90deg, #34679a, #2a7dd1) !important;
    border-radius: 12px 12px 0 0;
}

.piu-card__body {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Header: logo + state pill + name + area */
.piu-card__header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

/* Logo */
.piu-card__logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--piu-blue-light);
}

.piu-card__logo--fallback {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.piu-card__logo--fallback span {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 900;
    line-height: 1;
}

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

/* State pill */
.piu-card__state-pill {
    display: inline-block;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 700;
    color: var(--piu-blue);
    margin-bottom: 3px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.piu-card__name {
    font-size: 16px;
    font-weight: 700;
    color: var(--piu-text-dark);
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.piu-card__area {
    font-size: 12px;
    font-weight: 600;
    color: var(--piu-text-light);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Divider */
.piu-card__divider {
    height: 1px;
    background: var(--piu-blue-light);
    margin: 0 0 8px;
}

/* Icon rows (hours, phone, email, address) */
.piu-card__rows {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 9px;
}

.piu-card__row {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.8rem;
}

.piu-card__icon {
    font-size: 0.82rem;
    flex-shrink: 0;
    width: 16px;
    text-align: center;
}

.piu-card__row-text {
    color: #4a5568;
    font-size: 13px;
    font-weight: 600;
}

.piu-card__link {
    color: var(--piu-blue);
    text-decoration: none;
    transition: color 0.15s;
    font-size: 12.5px;
    font-weight: 600;
}

.piu-card__link:hover { color: var(--piu-blue-dark); text-decoration: underline; }

/* Badges */
.piu-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 9px;
    border-radius: 99px;
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.piu-badge--open   { background: #fde8e8; color: #991b1b; }
.piu-badge--open   { background: #d1fae5; color: #065f46; }
.piu-badge--closed { background: #fee2e2; color: #991b1b; }
.piu-badge--soon   { background: #f3f4f6; color: var(--piu-text-light); }

/* Services */
.piu-card__services {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 9px;
}

.piu-service-tag {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    background: var(--piu-blue-light);
    color: var(--piu-blue-dark);
    white-space: nowrap;
    letter-spacing: 0.3px;
    border: 0;
}
.piu-card__icon svg {
    color: #34679a;
}
/* Action buttons */
.piu-card__actions {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

.piu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.piu-btn--primary {
    background: linear-gradient(135deg, #2a7dd1, #34679a);
    color: var(--piu-white);
    border-color: var(--piu-blue);
    flex: 1;
    padding: 10px 0;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.2px;
}

.piu-btn--primary:hover:not(:disabled) {
    background: var(--piu-blue-dark);
    border-color: var(--piu-blue-dark);
    color: var(--piu-white);
}

.piu-btn--primary:disabled {
    background: var(--piu-gray-mid);
    border-color: var(--piu-gray-mid);
    cursor: not-allowed;
    color: var(--piu-text-light);
}

.piu-btn--secondary {
    background: #f2f4f7;
    color: #1a2533;
    border: 1.5px solid #d1d5db;
    text-decoration: underline;
    font-size: 15px;
}

.piu-btn--secondary:hover {
    background: var(--piu-gray-light);
    border-color: var(--piu-blue);
    color: var(--piu-blue);
}

/* ── Google Maps InfoWindow /* ── Google Maps InfoWindow ──────────────────────────────────── */
.piu-iw {
    font-family: 'Nunito', sans-serif;
    min-width: 210px;
    max-width: 270px;
    padding: 4px 2px;
}

.piu-iw__name {
    font-size: 1rem;
    font-weight: 800;
    color: #1a2533;
    margin-bottom: 2px;
}

.piu-iw__area {
    font-size: 0.8rem;
    color: #7a8696;
    margin-bottom: 8px;
}

.piu-iw__status {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.piu-iw__badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 99px;
    font-size: 0.72rem;
    font-weight: 700;
}

.piu-iw__badge--open   { background: #d1fae5; color: #065f46; }
.piu-iw__badge--closed { background: #fee2e2; color: #991b1b; }
.piu-iw__badge--soon   { background: #f3f4f6; color: #7a8696; }

.piu-iw__hours {
    font-size: 0.75rem;
    color: #7a8696;
}

.piu-iw__row {
    font-size: 0.82rem;
    margin-bottom: 4px;
    color: #4a5568;
}

.piu-iw__row a {
    color: var(--piu-blue);
    text-decoration: none;
}

.piu-iw__row a:hover { text-decoration: underline; }

.piu-iw__actions { margin-top: 10px; }

.piu-iw__actions { display: flex; gap: 7px; flex-wrap: wrap; }

.piu-iw__btn {
    display: inline-block;
    padding: 7px 14px;
    background: var(--piu-blue);
    color: #ffffff !important;
    border-radius: 7px;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none !important;
    transition: background 0.15s;
    flex: 1;
    text-align: center;
}

.piu-iw__btn:hover { background: var(--piu-blue-dark); }

.piu-iw__btn--sec {
    background: transparent;
    color: var(--piu-text-dark) !important;
    border: 2px solid var(--piu-gray-mid);
}

.piu-iw__btn--sec:hover { background: var(--piu-gray-light); }

/* ── Loading / Error / No results ────────────────────────────── */
.piu-loading,
.piu-error,
.piu-no-results {
    text-align: center;
    padding: 40px 16px;
    color: var(--piu-text-light);
    font-size: 0.9rem;
}

.piu-error { color: #e74c3c; }

.piu-no-results a {
    color: var(--piu-blue);
    text-decoration: underline;
}


/* ── Services Tags (on cards) ────────────────────────────────── */
.piu-card__services {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 12px;
}

.piu-service-tag {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 99px;
    font-size: 0.7rem;
    font-weight: 700;
    background: var(--piu-blue-light);
    color: var(--piu-blue-dark);
    white-space: nowrap;
    border: 1px solid rgba(42,125,209,0.2);
}

/* ── Services Tags (in InfoWindow) ──────────────────────────── */
.piu-iw__services {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
    margin-top: 4px;
}

.piu-iw__service-tag {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 99px;
    font-size: 0.68rem;
    font-weight: 700;
    background: #e8f1fb;
    color: #34679a;
    white-space: nowrap;
    border: 1px solid rgba(42,125,209,0.2);
}
.piu-zip-btn:before {
    content: "";
    width: 20px;
    height: 20px;
    display: inline-block;
    background-repeat: no-repeat;
    background-position: center;
    vertical-align: bottom;
    margin-right: 4px;
    background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2215%22%20height%3D%2215%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%222.5%22%20viewBox%3D%220%200%2024%2024%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%3Ccircle%20cx%3D%2211%22%20cy%3D%2211%22%20r%3D%228%22/%3E%3Cpath%20d%3D%22m21%2021-4.35-4.35%22/%3E%3C/svg%3E");
}
.piu-iw__row svg {
    color: var(--piu-blue);
}
/* ── Animations ───────────────────────────────────────────────── */
@keyframes piuFadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 960px) {
    .piu-main {
        grid-template-columns: 1fr;
        max-height: none;
    }

    /* On mobile: map goes first (top), cards below */
    .piu-cards-wrap {
        order: 2;
        border-right: none;
        border-top: 2px solid var(--piu-blue-light);
        max-height: 480px;
    }

    .piu-map-wrap {
        order: 1;
    }

    #piu-map {
        min-height: 360px;
        height: 360px;
    }

    .piu-hero__title { font-size: 1.65rem; }
    .piu-hero { padding: 36px 20px 42px; }
    .piu-filters { padding: 10px 14px; gap: 8px; }
}

@media (max-width: 480px) {
    .piu-card__top { flex-direction: column; }
    .piu-card__meta { align-items: flex-start; }
    .piu-hero__title { font-size: 1.4rem; }
}