/* =====================================================
   eSIM FINDER TOOL — ISOLATED STYLES
   All rules scoped to #esim-finder-tool or .esim-*
   Zero conflicts with parent WordPress theme
   ===================================================== */

:root {
    --esim-primary: #0057FF;
    --esim-primary-dark: #003ec2;
    --esim-primary-light: #e8f0ff;
    --esim-accent: #00c896;
    --esim-accent-dark: #009e76;
    --esim-surface: #ffffff;
    --esim-bg: #f0f4ff;
    --esim-border: #dde3f0;
    --esim-text: #1a1d2e;
    --esim-muted: #6b7280;
    --esim-radius: 16px;
    --esim-shadow: 0 4px 24px rgba(0,87,255,.10);
    --esim-shadow-lg: 0 8px 40px rgba(0,87,255,.16);
    --esim-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Full-width page reset */
.esim-fullwidth-body {
    background: var(--esim-bg);
    margin: 0;
    padding: 0;
}
.esim-site-header {
    background: #fff;
    border-bottom: 1px solid var(--esim-border);
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
}
.esim-header-inner { display: flex; align-items: center; }
.esim-logo-link img { max-height: 40px; }
.esim-site-name { font-size: 1.2rem; font-weight: 700; color: var(--esim-primary); }
.esim-site-footer { text-align: center; padding: 24px; color: var(--esim-muted); font-size: .85rem; }
.esim-site-footer a { color: var(--esim-primary); text-decoration: none; }

/* ——— TOOL WRAPPER ——— */
#esim-finder-tool-wrap {
    width: 100%;
    background: var(--esim-bg);
    padding: 32px 20px 64px;
    box-sizing: border-box;
}
#esim-finder-tool {
    font-family: var(--esim-font) !important;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}
#esim-finder-tool *, #esim-finder-tool *::before, #esim-finder-tool *::after {
    box-sizing: border-box;
}

/* ——— ADSENSE WRAP ——— */
.esim-adsense-wrap {
    width: 100%;
    text-align: center;
}
.esim-adsense-wrap ins {
    display: block;
}

@media (max-width: 768px) {
    #esim-finder-tool-wrap { padding: 16px 12px 48px; }
}
@media (max-width: 480px) {
    #esim-finder-tool-wrap { padding: 12px 8px 40px; }
}

/* ——— PROGRESS BAR ——— */
.esim-progress-bar-wrap {
    margin-bottom: 28px;
}
.esim-progress-bar {
    height: 6px;
    background: var(--esim-border);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 8px;
    position: relative;
}
.esim-progress-bar::after {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    background: linear-gradient(90deg, var(--esim-primary), var(--esim-accent));
    border-radius: 99px;
    width: var(--esim-progress, 0%);
    transition: width .4s ease;
}
.esim-step-labels {
    display: flex;
    justify-content: space-between;
    font-size: .72rem;
    color: var(--esim-muted);
    font-family: var(--esim-font);
}

/* ——— SCREENS ——— */
.esim-screen { display: none; animation: esimFadeIn .35s ease; }
.esim-screen.active { display: block; }
@keyframes esimFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ——— AD SLOTS ——— */
.esim-ad-slot {
    width: 100%;
    margin: 12px 0;
    text-align: center;
    min-height: 90px;
}
.esim-ad-placeholder {
    background: var(--esim-border);
    border: 2px dashed #b8c4e0;
    border-radius: 10px;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--esim-muted);
    font-size: .8rem;
    font-family: var(--esim-font);
    letter-spacing: .05em;
    text-transform: uppercase;
}

/* ——— CARD ——— */
.esim-card {
    background: #ffffff;
    border-radius: var(--esim-radius);
    box-shadow: var(--esim-shadow);
    padding: 36px 32px;
    margin-bottom: 4px;
    border: 1px solid var(--esim-border);
}
@media (max-width: 600px) { .esim-card { padding: 24px 16px; } }

.esim-step-badge {
    display: inline-block;
    background: var(--esim-primary-light);
    color: var(--esim-primary);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 99px;
    margin-bottom: 16px;
    font-family: var(--esim-font);
}
.esim-step-title {
    font-family: var(--esim-font) !important;
    font-size: 1.6rem !important;
    font-weight: 800 !important;
    color: var(--esim-text) !important;
    margin: 0 0 8px !important;
    line-height: 1.25 !important;
}
.esim-step-sub {
    font-family: var(--esim-font) !important;
    font-size: .95rem !important;
    color: var(--esim-muted) !important;
    margin: 0 0 24px !important;
}

