/*
 * Metal Price Charts - editable design controls
 * Edit the variables in this first block to restyle every chart.
 */
.mpc-chart {
    --mpc-bg: #ffffff;
    --mpc-gold: #ceb179;
    --mpc-silver: #b8bec2;
    --mpc-metal-line: #ad9864;
    --mpc-heading: var(--mpc-gold);
    --mpc-button-active: var(--mpc-gold);
    --mpc-text: #1f2d33;
    --mpc-muted: #69757b;
    --mpc-axis-text: #5d686e;
    --mpc-grid: rgba(28, 48, 57, 0.10);
    --mpc-area-top: rgba(206, 177, 121, 0.28);
    --mpc-area-bottom: rgba(206, 177, 121, 0.06);
    --mpc-nav-area-top: rgba(206, 177, 121, 0.24);
    --mpc-nav-area-bottom: rgba(206, 177, 121, 0.08);
    --mpc-border: rgba(31, 45, 51, 0.16);
    --mpc-error: #9b3131;
    --mpc-serif: Georgia, "Times New Roman", serif;
    --mpc-sans: Arial, Helvetica, sans-serif;
    --mpc-title-size: 23px;
    --mpc-control-size: 13px;
    --mpc-date-size: 15px;
    --mpc-stat-label-size: 12px;
    --mpc-stat-value-size: 20px;
    --mpc-chart-height: 420px;
    --mpc-radius: 0px;
    --mpc-active-radius: 9px;
    --mpc-pad-x: 12px;
    --mpc-pad-top: 8px;
    --mpc-pad-bottom: 0px;
    --mpc-nav-height: 58px;
    --mpc-nav-handle: 12px;

    position: relative;
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    background: transparent;
    color: var(--mpc-text);
    border-radius: var(--mpc-radius);
    font-family: var(--mpc-sans);
}

.mpc-chart--silver {
    --mpc-metal-line: #aeb7bc;
    --mpc-heading: var(--mpc-silver);
    --mpc-button-active: var(--mpc-silver);
    --mpc-area-top: rgba(174, 183, 188, 0.24);
    --mpc-area-bottom: rgba(174, 183, 188, 0.05);
    --mpc-nav-area-top: rgba(174, 183, 188, 0.20);
    --mpc-nav-area-bottom: rgba(174, 183, 188, 0.06);
}

.mpc-chart *,
.mpc-chart *::before,
.mpc-chart *::after {
    box-sizing: border-box;
}

.mpc-chart__heading {
    padding: var(--mpc-pad-top) var(--mpc-pad-x) 0;
    margin: 0;
    color: var(--mpc-heading);
    font-family: var(--mpc-serif);
    font-size: var(--mpc-title-size);
    font-weight: 400;
    line-height: 1.18;
}

.mpc-chart__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 58px;
    padding: 15px var(--mpc-pad-x) 9px;
    border-bottom: 1px solid var(--mpc-border);
}

.mpc-chart__zoom {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 3px;
    min-width: 0;
}

.mpc-chart__zoom-label {
    margin-right: 4px;
    color: var(--mpc-text);
    font-size: var(--mpc-control-size);
    font-weight: 700;
    line-height: 1;
}

/*
 * Elementor/theme button styles often use global button rules. The selectors
 * and !important declarations below intentionally isolate the chart controls
 * so they stay like the reference chart instead of turning pink/red.
 */
.mpc-chart .mpc-chart__range,
.mpc-chart .mpc-chart__range:hover,
.mpc-chart .mpc-chart__range:focus,
.mpc-chart .mpc-chart__range:active {
    -webkit-appearance: none !important;
    appearance: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    min-width: 30px !important;
    min-height: 30px !important;
    margin: 0 !important;
    padding: 7px 8px !important;
    border: 0 !important;
    border-radius: var(--mpc-active-radius) !important;
    background: transparent !important;
    color: var(--mpc-text) !important;
    box-shadow: none !important;
    outline: 0 !important;
    font-family: var(--mpc-sans) !important;
    font-size: var(--mpc-control-size) !important;
    font-weight: 700 !important;
    font-style: normal !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    text-decoration: none !important;
    text-transform: none !important;
    cursor: pointer !important;
    transition: background-color 140ms ease, color 140ms ease !important;
}

.mpc-chart .mpc-chart__range:hover,
.mpc-chart .mpc-chart__range:focus-visible {
    background: rgba(206, 177, 121, 0.13) !important;
    color: var(--mpc-text) !important;
}

