/* ============================================================
   Roamic eSIM Plugin – Frontend Styles
   Couleur principale : var(--roamic-primary) configurable
   ============================================================ */

:root {
    --roamic-primary:   #00C2A8;
    --roamic-primary-d: #00a38c;
    --roamic-dark:      #1a1f36;
    --roamic-gray:      #f5f7fa;
    --roamic-border:    #e2e8f0;
    --roamic-text:      #2d3748;
    --roamic-muted:     #718096;
    --roamic-radius:    12px;
    --roamic-shadow:    0 2px 12px rgba(0,0,0,.08);
    --roamic-shadow-h:  0 8px 30px rgba(0,0,0,.14);
}

/* ── Recherche ──────────────────────────────────────────── */
.roamic-search-wrapper {
    position: relative;
    max-width: 620px;
    margin: 0 auto 2rem;
}
.roamic-search-box {
    display: flex;
    align-items: center;
    background: #fff;
    border: 2px solid var(--roamic-border);
    border-radius: 50px;
    padding: 6px 6px 6px 20px;
    box-shadow: var(--roamic-shadow);
    transition: border-color .2s;
}
.roamic-search-box:focus-within {
    border-color: var(--roamic-primary);
}
.roamic-search-icon {
    font-size: 1.2rem;
    margin-right: 10px;
    flex-shrink: 0;
}
.roamic-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    background: transparent;
    color: var(--roamic-text);
}
.roamic-search-btn {
    background: var(--roamic-primary);
    color: #fff;
    border: none;
    border-radius: 40px;
    padding: 10px 22px;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
    flex-shrink: 0;
}
.roamic-search-btn:hover { background: var(--roamic-primary-d); }

.roamic-suggestions {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--roamic-border);
    border-radius: var(--roamic-radius);
    box-shadow: var(--roamic-shadow-h);
    list-style: none;
    margin: 0;
    padding: 6px 0;
    z-index: 999;
    max-height: 340px;
    overflow-y: auto;
    display: none;
}
.roamic-suggestions.active { display: block; }
.roamic-suggestion-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background .15s;
}
.roamic-suggestion-item:hover { background: var(--roamic-gray); }
.roamic-suggestion-flag { width: 28px; height: 20px; object-fit: cover; border-radius: 3px; }
.roamic-suggestion-flag-emoji { font-size: 1.4rem; line-height: 1; }
.roamic-suggestion-name { font-weight: 600; font-size: .95rem; }
.roamic-suggestion-price { margin-left: auto; color: var(--roamic-primary); font-size: .85rem; font-weight: 600; }

/* ── Grille de pays ─────────────────────────────────────── */
.roamic-countries-grid,
.roamic-popular-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    padding: 8px 0;
}
.roamic-popular-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }

.roamic-country-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: #fff;
    border: 1px solid var(--roamic-border);
    border-radius: var(--roamic-radius);
    padding: 16px 10px;
    text-decoration: none;
    color: var(--roamic-text);
    transition: box-shadow .2s, transform .2s;
}
.roamic-country-card:hover {
    box-shadow: var(--roamic-shadow-h);
    transform: translateY(-3px);
    text-decoration: none;
    border-color: var(--roamic-primary);
}
.roamic-country-flag img,
.roamic-country-flag .roamic-flag-emoji { width: 52px; height: 36px; object-fit: cover; border-radius: 4px; }
.roamic-flag-emoji { font-size: 2.2rem; line-height: 1; }
.roamic-country-name { font-weight: 600; font-size: .9rem; margin-top: 8px; }
.roamic-country-price { color: var(--roamic-primary); font-size: .8rem; margin-top: 4px; }

/* Populaires */
.roamic-popular-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    color: var(--roamic-text);
    padding: 12px;
    border-radius: var(--roamic-radius);
    transition: background .15s;
}
.roamic-popular-card:hover { background: var(--roamic-gray); text-decoration: none; }
.roamic-popular-flag { font-size: 2.8rem; line-height: 1; }
.roamic-popular-flag img { width: 48px; height: 32px; object-fit: cover; border-radius: 3px; }
.roamic-popular-name { font-size: .85rem; font-weight: 600; margin-top: 6px; }

