/* ═══════════════════════════════════════════════════
   Play Country Switcher — country-switcher.css
   ═══════════════════════════════════════════════════ */

:root {
    --pcs-accent:  #ff5500;
    --pcs-radius:  14px;
    --pcs-overlay: rgba(0, 0, 0, 0.65);
}

/* ── Drawer flag strip (inside .site-sidebar) ─────── */
.pcs-drawer-strip {
    padding: 12px 14px 14px;
    border-top: 1px solid rgba(128,128,128,0.15);
    margin-top: 4px;
}

.pcs-drawer-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pcs-drawer-flag {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 8px 10px;
    border-radius: 8px;
    text-decoration: none !important;
    color: inherit !important;
    transition: background 0.14s;
    min-width: 56px;
    text-align: center;
}
.pcs-drawer-flag:hover {
    background: rgba(128,128,128,0.12);
}
.pcs-drawer-flag--active {
    background: rgba(255, 85, 0, 0.1);
}
.pcs-drawer-flag img {
    border-radius: 3px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    display: block;
}
.pcs-drawer-flag span {
    font-size: 11px;
    line-height: 1.2;
    font-weight: 500;
    color: inherit;
}
.pcs-drawer-flag--active span {
    color: var(--pcs-accent);
    font-weight: 700;
}

/* Hide drawer strip when sidebar is collapsed to icon-only (desktop only) */
@media (min-width: 782px) {
    #menu-state:checked ~ .site-sidebar .pcs-drawer-strip {
        display: none !important;
    }
}

/* ── Overlay ──────────────────────────────────────── */
#pcs-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: var(--pcs-overlay);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    /* prevent body scroll bleed */
    overflow: hidden;
}
#pcs-overlay.pcs-open {
    display: flex;
}

/* ── Modal ────────────────────────────────────────── */
#pcs-modal {
    background: #ffffff;
    border-radius: var(--pcs-radius);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
    width: 100%;
    max-width: 580px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: pcsSlideIn 0.2s cubic-bezier(0.34, 1.2, 0.64, 1);
}

@keyframes pcsSlideIn {
    from { opacity: 0; transform: translateY(16px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0)   scale(1); }
}

/* ── Modal header ─────────────────────────────────── */
#pcs-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}
#pcs-modal-title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #111111;
    line-height: 1.2;
}
#pcs-close {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f4f4f4;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    color: #555;
    transition: background 0.12s, color 0.12s;
    flex-shrink: 0;
    box-shadow: none;
    padding: 0;
}
#pcs-close:hover {
    background: #e8e8e8;
    color: #111;
}
#pcs-close:focus-visible {
    outline: 2px solid var(--pcs-accent);
    outline-offset: 2px;
}

/* ── Country grid ─────────────────────────────────── */
#pcs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
    padding: 20px 24px 24px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ── Country card ─────────────────────────────────── */
.pcs-card {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 18px 12px 14px;
    border-radius: 10px;
    border: 2px solid #eeeeee;
    text-decoration: none !important;
    color: #222222 !important;
    background: #fafafa;
    transition: border-color 0.14s, background 0.14s, transform 0.12s;
    position: relative;
    text-align: center;
    cursor: pointer;
}
.pcs-card:hover {
    border-color: #cccccc;
    background: #f4f4f4;
    transform: translateY(-2px);
    text-decoration: none !important;
}
.pcs-card:focus-visible {
    outline: 2px solid var(--pcs-accent);
    outline-offset: 2px;
}
.pcs-card--active {
    border-color: var(--pcs-accent) !important;
    background: #fff8f5 !important;
}
.pcs-card--active:hover {
    background: #fff3ee !important;
}

/* ── Flag image inside card ───────────────────────── */
.pcs-card-flag {
    display: flex;
    align-items: center;
    justify-content: center;
}
.pcs-card-flag img {
    width: 48px;
    height: 36px;
    border-radius: 3px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
    display: block;
    object-fit: cover;
}

/* ── Country label ────────────────────────────────── */
.pcs-card-label {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
    color: #333333;
    word-break: break-word;
}
.pcs-card--active .pcs-card-label {
    font-weight: 700;
    color: var(--pcs-accent);
}

/* ── Active checkmark ─────────────────────────────── */
.pcs-card-check {
    position: absolute;
    top: 6px;
    right: 8px;
    color: var(--pcs-accent);
    line-height: 1;
    display: flex;
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 480px) {
    #pcs-modal { border-radius: 12px; }
    #pcs-modal-head { padding: 16px 18px 14px; }
    #pcs-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        padding: 14px 16px 20px;
        gap: 8px;
    }
    .pcs-card { padding: 14px 8px 12px; gap: 8px; }
    .pcs-card-flag img { width: 40px; height: 30px; }
}