.mpc-chart .mpc-chart__range:focus-visible {
    box-shadow: 0 0 0 2px rgba(206, 177, 121, 0.50) !important;
}

.mpc-chart .mpc-chart__range.is-active,
.mpc-chart .mpc-chart__range.is-active:hover,
.mpc-chart .mpc-chart__range.is-active:focus,
.mpc-chart .mpc-chart__range.is-active:active {
    background: var(--mpc-button-active) !important;
    color: #ffffff !important;
}

.mpc-chart__dates {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 auto;
    gap: 28px;
    color: var(--mpc-heading);
    font-family: var(--mpc-serif);
    font-size: var(--mpc-date-size);
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.mpc-chart__date-arrow {
    color: var(--mpc-text);
    font-family: var(--mpc-sans);
    font-weight: 400;
}

.mpc-chart__plot-wrap {
    position: relative;
    width: 100%;
    height: var(--mpc-chart-height);
    min-height: 300px;
    padding: 0;
}

.mpc-chart__plot {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.mpc-chart__loading,
.mpc-chart__error {
    position: absolute;
    z-index: 15;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    max-width: calc(100% - 40px);
    padding: 9px 12px;
    border: 1px solid var(--mpc-border);
    background: rgba(255, 255, 255, 0.96);
    color: var(--mpc-muted);
    font-size: 13px;
    line-height: 1.4;
    text-align: center;
    backdrop-filter: blur(4px);
}

.mpc-chart__error {
    color: var(--mpc-error);
}

.mpc-chart__loading[hidden],
.mpc-chart__error[hidden],
.mpc-chart__tooltip[hidden] {
    display: none !important;
}

.mpc-chart__tooltip {
    position: absolute;
    z-index: 20;
    left: 8px;
    top: 8px;
    min-width: 132px;
    padding: 9px 11px;
    border: 1px solid rgba(173, 152, 100, 0.42);
    background: rgba(255, 255, 255, 0.98);
    color: var(--mpc-text);
    pointer-events: none;
    box-shadow: 0 8px 24px rgba(31, 45, 51, 0.12);
}

.mpc-chart__tooltip-date {
    margin-bottom: 4px;
    color: var(--mpc-heading);
    font-family: var(--mpc-serif);
    font-size: 13px;
    line-height: 1.2;
}

.mpc-chart__tooltip-price {
    color: var(--mpc-text);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
}

.mpc-chart.is-loading .mpc-chart__plot {
    opacity: 0.90;
}

/* ==============================
   ALL-TIME DRAGGABLE NAVIGATOR
   ============================== */
.mpc-chart__navigator {
    position: relative;
    width: 100%;
    padding: 7px var(--mpc-pad-x) 12px;
    border-top: 1px solid var(--mpc-border);
    user-select: none;
    -webkit-user-select: none;
}

.mpc-chart__navigator-track {
    position: relative;
    width: 100%;
    height: var(--mpc-nav-height);
    overflow: hidden;
    border-top: 1px solid rgba(31, 45, 51, 0.14);
    border-bottom: 1px solid rgba(31, 45, 51, 0.24);
    background: transparent;
    touch-action: none;
}

.mpc-chart__navigator-plot {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.mpc-chart__navigator-shade {
    position: absolute;
    z-index: 3;
    top: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.68);
    pointer-events: none;
}

.mpc-chart__navigator-shade--left {
    left: 0;
    width: 0;
}

.mpc-chart__navigator-shade--right {
    right: 0;
    width: 0;
}

.mpc-chart__navigator-selection {
    position: absolute;
    z-index: 5;
    top: 0;
    bottom: 0;
    min-width: 4px;
    border-top: 1px solid rgba(31, 45, 51, 0.55);
    border-bottom: 5px solid rgba(104, 116, 122, 0.55);
    cursor: grab;
    touch-action: none;
}

.mpc-chart.is-navigator-dragging .mpc-chart__navigator-selection {
    cursor: grabbing;
}

.mpc-chart__navigator-handle {
    position: absolute;
    z-index: 7;
    top: 50%;
    width: var(--mpc-nav-handle);
    height: 24px;
    transform: translateY(-50%);
    border: 1px solid rgba(31, 45, 51, 0.68);
    background: rgba(235, 238, 239, 0.98);
    cursor: ew-resize;
    touch-action: none;
    outline: none;
}

.mpc-chart__navigator-handle::before,
.mpc-chart__navigator-handle::after {
    content: "";
    position: absolute;
    top: 5px;
    bottom: 5px;
    width: 1px;
    background: rgba(40, 55, 61, 0.72);
}

.mpc-chart__navigator-handle::before {
    left: 4px;
}

.mpc-chart__navigator-handle::after {
    right: 4px;
}

.mpc-chart__navigator-handle:focus-visible {
    box-shadow: 0 0 0 2px var(--mpc-button-active);
}

.mpc-chart__navigator-handle--left {
    left: 0;
    transform: translate(-50%, -50%);
}

.mpc-chart__navigator-handle--right {
    right: 0;
    transform: translate(50%, -50%);
}

.mpc-chart__navigator-years {
    position: relative;
    width: 100%;
    height: 19px;
    margin-top: 3px;
    color: #536168;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    pointer-events: none;
}

.mpc-chart__navigator-year {
    position: absolute;
    top: 2px;
    transform: translateX(-50%);
    white-space: nowrap;
}

.mpc-chart__navigator-year.is-left {
    transform: none;
}

.mpc-chart__navigator-year.is-right {
    transform: translateX(-100%);
}

.mpc-chart__navigator-status {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

@media (max-width: 900px) {
    .mpc-chart {
        --mpc-title-size: 21px;
        --mpc-control-size: 12px;
        --mpc-date-size: 14px;
    }

    .mpc-chart__toolbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 11px;
        padding-top: 13px;
    }

    .mpc-chart__dates {
        width: 100%;
        justify-content: flex-end;
    }

    .mpc-chart__navigator-year:not(.is-left):not(.is-right):nth-child(even) {
        display: none;
    }
}

@media (max-width: 600px) {
    .mpc-chart {
        --mpc-chart-height: 340px;
        --mpc-pad-x: 8px;
        --mpc-nav-height: 52px;
    }

    .mpc-chart__zoom {
        flex-wrap: nowrap;
        width: 100%;
        padding-bottom: 4px;
        overflow-x: auto;
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
    }

    .mpc-chart__zoom-label,
    .mpc-chart .mpc-chart__range {
        flex: 0 0 auto !important;
    }

    .mpc-chart__dates {
        justify-content: space-between;
        gap: 12px;
    }

    .mpc-chart__navigator-year:not(.is-left):not(.is-right) {
        display: none;
    }
}

/* ==============================
   V3 HEADER + PERIOD STATISTICS
   ============================== */
.mpc-chart__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 32px;
    padding: 12px var(--mpc-pad-x) 8px;
}

.mpc-chart__header .mpc-chart__heading {
    flex: 1 1 auto;
    min-width: 190px;
    padding: 0;
}

.mpc-chart__stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(112px, auto));
    flex: 0 0 auto;
    align-items: stretch;
}

