/* =============================================================================
   PCC Store Widget — Isolated Styles  v1.0.0
   All selectors are prefixed with #pcc-store-widget so they never bleed
   into the rest of the page. !important prevents host-page styles leaking in.
   ============================================================================= */

/* ── Container ─────────────────────────────────────────────────────────────── */
#pcc-store-widget.pcc-sw-container {
    position: relative !important;
    align-items: center !important;
    font-family: Figtree, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
    font-size: 16px !important;
    line-height: 1.4 !important;
    box-sizing: border-box !important;
    -webkit-user-select: none !important;
    user-select: none !important;
    color: inherit !important;
    font-weight: 400;
    letter-spacing: normal !important;
}

#pcc-store-widget.pcc-sw-container *,
#pcc-store-widget.pcc-sw-container *::before,
#pcc-store-widget.pcc-sw-container *::after {
    box-sizing: border-box !important;
}

/* ── Trigger row ───────────────────────────────────────────────────────────── */
#pcc-store-widget .pcc-sw-trigger {
    display: flex !important;
    align-items: center !important;
}

/* ── "Select Pharmacy" button (no store selected) ──────────────────────────── */
#pcc-store-widget .pcc-sw-select-btn {
    background-color: #e01c40 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 25px !important;
    padding: 8px 16px !important;
    font-family: inherit !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    transition: background-color 0.15s ease !important;
    outline: none !important;
    text-decoration: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

#pcc-store-widget .pcc-sw-select-btn:hover {
    background-color: #c01836 !important;
}

#pcc-store-widget .pcc-sw-select-btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(224, 28, 64, 0.3) !important;
}

/* ── Store row (store selected) ────────────────────────────────────────────── */
#pcc-store-widget .pcc-sw-store-row {
    display: flex; /* no !important — JS controls this via inline style */
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    padding: 8px 12px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: background-color 0.15s ease !important;
}

#pcc-store-widget .pcc-sw-store-row:hover {
    background-color: rgba(0, 0, 0, 0.04) !important;
}

#pcc-store-widget .pcc-sw-store-meta {
    display: flex !important;
    flex-direction: column !important;
    min-width: 0 !important;
    overflow: hidden !important;
}

#pcc-store-widget .pcc-sw-store-name {
    font-weight: 500 !important;
    color: #06253B !important;
    font-size: 16px !important;
    line-height: 1.2 !important;
    text-decoration: none !important;
    background: none !important;
    display: block !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    max-width: 240px !important;
}

#pcc-store-widget .pcc-sw-store-status-line {
    display: block !important;
    margin-top: 3px !important;
    padding: 0 !important;
    background: none !important;
    font-size: 16px !important;
    font-weight: 400 !important;
    color: #3D5261 !important;
    letter-spacing: 0 !important;
    white-space: nowrap !important;
    border-radius: 0 !important;
    text-transform: none !important;
}

/* Both states share the same plain-text look in the trigger */
#pcc-store-widget .pcc-sw-store-status-line.pcc-sw-status--open,
#pcc-store-widget .pcc-sw-store-status-line.pcc-sw-status--closed {
    background: none !important;
    color: #3D5261 !important;
}

/* ── Status badge (inline, in the trigger row) ──────────────────────────────── */
#pcc-store-widget .pcc-sw-status-badge {
    display: inline-block !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    padding: 2px 8px !important;
    border-radius: 10px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    white-space: nowrap !important;
    line-height: 1.5 !important;
}

#pcc-store-widget .pcc-sw-badge--open {
    background-color: #d4edda !important;
    color: #155724 !important;
}

#pcc-store-widget .pcc-sw-badge--closed {
    background-color: #fde8e8 !important;
    color: #b91c1c !important;
}

/* ── Arrow toggle ───────────────────────────────────────────────────────────── */
#pcc-store-widget .pcc-sw-arrow {
    display: inline-block !important;
    font-size: 10px !important;
    color: inherit !important;
    opacity: 0.6 !important;
    transition: transform 0.2s ease !important;
    line-height: 1 !important;
}

#pcc-store-widget .pcc-sw-arrow.pcc-sw-arrow--up {
    transform: rotate(180deg) !important;
}

/* ── Floating panel ─────────────────────────────────────────────────────────── */
#pcc-store-widget .pcc-sw-panel {
    display: none !important;
    position: absolute !important;
    top: calc(100% + 6px) !important;
    right: 0 !important;
    min-width: 350px !important;
    max-width: 420px !important;
    background-color: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18) !important;
    padding: 16px !important;
    z-index: 5 !important;
}

#pcc-store-widget .pcc-sw-panel.pcc-sw-panel--open {
    display: block !important;
}

#pcc-store-widget .pcc-sw-panel-header {
    margin-bottom: 14px !important;
}

#pcc-store-widget .pcc-sw-panel-logo {
    display: block; /* no !important — JS controls visibility */
    max-height: 65px !important;
    max-width: 160px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    object-position: left center !important;
    margin-bottom: 10px !important;
}

#pcc-store-widget .pcc-sw-panel-title-row {
    display: block !important;
    padding-right: 40px !important;
    margin-bottom: 8px !important;
}

