/* =================================
   PIN HEALTH - Country Switcher
   ================================= */

/* Reset for all elements */
.ph-country-switcher,
.ph-country-switcher *,
.ph-region-popup,
.ph-region-popup * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    text-decoration: none;
}

/* ----- Footer Button ----- */

.ph-country-switcher {
    display: flex;
    flex-direction: column;
    gap: 12px;

    margin-top: var(--wp--preset--spacing--16);
}

.ph-country-switcher__label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: inherit;
    line-height: 1.4;
}

.ph-country-switcher__btn {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    width: auto;
    max-width: fit-content; /*240px;*/
    padding: 10px 3px; /*10px 12px;*/ /*12px 16px; */
    /*
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    */
    border-radius: .325rem; /*8px;*/
    color: inherit;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.4;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.ph-country-switcher__btn:hover,
.ph-country-switcher__btn:focus {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
}

.ph-country-switcher__flag {
    display: block;
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.ph-country-switcher__name {
    display: block;
    font-size: 15px;
    font-weight: 500;
    color: inherit;
    text-decoration: none;
}

.ph-country-switcher__arrow {
    display: block;
    width: 20px;
    height: 20px;
    margin-left: auto;
    opacity: 0.7;
    flex-shrink: 0;
}

/* ----- Popup ----- */

.ph-region-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
}

.ph-region-popup.is-open {
    display: block;
}

.ph-region-popup__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    background: -webkit-radial-gradient(50% 50%, ellipse closest-corner, rgba(0, 0, 0, 0.4) 1%, rgba(0, 0, 0, 0.8) 100%);
    cursor: pointer;
}

.ph-region-popup__content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    padding: 40px;
    background-color: #ffffff;
    border-radius: 16px;
    overflow-y: auto;
}

.ph-region-popup__close {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background-color: transparent;
    border: none;
    cursor: pointer;
    color: #666666;
    transition: color 0.2s ease;
}

.ph-region-popup__close:hover {
    color: #000000;
}

.ph-region-popup__close svg {
    display: block;
    width: 24px;
    height: 24px;
}

.ph-region-popup__title {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: #000000;
    line-height: 1.3;
    margin-bottom: 8px;
    text-align: left;
}

.ph-region-popup__subtitle {
    display: block;
    font-size: 16px;
    font-weight: 400;
    color: #666666;
    line-height: 1.5;
    margin-bottom: 32px;
    text-align: left;
}

.ph-region-popup__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

/* ----- Region Card ----- */

.ph-region-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background-color: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.2s ease;
    text-decoration: none;
}

.ph-region-card:hover {
    border-color: #999999;
    text-decoration: none;
}

.ph-region-card.is-active {
    border: 2px solid #000000;
}

.ph-region-card__flag {
    display: block;
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.ph-region-card__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ph-region-card__country {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #000000;
    line-height: 1.3;
    text-decoration: none;
}

.ph-region-card__language {
    display: block;
    font-size: 13px;
    font-weight: 400;
    color: #666666;
    line-height: 1.3;
    text-decoration: none;
}

/* ----- Mobile ----- */

@media screen and (max-width: 768px) {
    .ph-region-popup__content {
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        transform: none;
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        padding: 24px;
        padding-top: 60px;
    }
    
    .ph-region-popup__close {
        top: 16px;
        right: 16px;
    }
    
    .ph-region-popup__grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}






/**
** Country Switcher for Header: Flag
**/

/* =================================
   Country Flag Button (Header)
   ================================= */

.ph-country-flag-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ph-country-flag-btn:hover {
    transform: scale(1.1);
}

.ph-country-flag-btn__img {
    display: block;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}