/* ================================================
   WP Price Checker — Stylesheet
   Megiston v1.0.0
   ================================================ */

/* ---- Wrapper ---- */
.wppc-wrapper {
    font-family: inherit;
    max-width: 900px;
    margin: 1.5em auto;
    box-sizing: border-box;
}

/* ---- Titolo ---- */
.wppc-title {
    text-align: center;
    font-size: 1.15em;
    font-weight: 700;
    color: #333;
    margin: 0 0 0.9em;
    line-height: 1.4;
}

/* ================================================
   GRIGLIA PRINCIPALE
   Col 1: sito ufficiale   Col 2: OTA
   ================================================ */
.wppc-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 0;
    border: 1px solid #dde0e4;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    background: #dde0e4; /* colore "separatore" tra celle */
}

/* ---- Colonna sito ufficiale ---- */
.wppc-col-official {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.55em;
    padding: 1.4em 1.2em;
    background: #f4f8f5;
    text-align: center;
    border-right: 1px solid #dde0e4;
}

.wppc-official-label {
    margin: 0;
    font-size: 0.78em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #888;
}

/* ---- Prezzi ---- */
.wppc-prices {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1em;
}

.wppc-price-gross {
    font-size: 1.05em;
    color: #bbb;
    text-decoration: line-through;
    line-height: 1.2;
}

.wppc-price-net {
    font-size: 2.4em;
    font-weight: 800;
    color: #2a7d4f;
    line-height: 1.1;
}

/* ---- Bonus ---- */
.wppc-bonus {
    font-size: 0.78em;
    color: #555;
    line-height: 1.4;
}

.wppc-bonus-label {
    font-weight: 700;
    margin-right: 0.3em;
}

/* ---- Bottoni ---- */
.wppc-btn {
    display: inline-block;
    padding: 0.55em 1.1em;
    border-radius: 5px;
    font-size: 0.82em;
    font-weight: 600;
    text-decoration: none !important;
    text-align: center;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, border-color 0.18s;
    white-space: nowrap;
}

.wppc-btn-primary {
    background: #2a7d4f;
    color: #fff !important;
    border: 2px solid #2a7d4f;
}

.wppc-btn-primary:hover {
    background: #1e5c39;
    border-color: #1e5c39;
    color: #fff !important;
}

.wppc-btn-secondary {
    background: #fff;
    color: #555 !important;
    border: 1px solid #ccc;
}

.wppc-btn-secondary:hover {
    background: #f0f0f0;
    border-color: #aaa;
    color: #333 !important;
}

/* ================================================
   COLONNA OTA
   ================================================ */
.wppc-col-otas {
    display: flex;
    flex-direction: column;
    background: #fff;
}

/* Singola riga OTA */
.wppc-ota-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 0.8em;
    padding: 0.85em 1.2em;
    border-bottom: 1px solid #f0f2f4;
}

.wppc-ota-row:last-child {
    border-bottom: none;
}

/* Con bonus: aggiunge colonna bonus */
.wppc-has-bonus .wppc-ota-row {
    grid-template-columns: 1fr auto auto auto;
}

/* Nome OTA */
.wppc-ota-name {
    display: flex;
    align-items: center;
    gap: 0.5em;
    font-size: 0.88em;
    color: #444;
    font-weight: 500;
    min-width: 0;
}

.wppc-ota-logo {
    height: 18px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

/* Prezzo OTA */
.wppc-ota-price {
    font-size: 1.25em;
    font-weight: 700;
    color: #c0392b;
    white-space: nowrap;
}

/* Bonus OTA */
.wppc-ota-bonus {
    font-size: 0.75em;
    color: #666;
    max-width: 140px;
    line-height: 1.3;
}

/* ================================================
   LEGENDA
   ================================================ */
.wppc-legend {
    font-size: 0.72em;
    color: #aaa;
    text-align: center;
    margin: 0.6em 0 0;
    line-height: 1.5;
}

/* ================================================
   LAYOUT FORZATI
   ================================================ */
.wppc-layout-desktop .wppc-grid {
    grid-template-columns: 1fr 2fr;
}

.wppc-layout-mobile .wppc-grid {
    grid-template-columns: 1fr;
}

.wppc-layout-mobile .wppc-col-official {
    border-right: none;
    border-bottom: 1px solid #dde0e4;
}

/* ================================================
   RESPONSIVE (layout responsive)
   ================================================ */
@media (max-width: 680px) {

    .wppc-layout-responsive .wppc-grid {
        grid-template-columns: 1fr;
    }

    .wppc-layout-responsive .wppc-col-official {
        border-right: none;
        border-bottom: 1px solid #dde0e4;
        padding: 1.2em 1em;
    }

    .wppc-layout-responsive .wppc-price-net {
        font-size: 2em;
    }

    .wppc-layout-responsive .wppc-ota-row {
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        gap: 0.5em 0.8em;
        padding: 0.75em 0.9em;
    }

    .wppc-layout-responsive.wppc-has-bonus .wppc-ota-row {
        grid-template-columns: 1fr auto;
    }

    .wppc-layout-responsive .wppc-ota-price {
        font-size: 1.1em;
        text-align: right;
    }

    .wppc-layout-responsive .wppc-btn-secondary {
        grid-column: 1 / -1;
        text-align: center;
    }

    .wppc-layout-responsive .wppc-ota-bonus {
        grid-column: 1 / -1;
        max-width: none;
    }

    .wppc-title {
        font-size: 1em;
    }
}

.wppc-loader { display:flex; align-items:center; justify-content:center; gap:.6em; padding:1.8em; color:#888; font-size:.9em; }
.wppc-loader-spinner { display:inline-block; width:18px; height:18px; border:2px solid #ddd; border-top-color:#2a7d4f; border-radius:50%; animation:wppc-spin .7s linear infinite; }
@keyframes wppc-spin { to { transform:rotate(360deg); } }
.wppc-error { text-align:center; color:#999; font-size:.85em; padding:1.5em; }