#pcc-store-widget .pcc-sw-panel-store-name {
    font-size: 17px !important;
    font-weight: 600 !important;
    color: #111111 !important;
    line-height: 1.2 !important;
}

#pcc-store-widget .pcc-sw-panel-close {
    position: absolute !important;
    top: 14px !important;
    right: 14px !important;
    width: 30px !important;
    height: 30px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: none !important;
    border-radius: 6px !important;
    background: transparent !important;
    color: #000E22 !important;
    font-size: 24px !important;
    cursor: pointer !important;
    padding: 0 !important;
    line-height: 1 !important;
}

#pcc-store-widget .pcc-sw-panel-close:hover {
    background-color: #f0f0f0 !important;
}

#pcc-store-widget .pcc-sw-panel-details {
    display: flex; /* no !important — JS controls this via inline style */
    flex-direction: column !important;
    gap: 4px !important;
    margin-bottom: 14px !important;
}

#pcc-store-widget .pcc-sw-panel-address {
    font-size: 16px !important;
    color: #333333 !important;
    line-height: 1.5 !important;
    margin-top: 5px !important;
}

#pcc-store-widget .pcc-sw-panel-phone {
    display: inline-block; /* no !important — JS controls visibility via inline style */
    margin-top: 2px !important;
    color: #4078A3 !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
}

#pcc-store-widget .pcc-sw-panel-status {
    display: inline-block; /* no !important — JS controls this via inline style */
    font-size: 15px !important;
    font-weight: 500 !important;
    padding: 5px 14px !important;
    border-radius: 100px !important;
    margin-bottom: 4px !important;
    line-height: 1.4 !important;
    color: #333333 !important;
    background: none !important;
}

#pcc-store-widget .pcc-sw-panel-status.pcc-sw-status--open {
    background-color: #e8f5e9 !important;
    color: #1a6e2a !important;
}

#pcc-store-widget .pcc-sw-panel-status.pcc-sw-status--closed {
    background-color: #fce4e4 !important;
    color: #b91c1c !important;
}

/* ── Search form ────────────────────────────────────────────────────────────── */
#pcc-store-widget .pcc-sw-search-row {
    display: flex !important;
    gap: 0 !important;
    margin-bottom: 10px !important;
    align-items: stretch !important;
}

#pcc-store-widget .pcc-sw-postal-input {
    flex: 1 !important;
    padding: 10px 14px !important;
    border: 1.5px solid #d0d5dd !important;
    border-right: none !important;
    border-radius: 10px 0 0 10px !important;
    font-family: inherit !important;
    font-size: 16px !important;
    line-height: 1.4 !important;
    outline: none !important;
    color: #06253B !important;
    background-color: #ffffff !important;
    min-width: 0 !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    transition: border-color 0.15s ease !important;
}

#pcc-store-widget .pcc-sw-postal-input:focus {
    border-color: #e01c40 !important;
    box-shadow: none !important;
}

#pcc-store-widget .pcc-sw-postal-input::placeholder {
    color: #b0b7c3 !important;
    opacity: 1 !important;
}

#pcc-store-widget .pcc-sw-postal-btn {
    background-color: #e01c40 !important;
    color: #ffffff !important;
    border: 1.5px solid #e01c40 !important;
    border-radius: 0 10px 10px 0 !important;
    padding: 10px 18px !important;
    font-family: inherit !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    outline: none !important;
    text-transform: none !important;
    transition: background-color 0.15s ease !important;
}

#pcc-store-widget .pcc-sw-postal-btn:hover:not(:disabled) {
    background-color: #c01836 !important;
    border-color: #c01836 !important;
}

#pcc-store-widget .pcc-sw-postal-btn:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
}

#pcc-store-widget .pcc-sw-geo-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: 100% !important;
    background-color: transparent !important;
    color: #e01c40 !important;
    border: 1.5px solid #e8c8cd !important;
    border-radius: 10px !important;
    padding: 10px 14px !important;
    font-family: inherit !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    text-align: center !important;
    margin-bottom: 12px !important;
    outline: none !important;
    text-transform: none !important;
    line-height: 1.4 !important;
    transition: background-color 0.15s ease, border-color 0.15s ease !important;
}

#pcc-store-widget .pcc-sw-geo-btn:hover:not(:disabled) {
    background-color: #fdf2f4 !important;
    border-color: #e01c40 !important;
}

#pcc-store-widget .pcc-sw-geo-btn:disabled {
    opacity: 0.55 !important;
    cursor: not-allowed !important;
}

/* ── Search message ─────────────────────────────────────────────────────────── */
#pcc-store-widget .pcc-sw-search-msg {
    font-size: 14px !important;
    min-height: 0 !important;
    line-height: 1.4 !important;
    margin: 0 0 6px !important;
    padding: 0 !important;
    color: #667085 !important;
}

#pcc-store-widget .pcc-sw-search-msg.pcc-sw-msg--error {
    color: #b91c1c !important;
}

#pcc-store-widget .pcc-sw-search-msg.pcc-sw-msg--info {
    color: #555555 !important;
}

