/* ============================================================
   AUTO361 CARBURANTE — CSS
   Palette: navy #1a237e, blu #1a73e8, celeste #e3f2fd
   Coerente con plugin Schede Tecniche Auto361
   ============================================================ */

/* ── Page layout ── */
.a361c-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 16px 60px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.a361c-page__container { width: 100%; }

/* ── Breadcrumb ── */
.a361c-breadcrumb {
    font-size: 13px;
    color: #7f8c8d;
    margin-bottom: 20px;
}
.a361c-breadcrumb a { color: #1a73e8; text-decoration: none; }
.a361c-breadcrumb a:hover { text-decoration: underline; }

/* ── Titles ── */
.a361c-page__title {
    font-size: 28px;
    font-weight: 700;
    color: #1a237e;
    margin: 0 0 8px;
}
.a361c-page__subtitle {
    font-size: 16px;
    color: #546e7a;
    margin: 0 0 16px;
    line-height: 1.5;
}
.a361c-page__section-title {
    font-size: 22px;
    font-weight: 600;
    color: #1a237e;
    margin: 32px 0 16px;
}
.a361c-page__update-badge {
    display: inline-block;
    padding: 6px 14px;
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 20px;
    font-size: 13px;
    color: #1565c0;
    margin-bottom: 24px;
}

/* ── Tables ── */
.a361c-table-wrap {
    overflow-x: auto;
    margin: 0 0 24px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.a361c-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: #fff;
}
.a361c-table thead { background: #f5f7fa; }
.a361c-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #1a237e;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 2px solid #e3f2fd;
}
.a361c-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}
.a361c-table tbody tr:hover { background: #f8fbff; }
.a361c-table__cheapest { background: #e3f2fd !important; }
.a361c-table__cheapest td { border-bottom-color: #bbdefb; }
.a361c-table__pos { width: 40px; text-align: center; font-weight: 700; color: #90a4ae; }
.a361c-table__cheapest .a361c-table__pos { color: #1a73e8; }
.a361c-table__name { display: block; font-weight: 600; color: #1a237e; }
.a361c-table__address { display: block; font-size: 12px; color: #90a4ae; margin-top: 2px; }
.a361c-table__brand { font-size: 13px; color: #78909c; white-space: nowrap; }
.a361c-table__price { text-align: right; white-space: nowrap; }
.a361c-table a { color: #1a73e8; text-decoration: none; font-weight: 500; }
.a361c-table a:hover { text-decoration: underline; }
.a361c-price { font-size: 18px; font-weight: 700; }
.a361c-badge-cheapest {
    display: inline-block;
    margin-left: 6px;
    font-size: 11px;
    padding: 2px 8px;
    background: #e3f2fd;
    color: #1565c0;
    border-radius: 10px;
    font-weight: 600;
    vertical-align: middle;
}
.a361c-badge {
    display: inline-block;
    font-size: 12px;
    padding: 2px 10px;
    background: #e3f2fd;
    color: #1565c0;
    border-radius: 10px;
    font-weight: 500;
    margin-left: 8px;
}

/* ── Riepilogo cards ── */
.a361c-riepilogo__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
.a361c-riepilogo__card {
    background: #fff;
    border: 1px solid #e3f2fd;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    transition: transform 0.15s;
}
.a361c-riepilogo__card:hover { transform: translateY(-2px); }
.a361c-riepilogo__icon { font-size: 28px; margin-bottom: 6px; }
.a361c-riepilogo__fuel { font-size: 14px; font-weight: 600; color: #1a237e; margin-bottom: 8px; }
.a361c-riepilogo__value { font-size: 26px; font-weight: 700; line-height: 1.2; }
.a361c-riepilogo__value small {
    display: inline;
    font-size: 12px;
    font-weight: 400;
    color: #90a4ae;
    margin-left: 4px;
}
.a361c-riepilogo__label { font-size: 12px; color: #90a4ae; margin-top: 6px; }

/* ── Medie ── */
.a361c-medie { margin: 0 0 24px; }
.a361c-medie__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}
.a361c-medie__card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    padding: 14px 18px;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.a361c-medie__icon { font-size: 22px; }
.a361c-medie__label { flex: 1; font-size: 14px; font-weight: 500; color: #1a237e; }
.a361c-medie__value { font-size: 20px; font-weight: 700; }

/* ── Region grid ── */
.a361c-region-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 24px;
}
.a361c-region-card {
    display: block;
    padding: 14px 18px;
    background: #fff;
    border: 1px solid #e3f2fd;
    border-radius: 10px;
    text-decoration: none;
    color: #1a237e;
    font-weight: 600;
    text-align: center;
    transition: box-shadow 0.2s, transform 0.15s;
}
.a361c-region-card:hover {
    box-shadow: 0 4px 12px rgba(26,115,232,0.12);
    transform: translateY(-1px);
}

/* ── Province block ── */
.a361c-province-block { margin-bottom: 24px; }
.a361c-province-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a73e8;
    margin: 0 0 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid #e3f2fd;
}

/* ── Comuni grid ── */
.a361c-comuni-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 8px;
}
.a361c-comune-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #e3f2fd;
    border-radius: 8px;
    text-decoration: none;
    color: #1a237e;
    transition: box-shadow 0.2s, transform 0.15s;
}
.a361c-comune-link:hover {
    box-shadow: 0 4px 12px rgba(26,115,232,0.1);
    transform: translateY(-1px);
}
.a361c-comune-name { font-weight: 600; flex: 1; }
.a361c-comune-count { font-size: 12px; color: #90a4ae; }

/* ── Related ── */
.a361c-related { margin-top: 40px; }
.a361c-related h3 { font-size: 18px; font-weight: 600; color: #1a237e; margin: 0 0 12px; }
.a361c-related-list { display: flex; flex-wrap: wrap; gap: 8px; }
.a361c-related-link {
    display: inline-block;
    padding: 8px 16px;
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 20px;
    font-size: 13px;
    color: #1565c0;
    text-decoration: none;
    transition: background 0.2s;
}
.a361c-related-link:hover { background: #bbdefb; }

/* ── Geolocation box ── */
.a361c-geo-box {
    background: #f5f7fa;
    border: 1px solid #e3f2fd;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
}
.a361c-geo-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
    margin-bottom: 16px;
}

/* ── Form controls ── */
.a361c-select, .a361c-input {
    padding: 10px 14px;
    border: 1px solid #cfd8dc;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    color: #1a237e;
}
.a361c-input { min-width: 200px; }
.a361c-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.a361c-btn--primary {
    background: #1a73e8;
    color: #fff;
}
.a361c-btn--primary:hover { background: #1565c0; }

/* ── Search widget ── */
.a361c-search-widget { position: relative; }
.a361c-search-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.a361c-search-autocomplete {
    position: absolute;
    background: #fff;
    border: 1px solid #cfd8dc;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 100;
    max-height: 240px;
    overflow-y: auto;
}
.a361c-search-autocomplete a {
    display: block;
    padding: 10px 16px;
    color: #1a237e;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
}
.a361c-search-autocomplete a:hover { background: #e3f2fd; }

/* ── Widget ── */
.a361c-widget__title {
    font-size: 18px;
    font-weight: 600;
    color: #1a237e;
    margin: 0 0 12px;
}

/* ── Footer ── */
.a361c-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e3f2fd;
    font-size: 13px;
    color: #90a4ae;
}
.a361c-footer a { color: #1a73e8; }

/* ── Empty state ── */
.a361c-empty {
    padding: 24px;
    text-align: center;
    color: #90a4ae;
    background: #f5f7fa;
    border-radius: 8px;
    font-size: 14px;
}

/* ── Loading spinner ── */
.a361c-loading {
    text-align: center;
    padding: 24px;
    color: #1a73e8;
}
.a361c-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #e3f2fd;
    border-top-color: #1a73e8;
    border-radius: 50%;
    animation: a361c-spin 0.8s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}
@keyframes a361c-spin { to { transform: rotate(360deg); } }

/* ── Responsive ── */
@media (max-width: 768px) {
    .a361c-riepilogo__grid { grid-template-columns: repeat(2, 1fr); }
    .a361c-medie__grid { grid-template-columns: 1fr; }
    .a361c-table { font-size: 13px; }
    .a361c-table th, .a361c-table td { padding: 10px; }
    .a361c-price { font-size: 16px; }
    .a361c-table__brand { display: none; }
    .a361c-table th:nth-child(3) { display: none; }
    .a361c-region-grid { grid-template-columns: repeat(2, 1fr); }
    .a361c-comuni-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .a361c-page__title { font-size: 22px; }
    .a361c-riepilogo__grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .a361c-riepilogo__card { padding: 14px; }
    .a361c-riepilogo__value { font-size: 22px; }
    .a361c-geo-controls { flex-direction: column; }
    .a361c-search-controls { flex-direction: column; }
}