/* ——— COUNTRY SEARCH ——— */
.esim-search-wrap { position: relative; margin-bottom: 12px; }
.esim-country-input {
    width: 100%;
    padding: 14px 18px;
    font-size: 1rem;
    font-family: var(--esim-font);
    border: 2px solid var(--esim-border);
    border-radius: 12px;
    outline: none;
    transition: border-color .2s;
    color: var(--esim-text);
    background: #fff;
}
.esim-country-input:focus { border-color: var(--esim-primary); box-shadow: 0 0 0 4px rgba(0,87,255,.1); }
.esim-country-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0; right: 0;
    background: #fff;
    border: 1px solid var(--esim-border);
    border-radius: 12px;
    box-shadow: var(--esim-shadow-lg);
    z-index: 999;
    max-height: 260px;
    overflow-y: auto;
    display: none;
}
.esim-country-dropdown.open { display: block; }
.esim-country-item {
    padding: 12px 16px;
    cursor: pointer;
    font-family: var(--esim-font);
    font-size: .95rem;
    color: var(--esim-text);
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--esim-border);
    transition: background .15s;
}
.esim-country-item:last-child { border-bottom: none; }
.esim-country-item:hover, .esim-country-item.highlighted { background: var(--esim-primary-light); }
.esim-country-flag { font-size: 1.3rem; }
.esim-selected-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--esim-accent);
    color: #fff;
    font-family: var(--esim-font);
    font-size: .9rem;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 99px;
}

/* ——— OPTIONS GRID ——— */
.esim-options-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.esim-options-grid.two-col { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 600px) {
    .esim-options-grid { grid-template-columns: repeat(2, 1fr); }
    .esim-options-grid.two-col { grid-template-columns: repeat(2, 1fr); }
}

.esim-option {
    background: #fff;
    border: 2px solid var(--esim-border);
    border-radius: 14px;
    padding: 16px 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    transition: all .2s ease;
    font-family: var(--esim-font);
}
.esim-option:hover { border-color: var(--esim-primary); background: var(--esim-primary-light); transform: translateY(-2px); }
.esim-option.selected { border-color: var(--esim-primary); background: var(--esim-primary-light); box-shadow: 0 0 0 3px rgba(0,87,255,.15); }
.esim-option.big { padding: 24px 16px; }
.esim-opt-icon { font-size: 1.6rem; line-height: 1; }
.esim-opt-icon.lg { font-size: 2.4rem; }
.esim-opt-label { font-size: .88rem; font-weight: 700; color: var(--esim-text); line-height: 1.2; }
.esim-opt-hint { font-size: .75rem; color: var(--esim-muted); }

/* ——— BUDGET SLIDER ——— */
.esim-budget-wrap { text-align: center; margin-bottom: 20px; }
.esim-budget-display {
    font-family: var(--esim-font);
    font-size: 3rem;
    font-weight: 900;
    color: var(--esim-primary);
    margin-bottom: 16px;
    line-height: 1;
}
.esim-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 99px;
    background: var(--esim-border);
    outline: none;
    cursor: pointer;
}
.esim-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--esim-primary);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,87,255,.35);
    border: 3px solid #fff;
}
.esim-slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: .8rem;
    color: var(--esim-muted);
    margin-top: 6px;
    font-family: var(--esim-font);
}
.esim-budget-presets { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 16px; }
.esim-preset {
    background: #fff;
    border: 2px solid var(--esim-border);
    border-radius: 99px;
    padding: 8px 16px;
    font-size: .85rem;
    font-family: var(--esim-font);
    font-weight: 600;
    cursor: pointer;
    color: var(--esim-text);
    transition: all .2s;
}
.esim-preset:hover, .esim-preset.active { border-color: var(--esim-primary); background: var(--esim-primary-light); color: var(--esim-primary); }

