/**
 * Price Graph Block - SSDSST
 */

.mcb-pgraph {
    --pg-green: #22c55e;
    --pg-green-light: rgba(34,197,94,.12);
    --pg-green-hover: rgba(34,197,94,.3);
    --pg-red: #e71d1d;
    --pg-red-light: rgba(231,29,29,.08);
    --pg-red-hover: rgba(231,29,29,.15);
    --pg-text: #1e293b;
    --pg-muted: #64748b;
    --pg-border: #e2e8f0;
    background: #fff;
    border-radius: 16px;
    padding: 20px 16px 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,.06);
}

.mcb-pgraph svg {
    width: 100%;
    height: auto;
    display: block;
    margin-top: -14px;
}

/* Grid (+20% visibility) */
.mcb-pg__grid-h {
    stroke: var(--pg-border);
    stroke-dasharray: 4 4;
    opacity: .42;
}

.mcb-pg__grid-v {
    stroke: var(--pg-border);
    stroke-dasharray: 6 4;
    opacity: .6;
}

.mcb-pg__axis {
    stroke: var(--pg-border);
    stroke-width: 1.5;
}

/* Y axis labels */
.mcb-pg__label {
    font: 500 11px system-ui, sans-serif;
    fill: var(--pg-muted);
    text-anchor: end;
}

.mcb-pg__title {
    font: 600 18px system-ui, sans-serif;
    fill: var(--pg-muted);
    text-anchor: middle;
}

/* Curve */
.mcb-pg__area {
    fill: rgba(34,197,94,.06);
}

.mcb-pg__curve {
    fill: none;
    stroke: var(--pg-green);
    stroke-width: 3.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Dots */
.mcb-pg__dot {
    fill: #fff;
    stroke: var(--pg-green);
    stroke-width: 2.5;
    transition: all .2s ease;
}

.mcb-pg__dot--hover {
    stroke-width: 4;
    filter: drop-shadow(0 2px 6px rgba(34,197,94,.5));
}

/* Price labels */
.mcb-pg__price {
    font: 700 13px system-ui, sans-serif;
    fill: var(--pg-text);
    text-anchor: middle;
}

/* Quality % labels */
.mcb-pg__quality {
    font: 500 11px system-ui, sans-serif;
    fill: var(--pg-muted);
    text-anchor: middle;
}

/* Segments */
.mcb-pg__seg {
    cursor: pointer;
}

.mcb-pg__seg-area {
    fill: transparent;
    transition: fill .2s ease;
}

/* Current range - red light fill */
.mcb-pg__seg--cur .mcb-pg__seg-area {
    fill: var(--pg-red-light);
}

/* Hover - green fill */
.mcb-pg__seg--hover .mcb-pg__seg-area,
.mcb-pg__seg:hover .mcb-pg__seg-area {
    fill: var(--pg-green-hover);
}

/* Current + hover - red hover */
.mcb-pg__seg--cur.mcb-pg__seg--hover .mcb-pg__seg-area,
.mcb-pg__seg--cur:hover .mcb-pg__seg-area {
    fill: var(--pg-red-hover);
}

/* Badge - RED */
.mcb-pg__badge rect {
    fill: var(--pg-red);
}

.mcb-pg__badge text {
    font: 700 20px system-ui, sans-serif;
    fill: #fff;
    text-anchor: middle;
}

/* Bracket - RED dashed */
.mcb-pg__bracket {
    fill: none;
    stroke: var(--pg-red);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-dasharray: 3 2;
}

/* Bottom ratings */
.mcb-pg__ratings {
    margin-top: 16px;
    padding: 0 24px;
}

.mcb-pg__ratings-label {
    display: block;
    font: 600 15px system-ui, sans-serif;
    color: var(--pg-text);
    margin-bottom: 12px;
    text-align: center;
}

.mcb-pg__chips {
    display: flex;
    gap: 10px;
}

.mcb-pg__chip {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 2px solid var(--pg-border);
    border-radius: 12px;
    padding: 14px 8px;
    text-decoration: none;
    font: 600 13px system-ui, sans-serif;
    color: var(--pg-text);
    transition: all .2s ease;
    min-height: 48px;
}

.mcb-pg__chip:hover,
.mcb-pg__chip--hover {
    border-color: var(--pg-green);
    background: var(--pg-green-light);
    color: var(--pg-green);
    transform: translateY(-1px);
}

/* Current chip - RED */
.mcb-pg__chip--cur {
    border-color: var(--pg-red);
    background: var(--pg-red-light);
    color: var(--pg-red);
    cursor: default;
}

.mcb-pg__chip--cur:hover,
.mcb-pg__chip--cur.mcb-pg__chip--hover {
    background: var(--pg-red-hover);
}

/* ===== MOBILE ===== */
@media (max-width: 600px) {
    .mcb-pgraph {
        padding: 16px 6px 14px;
        border-radius: 14px;
    }

    .mcb-pgraph svg {
        overflow: visible;
        margin-top: -6px;
    }

    /* Hide % labels on mobile */
    .mcb-pg__label {
        display: none;
    }

    /* "Качество" larger on mobile, shift right 2%, up 20px */
    .mcb-pg__title {
        font-size: 28px;
        font-weight: 700;
        translate: 14px -50px;
    }

    /* Prices +30% on mobile, shift down 4px */
    .mcb-pg__price {
        font-size: 23px;
        font-weight: 800;
        translate: 0 4px;
    }

    /* Quality % +50% on mobile, shift down 4px */
    .mcb-pg__quality {
        font-size: 17px;
        font-weight: 600;
        translate: 0 4px;
    }

    /* Thicker curve */
    .mcb-pg__curve {
        stroke-width: 4;
    }

    /* Smaller dots on mobile */
    .mcb-pg__dot {
        r: 5;
        stroke-width: 2;
    }

    .mcb-pg__bracket {
        stroke-width: 2;
    }

    /* Badge text 2x on mobile */
    .mcb-pg__badge text {
        font-size: 22px;
        font-weight: 700;
    }

    /* Bottom section */
    .mcb-pg__ratings {
        padding: 0 4px;
        margin-top: 14px;
    }

    .mcb-pg__ratings-label {
        font-size: 14px;
        margin-bottom: 10px;
    }

    .mcb-pg__chips {
        gap: 6px;
    }

    .mcb-pg__chip {
        font-size: 11px;
        padding: 10px 4px;
        border-radius: 10px;
        min-height: 46px;
        border-width: 2px;
        line-height: 1.2;
    }
}

/* Small phones */
@media (max-width: 380px) {
    .mcb-pgraph {
        padding: 14px 4px 12px;
    }

    .mcb-pgraph svg {
        min-height: 200px;
    }

    .mcb-pg__price {
        font-size: 16px;
    }

    .mcb-pg__title {
        font-size: 24px;
    }

    .mcb-pg__badge text {
        font-size: 14px;
    }

    .mcb-pg__ratings {
        padding: 0 2px;
    }

    .mcb-pg__ratings-label {
        font-size: 13px;
    }

    .mcb-pg__chip {
        font-size: 10px;
        padding: 8px 3px;
        min-height: 44px;
    }
}
