/* eSIM Country Grid - intentionally small and dependency-free */
.esimg {
    width: 100%;
    --esimg-cols: 6;
    --esimg-mobile-height: 360px;
}

.esimg,
.esimg * {
    box-sizing: border-box;
}

.esimg__search {
    position: relative;
    width: min(100%, 360px);
    margin: 0 auto 18px;
}

.esimg__search-input {
    display: block;
    width: 100%;
    min-height: 46px;
    margin: 0;
    padding: 10px 42px 10px 14px;
    border: 1px solid #d7dce2;
    border-radius: 8px;
    background: #fff;
    color: #111827;
    font: inherit;
    font-size: 15px;
    line-height: 1.3;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.esimg__search-input:focus {
    border-color: #7c86ff;
    box-shadow: 0 0 0 3px rgba(37, 28, 202, 0.10);
}

.esimg__search-input::-webkit-search-cancel-button {
    cursor: pointer;
}

.esimg__search-icon {
    position: absolute;
    top: 50%;
    right: 14px;
    width: 17px;
    height: 17px;
    border: 2px solid #64748b;
    border-radius: 50%;
    transform: translateY(-58%);
    pointer-events: none;
}

.esimg__search-icon::after {
    content: "";
    position: absolute;
    right: -5px;
    bottom: -3px;
    width: 7px;
    height: 2px;
    background: #64748b;
    border-radius: 999px;
    transform: rotate(45deg);
    transform-origin: left center;
}

.esimg__grid {
    display: grid;
    grid-template-columns: repeat(var(--esimg-cols), minmax(0, 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.esimg__item {
    min-width: 0;
    margin: 0;
    padding: 0;
}

.esimg__item[hidden] {
    display: none !important;
}

.esimg__link {
    display: flex;
    align-items: center;
    min-height: 52px;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d8dde3;
    border-radius: 9px;
    background: #fff;
    color: #0f172a;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
    transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.esimg__link:hover,
.esimg__link:focus-visible {
    color: #0f172a;
    text-decoration: none;
    border-color: #aeb6c2;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.esimg__link:focus-visible {
    outline: 3px solid rgba(37, 28, 202, 0.18);
    outline-offset: 2px;
}

.esimg__flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    overflow: hidden;
    border: 1px solid #d1d5db;
    border-radius: 50%;
    background: #fff;
}

.esimg__flag img {
    display: block;
    width: 30px;
    height: auto;
    max-width: none;
    margin: 0;
    border: 0;
}

.esimg__label {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 15px;
    line-height: 1.25;
    font-weight: 500;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.esimg__empty {
    margin: 14px 0 0;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    color: #475569;
    text-align: center;
    font-size: 14px;
}

@media (max-width: 1200px) {
    .esimg__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .esimg__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .esimg__search {
        width: 100%;
        margin-bottom: 14px;
    }

    .esimg__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .esimg--mobile-scroll .esimg__grid {
        max-height: var(--esimg-mobile-height);
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        padding-right: 3px;
    }

    .esimg__link {
        min-height: 48px;
        gap: 8px;
        padding: 8px 9px;
        border-radius: 8px;
    }

    .esimg__flag {
        flex-basis: 30px;
        width: 30px;
        height: 30px;
    }

    .esimg__flag img {
        width: 27px;
    }

    .esimg__label {
        font-size: 14px;
    }
}

@media (max-width: 380px) {
    .esimg__grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .esimg__link {
        transition: none;
    }
}