/* ——— NAV BUTTONS ——— */
.esim-nav-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
}
.esim-btn-next, .esim-btn-find {
    background: linear-gradient(135deg, var(--esim-primary), var(--esim-primary-dark));
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 14px 32px;
    font-size: 1rem;
    font-family: var(--esim-font);
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 4px 16px rgba(0,87,255,.30);
}
.esim-btn-next:hover, .esim-btn-find:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(0,87,255,.40); }
.esim-btn-next:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.esim-btn-find {
    background: linear-gradient(135deg, var(--esim-accent), var(--esim-accent-dark));
    box-shadow: 0 4px 16px rgba(0,200,150,.35);
    font-size: 1.05rem;
    padding: 16px 36px;
}
.esim-btn-find:hover { box-shadow: 0 6px 24px rgba(0,200,150,.45); }
.esim-btn-back {
    background: transparent;
    border: 2px solid var(--esim-border);
    border-radius: 12px;
    padding: 13px 24px;
    font-size: .95rem;
    font-family: var(--esim-font);
    font-weight: 600;
    cursor: pointer;
    color: var(--esim-muted);
    transition: all .2s;
}
.esim-btn-back:hover { border-color: var(--esim-primary); color: var(--esim-primary); background: var(--esim-primary-light); }

/* ——— LOADING SCREEN ——— */
.esim-loading-card {
    text-align: center;
    padding: 48px 32px;
}
.esim-loader-ring {
    width: 72px; height: 72px;
    border: 6px solid var(--esim-border);
    border-top-color: var(--esim-primary);
    border-radius: 50%;
    animation: esimSpin 1s linear infinite;
    margin: 0 auto 24px;
}
@keyframes esimSpin { to { transform: rotate(360deg); } }
.esim-loading-title {
    font-family: var(--esim-font) !important;
    font-size: 1.4rem !important;
    font-weight: 800 !important;
    color: var(--esim-text) !important;
    margin: 0 0 24px !important;
}
.esim-loading-steps { text-align: left; max-width: 320px; margin: 0 auto 24px; }
.esim-load-step {
    font-family: var(--esim-font);
    font-size: .9rem;
    color: var(--esim-muted);
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 6px;
    opacity: .4;
    transition: opacity .3s, background .3s, color .3s;
}
.esim-load-step.done {
    opacity: 1;
    color: var(--esim-accent-dark);
    background: rgba(0,200,150,.08);
}
.esim-progress-line {
    background: var(--esim-border);
    height: 8px;
    border-radius: 99px;
    overflow: hidden;
    max-width: 360px;
    margin: 0 auto;
}
.esim-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--esim-primary), var(--esim-accent));
    border-radius: 99px;
    width: 0%;
    transition: width .6s ease;
}

