/* css/station_pro.css - Standard Layout Restyle */

:root {
    --pro-primary: #0f172a;
    --pro-accent: #3b82f6;
    --pro-success: #10b981;
    --pro-bg: #fff;
    --pro-text: #334155;
    --pro-text-light: #64748b;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --radius-lg: 12px;
}

.station-pro-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--pro-text);
}

/* --- HEADER STANDARD (Left Aligned) --- */
.sp-header-standard {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 30px;
    padding: 20px 0 40px 0;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 30px;
}

.sp-header-left {
    flex: 1;
}

.sp-title {
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    font-weight: 800;
    color: var(--pro-primary);
    margin: 0 0 10px 0;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.sp-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.sp-meta-item {
    font-size: 0.95rem;
    color: var(--pro-text-light);
    display: flex;
    align-items: center;
    gap: 6px;
}

.sp-update-info {
    font-size: 0.8rem;
    color: #94a3b8;
}

/* Badges */
.badg-pill {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.b-blue {
    background: #eff6ff;
    color: #2563eb;
}

.b-green {
    background: #dcfce7;
    color: #166534;
}

.b-red {
    background: #fee2e2;
    color: #b91c1c;
}

.b-gray {
    background: #f1f5f9;
    color: #475569;
}

/* Right Box (Price) */
.sp-header-right {
    flex-shrink: 0;
}

.main-price-box {
    text-align: right;
    background: #fff;
    padding: 15px 25px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    transition: all .2s ease;
}

.mp-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--pro-text-light);
    font-weight: 700;
    margin-bottom: 6px;
    display: block;
}

.mp-val {
    font-size: 2.4rem;
    font-weight: 900;
    color: var(--pro-primary);
    line-height: 1;
}

.sp-share-mini {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.sp-share-mini button {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    transition: color 0.2s;
}

.sp-share-mini button:hover {
    color: var(--pro-accent);
}

/* --- PRICE GRID --- */
.sp-price-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.sp-price-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid #e2e8f0;
    transition: all .2s ease;
}

.sp-price-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--pro-accent);
}

.spc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.spc-fuel-name {
    font-weight: 700;
    color: var(--pro-text);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.spc-price-huge {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--pro-primary);
    line-height: 1;
    margin-bottom: 10px;
}

.spc-trend {
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 6px;
    background: #f1f5f9;
    color: var(--pro-text-light);
    font-weight: 600;
}

.trend-up {
    color: #ef4444;
    background: #fef2f2;
}

.trend-down {
    color: #10b981;
    background: #ecfdf5;
}

/* --- MAIN LAYOUT --- */
.sp-main-grid {
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 32px;
}

.sp-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-sm);
    border: 1px solid #e2e8f0;
}

.sp-card h2,
.sp-card h3 {
    margin-top: 0;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--pro-primary);
    margin-bottom: 20px;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 12px;
}

/* Table Management */
.sp-table {
    width: 100%;
    border-collapse: collapse;
}

.sp-table th {
    text-align: left;
    padding: 12px 10px;
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
    border-bottom: 1px solid #f1f5f9;
}

.sp-table td {
    padding: 14px 10px;
    border-bottom: 1px solid #f8fafc;
    font-weight: 600;
}

/* Rotadores de Precios */
.main-price-box.mp-diesel {
    border-color: rgba(15, 23, 42, 0.15);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

.main-price-box.mp-g95 {
    border-color: rgba(16, 185, 129, 0.22);
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.12);
}

.mp-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

.main-price-box.mp-g95 .mp-badge {
    border-color: rgba(16, 185, 129, .25);
    background: rgba(16, 185, 129, .08);
    color: #065f46;
}

.mp-val.mp-fade-out {
    opacity: 0;
    transform: translateY(6px);
}

.mp-val.mp-fade-in {
    opacity: 1;
    transform: translateY(0);
}

/* Nearby Cards Styles */
.sp-nearby-card {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
}

.sp-nearby-head {
    background: #f8fafc;
    padding: 14px 18px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sp-nearby-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--pro-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sp-nearby-sub {
    font-size: 0.8rem;
    color: #64748b;
}

.sp-nearby-list {
    padding: 12px;
}

.sp-nearby-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    text-decoration: none;
    margin-bottom: 12px;
    transition: all 0.2s ease;
}

