.chart-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.brand-tabs {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
}

.brand-tab {
    background: #eaeaea;
    border: 4px solid #eaeaea;
    border-radius: 10px;
    width: 207px;
    height: 68px;
    padding: 12px 45px 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.brand-tab:hover {
    background: #f5f5f5;
    border-color: #f5f5f5;
}

.brand-tab.active {
    background: #ffffff;
    border-color: #c9252c;
}

.brand-tab .brand-logo.brand-logo--arbys {
    width: 50px;
    height: 42.5px;
}

.brand-tab .brand-logo.brand-logo--sonic {
    width: 83.479px;
    height: 41.451px;
}

.brand-tab .brand-logo.brand-logo--dunkin {
    width: auto;
    height: 20px;
}

.brand-tab .brand-logo.brand-logo--buffalo,
.brand-tab .brand-logo.brand-logo--jimmy {
    width: 103.593px;
    height: 44.744px;
}

.brand-tab .brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.brand-tab .brand-logo svg,
.brand-tab .brand-logo img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.tabs {
    display: flex;
    gap: 90px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.tab-button {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 7px 0;
    cursor: pointer;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 18px;
    font-weight: 700;
    line-height: 24px;
    letter-spacing: 0.5px;
    color: #bcbec0;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tab-button:hover {
    color: #961622;
}

.tab-button.active {
    color: #c9252c;
    border-bottom-color: #c9252c;
}

.chart-scroll-wrapper {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
}

.chart-container {
    background: #eeedee;
    border-radius: 20px;
    padding: 16px;
    width: 100%;
    /* max-width: 1248px; */
    margin: 0 auto;
}

.chart-container .chart-area {
    display: flex;
    gap: 8px;
    align-items: stretch;
    overflow: hidden;
}

.chart-container .y-labels {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 130px;
    padding-right: 8px;
    border-right: 1px solid;
}

.chart-container .y-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: rgba(0, 0, 0, 0.7);
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 70px;
}

.chart-container .bars-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0;
    position: relative;
    /* min-height: 350px; */
    max-width: 100%;
    overflow: hidden;
}

.chart-container .grid-lines {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.chart-container .grid-line-horizontal {
    position: absolute;
    left: 0;
    right: 0;
    height: 0;
    border-top: 1px dashed #d3d2d2;
}

.chart-container .grid-line-vertical {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 0;
    border-left: 1px dashed #d3d2d2;
}

.chart-container .bar-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 70px;
    position: relative;
    z-index: 1;
    max-width: 100%;
}

.chart-container .bar-segments {
    display: flex;
    align-items: center;
    height: 53px;
    flex-shrink: 0;
    overflow: visible;
}

.chart-container .bar-segment {
    height: 53px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 2px 4px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: white;
    white-space: nowrap;
    flex-shrink: 0;
    position: relative;
    overflow: visible;
    transform-origin: left center;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.chart-container .bar-segment.animating {
    transform: scaleX(0);
}

.chart-container .bar-segment.animated {
    transform: scaleX(1);
}

.chart-container .bar-segment span {
    position: relative;
    z-index: 2;
}

.chart-container .bar-segment.base {
    background: #c9252c;
}

.chart-container .bar-segment.bonus {
    background: #cecccd;
    color: #231f20;
}

.chart-container .bar-segment.benefit {
    background: #7a7a7a;
    color: white;
}

.chart-container .bar-segment.lti {
    /* background: #5b2c6f; */
    background: #5B5B5B;
    color: white;
}

.chart-container .total-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 10px;
    height: 52px;
    opacity: 0;
    transition: opacity 0.5s ease 0.8s;
}

.chart-container .total-indicator.animated {
    opacity: 1;
}

.chart-container .total-indicator svg {
    width: 8px;
    height: 58px;
    flex-shrink: 0;
}

.chart-container .total-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #961622;
    white-space: nowrap;
}

.legends {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
}

.legend-color {
    width: 30px;
    height: 30px;
    border: 3.75px solid white;
    flex-shrink: 0;
}

.legend-color.base {
    background: #c9252c;
}

.legend-color.bonus {
    background: #d3d2d2;
}

.legend-color.benefit {
    background: #7a7a7a;
}

.legend-color.total {
    background: #961622;
}

.legend-color.lti {
    background: #5B5B5B;
}

.legend-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    color: rgba(0, 0, 0, 0.7);
    white-space: nowrap;
}

@media (max-width: 1023px) {
    .brand-tabs {
        gap: 8px;
    }

    .brand-tab {
        width: calc((100% - 32px) / 5);
        min-width: 0;
        padding: 10px 12px 6px;
    }
}

@media (max-width: 767px) {
    body {
        padding: 40px 16px;
    }

    h1 {
        font-size: 32px;
        line-height: 40px;
    }

    .brand-tabs {
        gap: 10px;
    }

    .brand-tab {
        width: calc((100% - 24px) / 5);
        min-width: 105px;
        flex-shrink: 0;
        height: 33px;
        padding: 6px 16px;
        border-width: 3px;
        border-radius: 8px;
    }

    .brand-tab .brand-logo.brand-logo--arbys {
        width: 24.632px;
        height: 20.937px;
    }

    .brand-tab .brand-logo.brand-logo--buffalo {
        width: 51.035px;
        height: 22.043px;
    }

    .brand-tab .brand-logo.brand-logo--jimmy {
        width: 51.035px;
        height: 22.043px;
    }

    .brand-tab .brand-logo.brand-logo--dunkin {
        width: 48.772px;
        height: 9.547px;
    }

    .brand-tab .brand-logo.brand-logo--sonic {
        width: 51.035px;
        height: 22.043px;
    }

    .tabs {
        gap: 24px;
    }

    .tab-button {
        font-size: 14px;
    }

    .chart-scroll-wrapper {
        width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .chart-container {
        padding: 11px;
        width: 700px;
        max-width: none;
        min-width: 700px;
    }

    .chart-container .y-labels {
        min-width: 86px;
        font-size: 9.27px;
        justify-content: flex-start;
    }

    .chart-container .y-label {
        height: 46px;
    }

    .chart-container .bar-row {
        height: 46px;
    }

    .chart-container .bar-segments {
        height: 35px;
    }

    .chart-container .bar-segment {
        height: 35px;
        font-size: 8px;
        padding: 1.3px 2.6px;
    }

    .chart-container .total-indicator {
        gap: 6.6px;
        margin-left: 6.6px;
        height: 34px;
    }

    .chart-container .total-indicator svg {
        width: 5.3px;
        height: 38.4px;
    }

    .chart-container .total-value {
        font-size: 10px;
    }

    .legend-item {
        padding: 3px 6px;
        gap: 3px;
    }

    .legend-color {
        width: 23px;
        height: 23px;
        border-width: 2.9px;
    }

    .legend-text {
        font-size: 12.4px;
        line-height: 18.7px;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .tabs {
        gap: 70px;
    }

    .tab-button {
        font-size: 16px;
    }
}