/* ── Cards forfaits ─────────────────────────────────────── */
.roamic-packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    padding: 8px 0 24px;
}
.roamic-package-card {
    background: #fff;
    border: 1px solid var(--roamic-border);
    border-radius: var(--roamic-radius);
    overflow: hidden;
    box-shadow: var(--roamic-shadow);
    display: flex;
    flex-direction: column;
    transition: box-shadow .2s, transform .2s;
}
.roamic-package-card:hover {
    box-shadow: var(--roamic-shadow-h);
    transform: translateY(-4px);
}
.roamic-package-header {
    background: var(--roamic-dark);
    color: #fff;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.roamic-package-name { font-weight: 700; font-size: .95rem; }
.roamic-package-badge {
    background: var(--roamic-primary);
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    text-transform: uppercase;
}
.roamic-package-body { padding: 20px 18px; flex: 1; }
.roamic-package-data {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--roamic-primary);
    line-height: 1;
    margin-bottom: 14px;
}
.roamic-package-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.roamic-meta-item {
    font-size: .8rem;
    color: var(--roamic-muted);
    background: var(--roamic-gray);
    padding: 4px 10px;
    border-radius: 20px;
}
.roamic-package-footer {
    padding: 16px 18px;
    border-top: 1px solid var(--roamic-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.roamic-price {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--roamic-dark);
}
.roamic-btn-buy {
    display: inline-block;
    background: var(--roamic-primary);
    color: #fff;
    text-decoration: none;
    padding: 9px 20px;
    border-radius: 30px;
    font-size: .88rem;
    font-weight: 700;
    transition: background .2s;
    border: none;
    cursor: pointer;
}
.roamic-btn-buy:hover { background: var(--roamic-primary-d); color: #fff; text-decoration: none; }

/* ── Page pays ──────────────────────────────────────────── */
.roamic-page-wrapper { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

.roamic-hero {
    display: flex;
    align-items: center;
    gap: 30px;
    padding: 40px 0 30px;
    border-bottom: 1px solid var(--roamic-border);
    flex-wrap: wrap;
}
.roamic-hero-flag { width: 100px; height: 70px; object-fit: cover; border-radius: 8px; box-shadow: var(--roamic-shadow); }
.roamic-flag-emoji-large { font-size: 5rem; line-height: 1; }
.roamic-hero-content h1 { font-size: 2rem; font-weight: 800; color: var(--roamic-dark); margin: 0 0 8px; }
.roamic-hero-subtitle { color: var(--roamic-muted); margin: 0 0 14px; font-size: 1.05rem; }
.roamic-hero-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.roamic-badge {
    background: var(--roamic-gray);
    padding: 5px 14px;
    border-radius: 20px;
    font-size: .82rem;
    font-weight: 600;
    color: var(--roamic-text);
}
.roamic-badge-price { background: #e6faf7; color: var(--roamic-primary); }

.roamic-breadcrumb { padding: 14px 0; font-size: .85rem; color: var(--roamic-muted); }
.roamic-breadcrumb a { color: var(--roamic-primary); text-decoration: none; }
.roamic-breadcrumb a:hover { text-decoration: underline; }

/* Filtres */
.roamic-filters-bar {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    padding: 16px 0;
    border-bottom: 1px solid var(--roamic-border);
    margin-bottom: 24px;
}
.roamic-filter-group { display: flex; flex-direction: column; gap: 4px; }
.roamic-filter-group label { font-size: .78rem; font-weight: 700; color: var(--roamic-muted); text-transform: uppercase; }
.roamic-filter-select {
    border: 1px solid var(--roamic-border);
    border-radius: 8px;
    padding: 7px 12px;
    font-size: .9rem;
    color: var(--roamic-text);
    cursor: pointer;
}
.roamic-filter-select:focus { outline: none; border-color: var(--roamic-primary); }

.roamic-country-title { font-size: 1.4rem; font-weight: 700; color: var(--roamic-dark); margin: 0 0 20px; }

/* Pourquoi / Why */
.roamic-why-section { padding: 48px 0; border-top: 1px solid var(--roamic-border); margin-top: 40px; }
.roamic-why-section h2 { font-size: 1.6rem; font-weight: 700; color: var(--roamic-dark); text-align: center; margin-bottom: 28px; }
.roamic-why-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }
.roamic-why-card { text-align: center; padding: 24px 16px; background: var(--roamic-gray); border-radius: var(--roamic-radius); }
.roamic-why-icon { font-size: 2.2rem; }
.roamic-why-card h3 { font-size: .95rem; font-weight: 700; margin: 10px 0 6px; color: var(--roamic-dark); }
.roamic-why-card p { font-size: .85rem; color: var(--roamic-muted); margin: 0; }

/* FAQ */
.roamic-faq-section { padding: 32px 0 48px; }
.roamic-faq-section h2 { font-size: 1.4rem; font-weight: 700; color: var(--roamic-dark); margin-bottom: 20px; }
.roamic-faq-item { border: 1px solid var(--roamic-border); border-radius: var(--roamic-radius); margin-bottom: 10px; overflow: hidden; }
.roamic-faq-item summary {
    padding: 16px 20px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--roamic-text);
}
.roamic-faq-item summary::after { content: '+'; font-size: 1.3rem; color: var(--roamic-primary); }
.roamic-faq-item[open] summary::after { content: '−'; }
.roamic-faq-item p { padding: 0 20px 16px; margin: 0; color: var(--roamic-muted); font-size: .9rem; }

/* Messages */
.roamic-error { background: #fff5f5; border: 1px solid #fed7d7; color: #c53030; padding: 14px 18px; border-radius: var(--roamic-radius); }
.roamic-no-results { text-align: center; padding: 40px; color: var(--roamic-muted); }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 640px) {
    .roamic-packages-grid { grid-template-columns: 1fr; }
    .roamic-hero { flex-direction: column; align-items: flex-start; }
    .roamic-hero-content h1 { font-size: 1.5rem; }
    .roamic-countries-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}

/* ── Plan Picker (inspiré roamic.com) ───────────────────────
   Variables locales au composant :
   --rpp-accent / --rpp-accent2 / --rpp-radius
   ─────────────────────────────────────────────────────────── */
.roamic-plan-picker {
    --rpp-accent:  var(--roamic-primary, #00C2A8);
    --rpp-accent2: #51C3DD;
    --rpp-text:    var(--roamic-dark,    #1a1f36);
    --rpp-sub:     var(--roamic-muted,   #718096);
    --rpp-line:    var(--roamic-border,  #e2e8f0);
    --rpp-radius:  14px;
    margin-top: 10px;
}

/* -- Grille de cards limitées -- */
.rpp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}
@media (max-width: 600px) { .rpp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 380px) { .rpp-grid { grid-template-columns: 1fr; } }

/* -- Card -- */
.rpp-card {
    position: relative;
    border: 1px solid var(--rpp-line);
    border-radius: var(--rpp-radius);
    background: #fff;
    padding: 10px 14px;
    cursor: pointer;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    transition: all .2s ease;
}
.rpp-card:hover {
    border-color: var(--rpp-accent);
    background: linear-gradient(135deg, #fafbff, #fff);
}
.rpp-card--active {
    border-color: var(--rpp-accent);
    background: linear-gradient(135deg, #F0FDF9, #ffffff);
    box-shadow: 0 0 0 2px rgba(0,194,168,.18);
}

/* -- Badge Popular -- */
.rpp-badge-popular {
    position: absolute;
    top: -10px;
    right: -8px;
    background: #FF5A5F;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,.15);
    z-index: 1;
    text-transform: uppercase;
    letter-spacing: .5px;
    line-height: 1.4;
}

/* -- Radio custom -- */
.rpp-radio {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--rpp-accent);
    border-radius: 50%;
    display: grid;
    place-content: center;
    flex-shrink: 0;
    margin-top: 3px;
    transition: all .2s ease;
    cursor: pointer;
}
.rpp-radio::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transform: scale(0);
    background: linear-gradient(135deg, var(--rpp-accent), var(--rpp-accent2));
    transition: transform .15s ease;
}
.rpp-radio:checked::before { transform: scale(1); }

/* -- Contenu de la card -- */
.rpp-card-body {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 2px;
}
.rpp-card-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}
.rpp-size {
    font-weight: 700;
    font-size: 16px;
    color: var(--rpp-text);
    line-height: 1.2;
}
.rpp-price {
    font-weight: 500;
    font-size: 14px;
    color: #555;
    opacity: .9;
    white-space: nowrap;
}
.rpp-duration {
    font-size: 12px;
    color: var(--rpp-sub);
    font-weight: 500;
    line-height: 1.1;
}

/* -- Bloc illimité -- */
.rpp-unl-box {
    width: 100%;
    margin-top: 14px;
    border: 1px solid var(--rpp-line);
    border-radius: var(--rpp-radius);
    overflow: hidden;
    background: #fff;
    transition: all .2s ease;
}
.rpp-unl-box--active {
    border-color: var(--rpp-accent);
    background: linear-gradient(135deg, #F0FDF9, #ffffff);
    box-shadow: 0 0 0 2px rgba(0,194,168,.18);
}
.rpp-unl-head {
    background: linear-gradient(90deg, var(--rpp-accent), var(--rpp-accent2));
    color: #fff;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.rpp-unl-radio {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 1.5px solid #fff;
    border-radius: 50%;
    display: grid;
    place-content: center;
    flex-shrink: 0;
    cursor: pointer;
    position: relative;
    transition: all .25s ease;
}
.rpp-unl-radio::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
    transform: scale(0);
    transition: transform .15s ease;
}
.rpp-unl-radio:checked::before { transform: scale(1); }
.rpp-unl-title {
    flex: 1;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}
.rpp-unl-select {
    width: 100%;
    border: none;
    border-top: 1px solid var(--rpp-line);
    background: #fff;
    color: var(--rpp-text);
    padding: 12px 38px 12px 14px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 0 0 var(--rpp-radius) var(--rpp-radius);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%2300C2A8' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 18px;
}
.rpp-unl-select:focus { outline: none; box-shadow: 0 0 0 2px rgba(0,194,168,.25); }

/* -- Barre d'achat -- */
.rpp-buy-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 20px;
    padding: 16px 20px;
    background: var(--roamic-gray, #f5f7fa);
    border-radius: var(--rpp-radius);
    flex-wrap: wrap;
}
.rpp-selected-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.rpp-selected-name {
    font-size: .85rem;
    color: var(--rpp-sub);
    font-weight: 500;
}
.rpp-selected-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--rpp-text);
    line-height: 1;
}
.rpp-btn-buy {
    padding: 12px 28px;
    font-size: 1rem;
    border-radius: 30px;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .rpp-buy-bar { flex-direction: column; align-items: stretch; text-align: center; }
    .rpp-btn-buy { width: 100%; }
    .rpp-size { font-size: 15px; }
}

/* ── Badges réseau (4G / 5G / opérateur) ────────────────── */
.rpp-net-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}
.rpp-net-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1.4;
    white-space: nowrap;
}
.rpp-net-5g  { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.rpp-net-4g  { background: #e3f2fd; color: #1565c0; border: 1px solid #90caf9; }
.rpp-net-other { background: #f3e5f5; color: #6a1b9a; border: 1px solid #ce93d8; }

/* Badges dans le header illimité */
.rpp-unl-title .rpp-net-badges { display: inline-flex; margin: 0 0 0 6px; vertical-align: middle; }
.rpp-unl-title .rpp-net-badge  { font-size: 9px; }
.rpp-unl-subtitle { font-weight: 400; opacity: .8; margin-left: 6px; font-size: 12px; }

/* ── Section journalière illimitée ──────────────────────── */
.rpp-unl-daily-info {
    padding: 10px 16px 4px;
    border-top: 1px solid var(--rpp-line);
    background: #fff;
}
.rpp-day-unit-price {
    font-size: 12px;
    color: var(--rpp-sub);
    font-weight: 500;
}

/* Slider journalier */
.rpp-daily-slider-wrap {
    padding: 12px 16px 14px;
    background: #fff;
    border-radius: 0 0 var(--rpp-radius) var(--rpp-radius);
}
.rpp-slider-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.rpp-slider-label {
    font-size: 13px;
    color: var(--rpp-text);
}
.rpp-slider-label strong {
    color: var(--rpp-accent, #7B87F5);
    font-size: 14px;
}
.rpp-total-day {
    font-size: 15px;
    font-weight: 700;
    color: var(--rpp-text);
}
.rpp-day-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, var(--rpp-accent, #7B87F5) 0%, var(--rpp-line, #e0e0e0) 0%);
    outline: none;
    cursor: pointer;
    transition: background .15s;
}
.rpp-day-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--rpp-accent, #7B87F5);
    box-shadow: 0 2px 6px rgba(123,135,245,.4);
    cursor: pointer;
    transition: transform .1s;
}
.rpp-day-range::-webkit-slider-thumb:hover { transform: scale(1.15); }
.rpp-day-range::-moz-range-thumb {
    width: 20px; height: 20px;
    border: none; border-radius: 50%;
    background: var(--rpp-accent, #7B87F5);
    cursor: pointer;
}
.rpp-slider-marks {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--rpp-sub, #9e9e9e);
    margin-top: 4px;
    padding: 0 2px;
}
