/*
 * Coding Ireland proprietary interactive activity
 * Copyright (c) 2017-2026 Coding Ireland. All rights reserved.
 *
 * Part of the Coding Ireland online learning platform. Licensed for use only
 * as delivered on the platform. Copying, redistributing, or adapting this
 * file, in whole or in part, for use in any other product or service is not
 * permitted. Ref: CI-maths-best-buy-compare
 */
/*
 * best-buy-compare activity styles.
 *
 * Two shelf-tag cards side by side with a "vs" badge between them.
 * Each card carries a shop name, product name, editable price input,
 * editable size + unit inputs, and a slot for the computed per-unit
 * price. A winner banner appears below highlighting the better-value
 * option.
 */

.bbc-mode-chip {
    display: inline-block;
    padding: 0.3rem 0.7rem;
    background: var(--maths-surface-alt);
    color: var(--maths-primary-dark);
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.bbc-target-label { font-weight: 800; color: #8a5a00; font-size: 0.95rem; margin-right: 0.5rem; }
.bbc-target-prompt { flex: 1 1 auto; color: #6b4500; font-weight: 700; font-size: 1rem; }

.bbc-shelf {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.bbc-tag {
    background: #FFFCEC;
    border: 2px solid #F0C14B;
    border-radius: 14px;
    padding: 1.1rem;
    text-align: center;
    box-shadow: 0 4px 0 #E8C272;
    position: relative;
}

.bbc-tag-shop {
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 1rem;
    color: #B04A3F;
    margin-bottom: 0.35rem;
}

.bbc-tag-name {
    margin: 0 0 0.85rem 0;
    color: var(--maths-ink);
    font-size: 1.2rem;
    font-weight: 800;
}

.bbc-tag-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.25rem;
    margin-bottom: 0.6rem;
}

.bbc-tag-currency {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--maths-primary-dark);
}

.bbc-tag-price-input {
    width: 6rem !important;
    text-align: center !important;
    font-size: 2rem !important;
    font-weight: 800 !important;
    border: 2px solid transparent !important;
    background: transparent !important;
    color: var(--maths-primary-dark) !important;
    font-variant-numeric: tabular-nums;
    padding: 0 !important;
}

.bbc-tag-price-input:focus {
    border-color: var(--maths-primary) !important;
    background: #fff !important;
}

.bbc-tag-size {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-weight: 700;
    color: var(--maths-ink);
    font-size: 1.1rem;
    margin-bottom: 0.6rem;
}

.bbc-tag-size-label { font-weight: 700; color: var(--maths-ink-muted); }

.bbc-tag-size-input {
    width: 4rem !important;
    text-align: center !important;
    font-weight: 800 !important;
    font-size: 1.15rem !important;
    background: rgba(255, 255, 255, 0.5) !important;
}

.bbc-tag-unit-input {
    width: 5rem !important;
    text-align: center !important;
    font-weight: 700 !important;
    font-size: 1.05rem !important;
    background: rgba(255, 255, 255, 0.5) !important;
}

/* Per-unit reveal: now shows the division above the answer so pupils
 * see the operation, not just the result. */
.bbc-tag-perunit {
    background: var(--maths-surface);
    border: 1px solid var(--maths-border);
    border-radius: 8px;
    padding: 0.55rem 0.8rem;
    font-weight: 800;
    color: var(--maths-primary-dark);
    font-variant-numeric: tabular-nums;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
}

.bbc-perunit-working {
    font-size: 1rem;
    color: var(--maths-ink-muted);
    font-weight: 700;
}

.bbc-perunit-result {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--maths-primary-dark);
}

.bbc-tag.is-winner {
    border-color: var(--maths-success);
    background: #F0FDF4;
    box-shadow: 0 4px 0 #95C5A1;
}

.bbc-vs {
    font-weight: 800;
    color: var(--maths-ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 1.1rem;
    padding: 0.35rem 0.85rem;
    background: var(--maths-surface);
    border: 1px solid var(--maths-border);
    border-radius: 999px;
}

.bbc-winner {
    background: #F0FDF4;
    border: 1px solid var(--maths-success);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
    text-align: center;
}

.bbc-winner[hidden] { display: none; }

.bbc-winner-label {
    font-weight: 700;
    color: #166534;
    text-transform: uppercase;
    font-size: 1rem;
    letter-spacing: 0.05em;
}

.bbc-winner-value {
    font-size: 1.7rem;
    font-weight: 800;
    color: #166534;
    margin-top: 0.2rem;
}

.bbc-winner-margin {
    color: #166534;
    font-weight: 600;
    margin-top: 0.15rem;
    font-size: 1.05rem;
}

.bbc-your-turn {
    background: #FFF7DE;
    border: 1px solid #F0C14B;
    border-radius: 12px;
    padding: 0.9rem 1.1rem;
    margin-top: 1rem;
}

.bbc-your-turn-label { font-weight: 800; color: #8a5a00; margin-bottom: 0.4rem; }
.bbc-your-turn-list { margin: 0; padding-left: 1.2rem; color: #5e3c00; font-weight: 600; }

body.display-mode .bbc-tag-price-input,
body.display-mode .bbc-tag-size-input,
body.display-mode .bbc-tag-unit-input,
body.display-mode #computeButton,
body.display-mode #resetButton {
    pointer-events: none;
}

@media (max-width: 640px) {
    .bbc-shelf { grid-template-columns: 1fr; }
    .bbc-vs { justify-self: center; }
}
