/* ===================================================================
   Widget cours du cuivre — [bwa_cours_cuivre]
   =================================================================== */

.bwa-cuivre {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    font-family: var(--primary-font, system-ui, sans-serif);
    user-select: none;
    transition: opacity 0.2s ease;
}

/* Masquer le widget quand le menu mobile est ouvert */
body.--menu-open .bwa-cuivre {
    opacity: 0;
    pointer-events: none;
}

/* -------------------------------------------------------------------
   Pill (état replié) — deux lignes : label / prix + change
   ------------------------------------------------------------------- */

.bwa-cuivre__pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    background: rgba(8, 14, 26, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 3px solid #00c8e8;
    border-radius: 10px;
    padding: 0.6rem 0.75rem 0.6rem 1rem;
    cursor: pointer;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition: opacity 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    min-width: 220px;
}

.bwa-cuivre.is-open .bwa-cuivre__pill {
    opacity: 0;
    pointer-events: none;
}

.bwa-cuivre__pill:hover {
    border-color: rgba(0, 200, 232, 0.3);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.bwa-cuivre__pill-left {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.bwa-cuivre__pill-label {
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    white-space: nowrap;
}

.bwa-cuivre__pill-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.bwa-cuivre__pill-price {
    font-size: 1.125rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    letter-spacing: -0.01em;
}

.bwa-cuivre__pill-currency {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 500;
}

/* Indicateur de variation */
.bwa-cuivre__change {
    display: inline-flex;
    align-items: center;
    gap: 0.22em;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.bwa-cuivre__change svg { flex-shrink: 0; }

.bwa-cuivre__change--up      { color: #48bb78; }
.bwa-cuivre__change--down    { color: #fc5b5b; }
.bwa-cuivre__change--neutral { color: rgba(255, 255, 255, 0.45); }

/* Bouton toggle (flèche chevron) */
.bwa-cuivre__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: rgba(255, 255, 255, 0.07);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.6);
    flex-shrink: 0;
    transition: background 0.2s ease;
    align-self: center;
}

.bwa-cuivre__toggle:hover { background: rgba(255, 255, 255, 0.13); }

.bwa-cuivre__toggle-icon {
    width: 10px;
    height: 6px;
    transition: transform 0.3s ease;
}

.bwa-cuivre.is-open .bwa-cuivre__toggle-icon {
    transform: rotate(180deg);
}

/* -------------------------------------------------------------------
   Panneau (état déplié)
   ------------------------------------------------------------------- */

.bwa-cuivre__panel {
    position: absolute;
    bottom: 8px;
    right: 0;
    width: 360px;
    background: rgba(8, 14, 26, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.22s ease, transform 0.22s ease;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(0, 200, 232, 0.06);
}

.bwa-cuivre.is-open .bwa-cuivre__panel {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.bwa-cuivre__panel-inner {
    padding: 1.125rem 1.25rem 1rem;
}

/* En-tête */
.bwa-cuivre__panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.625rem;
}

.bwa-cuivre__panel-title {
    margin: 0;
    font-size: 0.62rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.bwa-cuivre__panel-title strong {
    display: block;
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: none;
}

.bwa-cuivre__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    flex-shrink: 0;
    transition: color 0.15s ease, background 0.15s ease;
}

.bwa-cuivre__close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

/* Ligne de prix */
.bwa-cuivre__panel-price-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.bwa-cuivre__panel-price {
    font-size: 1.875rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    letter-spacing: -0.02em;
}

.bwa-cuivre__panel-currency {
    font-size: 0.8125rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.4);
    align-self: center;
}

.bwa-cuivre__panel-change {
    font-size: 0.8125rem;
    align-self: center;
}

/* EUR indicatif */
.bwa-cuivre__eur {
    margin: 0 0 0.875rem;
    font-size: 0.62rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.28);
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.bwa-cuivre__eur strong {
    color: rgba(255, 255, 255, 0.55);
    font-weight: 600;
}

/* -------------------------------------------------------------------
   Sélecteur de période
   ------------------------------------------------------------------- */

.bwa-cuivre__periods {
    display: flex;
    gap: 0.1rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.bwa-cuivre__period {
    flex: 1;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.28);
    font-size: 0.625rem;
    font-weight: 700;
    padding: 0.3rem 0.15rem;
    cursor: pointer;
    border-radius: 4px;
    letter-spacing: 0.04em;
    text-align: center;
    transition: color 0.15s ease, background 0.15s ease;
}

.bwa-cuivre__period:hover {
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.05);
}

.bwa-cuivre__period.is-active {
    color: #00c8e8;
    background: rgba(0, 200, 232, 0.1);
}

/* -------------------------------------------------------------------
   Zone graphique
   ------------------------------------------------------------------- */

.bwa-cuivre__chart-wrap {
    position: relative;
    height: 140px;
    margin-bottom: 0.75rem;
}

.bwa-cuivre__chart {
    width: 100%;
    height: 100%;
    position: relative;
}

.bwa-cuivre__chart svg {
    display: block;
    width: 100%;
    height: 100%;
}

.bwa-cuivre__chart-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.2);
    letter-spacing: 0.05em;
}

/* -------------------------------------------------------------------
   Stats (OUVERT. / +HAUT / +BAS / DER. / VAR.)
   ------------------------------------------------------------------- */

.bwa-cuivre__stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.25rem;
    padding-top: 0.625rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.bwa-cuivre__stat {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.bwa-cuivre__stat-label {
    font-size: 0.56rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.25);
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.bwa-cuivre__stat-val {
    font-size: 0.65rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
}