.sp-nearby-row:last-child {
    margin-bottom: 0;
}

.sp-nearby-row:hover {
    border-color: var(--pro-accent);
    box-shadow: var(--shadow-md);
}

.sp-nearby-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

/* Logo container - fixed size */
.sp-nearby-avatar {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 8px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: #64748b;
    overflow: hidden;
}

.sp-nearby-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sp-nearby-main {
    flex: 1;
    min-width: 0;
}

.sp-nearby-topline {
    margin-bottom: 2px;
}

.sp-nearby-distance {
    font-size: 0.75rem;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.sp-nearby-distance i {
    color: var(--pro-accent);
    font-size: 0.65rem;
}

.sp-nearby-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--pro-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sp-nearby-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.sp-nearby-fuel {
    font-size: 0.75rem;
    color: #475569;
}

.sp-nearby-fuel strong {
    color: #059669;
}

.sp-nearby-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
}

.sp-nearby-chip--rank {
    background: #fef3c7;
    color: #b45309;
}

.sp-nearby-right {
    flex-shrink: 0;
}

.sp-nearby-cta {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--pro-accent);
    display: flex;
    align-items: center;
    gap: 4px;
}

.sp-nearby-footnote {
    padding: 10px 18px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    font-size: 0.75rem;
    color: #64748b;
}

.sp-nearby-empty {
    padding: 30px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.sp-nearby-empty-ico {
    font-size: 2rem;
    color: #cbd5e1;
}

.sp-nearby-empty-title {
    font-weight: 700;
    color: #64748b;
}

.sp-nearby-empty-sub {
    font-size: 0.85rem;
    color: #94a3b8;
}

/* MOBILE OPTIMIZATIONS (From station.php) */
@media (max-width: 1024px) {
    .sp-main-grid {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .col-main,
    .col-side {
        display: contents;
    }

    .sp-header-standard {
        flex-direction: column;
        gap: 20px;
    }

    .main-price-box {
        text-align: left;
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .sp-price-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .sp-price-card.hidden-mobile {
        display: none;
    }

    .btn-show-all-prices {
        display: block !important;
        width: 100%;
        text-align: center;
        padding: 12px;
        background: #f1f5f9;
        color: #334155;
        border-radius: 12px;
        margin-top: 10px;
        font-weight: 700;
        cursor: pointer;
        border: 1px solid #e2e8f0;
    }

    .sp-table thead {
        display: none;
    }

    .sp-table tr {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 0;
        border-bottom: 1px solid #f1f5f9;
        flex-wrap: wrap;
        gap: 5px;
    }

    .sp-table td {
        display: block;
        border: none;
        padding: 0;
    }

    .sp-table td:first-child {
        width: 100%;
        margin-bottom: 5px;
    }

    .mobile-collapsible h2,
    .mobile-collapsible h3 {
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin: 0 !important;
        padding-bottom: 0 !important;
        border-bottom: none !important;
    }

    .mobile-collapsible h2::after,
    .mobile-collapsible h3::after {
        content: '\f078';
        font-family: "Font Awesome 6 Free";
        font-weight: 900;
        font-size: 0.9rem;
        transition: transform 0.3s;
    }

    .mobile-collapsible.active h2::after,
    .mobile-collapsible.active h3::after {
        transform: rotate(180deg);
    }

    .mobile-collapsible .sp-card-content {
        display: none;
        margin-top: 15px;
        border-top: 1px solid #f1f5f9;
        padding-top: 15px;
    }

    .mobile-collapsible.active .sp-card-content {
        display: block;
    }
}

/* Sticky Nav for Mobile */
.mobile-sticky-nav {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 92%;
    max-width: 420px;
    background: #fff;
    padding: 10px 18px;
    border-radius: 50px;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

@media (max-width: 768px) {
    .mobile-sticky-nav {
        display: flex;
    }

    .station-pro-container {
        padding-bottom: 90px;
    }
}

.btn-navigate {
    background: var(--pro-primary);
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 800;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Chart Container Fix */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}