.mpc-chart__stat {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    min-height: 54px;
    padding: 4px 20px;
    border-left: 1px solid var(--mpc-border);
}

.mpc-chart__stat:first-child {
    border-left: 0;
}

.mpc-chart__stat-label {
    color: var(--mpc-text);
    font-family: var(--mpc-sans);
    font-size: var(--mpc-stat-label-size);
    font-weight: 700;
    line-height: 1.15;
    white-space: nowrap;
}

.mpc-chart__stat-value {
    color: var(--mpc-heading);
    font-family: var(--mpc-serif);
    font-size: var(--mpc-stat-value-size);
    font-weight: 600;
    line-height: 1.1;
    white-space: nowrap;
}

/* Keep the reference-chart gold styling for changes. These two selectors are
   here only as easy hooks if you later want green/red movement colours. */
.mpc-chart__stat-value.is-positive,
.mpc-chart__stat-value.is-negative {
    color: var(--mpc-heading);
}

.mpc-chart__source {
    padding: 0 var(--mpc-pad-x) 8px;
    color: var(--mpc-muted);
    font-size: 10px;
    line-height: 1.3;
    text-align: right;
}

.mpc-chart__source a,
.mpc-chart__source a:visited {
    color: inherit;
    text-decoration: underline;
}

@media (max-width: 1100px) {
    .mpc-chart__header {
        flex-direction: column;
        gap: 14px;
    }

    .mpc-chart__stats {
        width: 100%;
        grid-template-columns: repeat(4, 1fr);
    }

    .mpc-chart__stat {
        padding-left: 14px;
        padding-right: 14px;
    }
}

@media (max-width: 700px) {
    .mpc-chart__stats {
        grid-template-columns: repeat(2, 1fr);
        row-gap: 12px;
    }

    .mpc-chart__stat:nth-child(3) {
        border-left: 0;
    }

    .mpc-chart__stat-value {
        font-size: 18px;
    }
}