/* ── Panel action area ──────────────────────────────────────────────────────── */
#pcc-store-widget .pcc-sw-panel-actions {
    border-top: 1px solid #eeeeee !important;
    padding-top: 12px !important;
    margin-top: 4px !important;
}

/* "Select a different store" — text link style */
#pcc-store-widget .pcc-sw-change-link {
    display: block !important;
    background: none !important;
    border: none !important;
    padding: 0 0 12px !important;
    font-family: inherit !important;
    font-size: 16px !important;
    font-weight: 300 !important;
    color: #555555 !important;
    text-decoration: underline !important;
    cursor: pointer !important;
    text-align: center !important;
    width: 100% !important;
    line-height: 1.4 !important;
}

#pcc-store-widget .pcc-sw-change-link:hover {
    color: #222222 !important;
}

/* Button rows */
#pcc-store-widget .pcc-sw-btn-row {
    display: flex !important;
    gap: 8px !important;
    margin-bottom: 8px !important;
}

/* Base style for all action buttons */
#pcc-store-widget .pcc-sw-action-btn {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 11px 8px !important;
    font-family: inherit !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    text-align: center !important;
    text-decoration: none !important;
    line-height: 1.3 !important;
    white-space: nowrap !important;
    outline: none !important;
    text-transform: none !important;
}

#pcc-store-widget .pcc-sw-action-btn.pcc-sw--hidden {
    display: none !important;
}

#pcc-store-widget .pcc-sw-btn-icon {
    width: 13px !important;
    height: 13px !important;
    flex-shrink: 0 !important;
    pointer-events: none !important;
}

/* Red — View Flyer */
#pcc-store-widget .pcc-sw-btn--red {
    background-color: #e01c40 !important;
    color: #ffffff !important;
}

#pcc-store-widget .pcc-sw-btn--red:hover {
    background-color: #c01836 !important;
    color: #ffffff !important;
}

/* Yellow — Refills */
#pcc-store-widget .pcc-sw-btn--yellow {
    background-color: #f5c842 !important;
    color: #7a5500 !important;
}

#pcc-store-widget .pcc-sw-btn--yellow:hover {
    background-color: #e8b830 !important;
    color: #7a5500 !important;
}

/* Blue — Directions / Store Page / Call */
#pcc-store-widget .pcc-sw-btn--blue {
    background-color: #dbeafe !important;
    color: #005195 !important;
}

#pcc-store-widget .pcc-sw-btn--blue:hover {
    background-color: #bfdbfe !important;
    color: #005195 !important;
}

/* ── Search results list ─────────────────────────────────────────────────────── */
#pcc-store-widget .pcc-sw-search-results {
    margin-top: 4px !important;
    max-height: 240px !important;
    overflow-y: auto !important;
    overflow-x: hidden;
    border: 1.5px solid #e4e7ec !important;
    border-radius: 10px !important;
    background-color: #ffffff !important;
}

#pcc-store-widget .pcc-sw-search-results:empty {
    display: none !important;
    border: none !important;
}

#pcc-store-widget .pcc-sw-result-item {
    display: flex !important;
    flex-direction: column !important;
    gap: 3px !important;
    width: 100% !important;
    padding: 12px 14px !important;
    background: none !important;
    border: none !important;
    border-bottom: 1px solid #f2f4f7 !important;
    border-radius: 0 !important;
    text-align: left !important;
    cursor: pointer !important;
    font-family: inherit !important;
    transition: background-color 0.1s ease !important;
}

#pcc-store-widget .pcc-sw-result-item:first-child {
    border-radius: 9px 9px 0 0 !important;
}

#pcc-store-widget .pcc-sw-result-item:last-child {
    border-bottom: none !important;
    border-radius: 0 0 9px 9px !important;
}

#pcc-store-widget .pcc-sw-result-item:only-child {
    border-radius: 9px !important;
}

#pcc-store-widget .pcc-sw-result-item:hover {
    background-color: #fdf2f4 !important;
}

#pcc-store-widget .pcc-sw-result-name {
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #06253B !important;
    line-height: 1.3 !important;
}

#pcc-store-widget .pcc-sw-result-addr {
    font-size: 14px !important;
    color: #667085 !important;
    line-height: 1.4 !important;
    font-weight: 500;
}

/* ── Mobile ─────────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
	#pcc-store-widget .pcc-sw-select-btn {
		margin: 0px auto 10px;
	}

    #pcc-store-widget.pcc-sw-container {
        display: block !important;
        width: 100% !important;
    }

    #pcc-store-widget .pcc-sw-trigger {
        width: 100% !important;
    }

    #pcc-store-widget .pcc-sw-store-row {
        width: 100% !important;
    }

    #pcc-store-widget .pcc-sw-panel {
        position: absolute !important;
        top: calc(100% + 6px) !important;
        left: 0 !important;
        right: 0 !important;
        max-width: 100% !important;
        min-width: 0 !important;
        width: 100% !important;
        border-radius: 12px !important;
        padding: 16px !important;
        box-sizing: border-box !important;
    }
}