/* ——— RESULTS ——— */
.esim-results-header {
    background: #fff;
    border-radius: var(--esim-radius);
    padding: 24px 28px;
    margin-bottom: 20px;
    border: 1px solid var(--esim-border);
    box-shadow: var(--esim-shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.esim-results-header h2 {
    font-family: var(--esim-font) !important;
    font-size: 1.4rem !important;
    font-weight: 800 !important;
    color: var(--esim-text) !important;
    margin: 0 !important;
    flex: 1;
}
.esim-results-header p {
    font-family: var(--esim-font) !important;
    font-size: .9rem !important;
    color: var(--esim-muted) !important;
    margin: 0 !important;
    flex-basis: 100%;
}
.esim-btn-retry {
    background: transparent;
    border: 2px solid var(--esim-primary);
    border-radius: 10px;
    padding: 10px 20px;
    font-size: .88rem;
    font-family: var(--esim-font);
    font-weight: 700;
    cursor: pointer;
    color: var(--esim-primary);
    white-space: nowrap;
    transition: all .2s;
}
.esim-btn-retry:hover { background: var(--esim-primary); color: #fff; }

.esim-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
@media (max-width: 600px) { .esim-results-grid { grid-template-columns: 1fr; } }

/* ——— PLAN CARD ——— */
.esim-plan-card {
    background: #ffffff;
    border: 1px solid var(--esim-border);
    border-radius: var(--esim-radius);
    padding: 24px;
    box-shadow: var(--esim-shadow);
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: transform .2s, box-shadow .2s;
    position: relative;
    overflow: hidden;
}
.esim-plan-card:hover { transform: translateY(-3px); box-shadow: var(--esim-shadow-lg); }
.esim-plan-card.best-value::before {
    content: '⭐ Best Value';
    position: absolute;
    top: 0; right: 0;
    background: linear-gradient(135deg, var(--esim-accent), var(--esim-accent-dark));
    color: #fff;
    font-size: .72rem;
    font-weight: 800;
    font-family: var(--esim-font);
    padding: 5px 14px;
    border-bottom-left-radius: 12px;
}

.esim-plan-header { display: flex; align-items: center; gap: 14px; }
.esim-provider-logo {
    width: 52px; height: 52px;
    border-radius: 12px;
    object-fit: contain;
    border: 1px solid var(--esim-border);
    background: #f8faff;
    padding: 4px;
    flex-shrink: 0;
}
.esim-provider-logo-fallback {
    width: 52px; height: 52px;
    border-radius: 12px;
    background: var(--esim-primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--esim-primary);
    font-family: var(--esim-font);
    flex-shrink: 0;
}
.esim-provider-info { flex: 1; }
.esim-provider-name {
    font-family: var(--esim-font);
    font-size: 1rem;
    font-weight: 800;
    color: var(--esim-text);
    margin-bottom: 3px;
}
.esim-provider-rating { font-size: .82rem; color: var(--esim-muted); font-family: var(--esim-font); }
.esim-plan-price {
    font-family: var(--esim-font);
    font-size: 1.7rem;
    font-weight: 900;
    color: var(--esim-primary);
    margin-left: auto;
    line-height: 1;
    text-align: right;
}
.esim-plan-price small { display: block; font-size: .72rem; font-weight: 500; color: var(--esim-muted); }

.esim-plan-name {
    font-family: var(--esim-font);
    font-size: .9rem;
    font-weight: 600;
    color: var(--esim-text);
    background: var(--esim-bg);
    padding: 8px 12px;
    border-radius: 8px;
}

.esim-plan-specs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.esim-spec {
    background: var(--esim-bg);
    border-radius: 10px;
    padding: 10px 8px;
    text-align: center;
    font-family: var(--esim-font);
}
.esim-spec-val { font-size: .95rem; font-weight: 800; color: var(--esim-text); display: block; }
.esim-spec-key { font-size: .72rem; color: var(--esim-muted); text-transform: uppercase; letter-spacing: .04em; }

.esim-plan-footer { display: flex; gap: 10px; align-items: center; }
.esim-btn-buy {
    flex: 1;
    background: linear-gradient(135deg, var(--esim-primary), var(--esim-primary-dark));
    color: #fff !important;
    border: none;
    border-radius: 12px;
    padding: 14px 20px;
    font-size: .95rem;
    font-family: var(--esim-font);
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    text-decoration: none !important;
    display: block;
    transition: all .2s;
    box-shadow: 0 3px 12px rgba(0,87,255,.30);
}
.esim-btn-buy:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,87,255,.40); }
.esim-speed-badge {
    background: var(--esim-primary-light);
    color: var(--esim-primary);
    font-family: var(--esim-font);
    font-size: .78rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 8px;
    white-space: nowrap;
}

/* ——— NO RESULTS ——— */
.esim-no-results { text-align: center; }
.esim-no-results-card {
    background: #fff;
    border: 1px solid var(--esim-border);
    border-radius: var(--esim-radius);
    padding: 48px 32px;
    box-shadow: var(--esim-shadow);
}
.esim-no-icon { font-size: 3rem; display: block; margin-bottom: 16px; }
.esim-no-results-card h3 {
    font-family: var(--esim-font) !important;
    font-size: 1.4rem !important;
    font-weight: 800 !important;
    color: var(--esim-text) !important;
    margin: 0 0 12px !important;
}
.esim-no-results-card p {
    font-family: var(--esim-font) !important;
    color: var(--esim-muted) !important;
    margin: 0 0 24px !important;
}
.esim-no-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.esim-btn-secondary {
    background: transparent;
    border: 2px solid var(--esim-border);
    border-radius: 10px;
    padding: 12px 20px;
    font-size: .9rem;
    font-family: var(--esim-font);
    font-weight: 600;
    cursor: pointer;
    color: var(--esim-muted);
    transition: all .2s;
}
.esim-btn-secondary:hover { border-color: var(--esim-primary); color: var(--esim-primary); }

#esim-loader{
    padding:40px;
    max-width:1100px;
    margin:0 auto;
}

.esim-skeleton{
    display:flex;
    flex-direction:column;
    gap:15px;
}

.skeleton-title,
.skeleton-input,
.skeleton-button{
    background:#f1f3f5;
    border-radius:8px;
    animation:pulse 1.4s infinite;
}

.skeleton-title{
    height:40px;
    width:60%;
}

.skeleton-input{
    height:55px;
    width:100%;
}

.skeleton-button{
    height:55px;
    width:220px;
}

@keyframes pulse{
    0%{opacity:.6}
    50%{opacity:1}
    100%{opacity:.6}
}
