/* Product page "Available Offers" (inc/product-offers.php) */

.bc-po {
    --bc-po-primary: #254343;
    --bc-po-gold: #E5AF4D;
    --bc-po-border: #ecc982;
    --bc-po-head: #fbf1dc;
    --bc-po-line: #f1e6cf;
    --bc-po-muted: #6b7280;

    container-type: inline-size;
    position: relative;
    margin: 4px 0 8px;
    background: #fff;
    border: 1px solid var(--bc-po-border);
    border-radius: 14px;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    color: var(--bc-po-primary);
}

/* Header band */
.bc-po__head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bc-po-head);
}

.bc-po__head-icon {
    display: flex;
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    color: var(--bc-po-gold);
}

.bc-po svg {
    width: 100%;
    height: 100%;
}

.bc-po__title {
    flex: 1 1 auto;
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--bc-po-primary);
}

.bc-po__total {
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 600;
    color: var(--bc-po-primary);
    opacity: 0.85;
}

/* Offer rows */
.bc-po__list {
    margin: 0;
    padding: 0 16px;
    list-style: none;
}

.bc-po__item {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0;
    padding: 14px 0;
    border-top: 1px solid var(--bc-po-line);
}

.bc-po__list > .bc-po__item:first-child {
    border-top: 0;
}

.bc-po.is-collapsed .bc-po__item.is-extra {
    display: none;
}

.bc-po__icon {
    display: flex;
    flex: 0 0 auto;
    width: 40px;
    height: 30px;
    color: var(--bc-po-gold);
}

.bc-po__text {
    flex: 1 1 auto;
    min-width: 0;
}

.bc-po__offer {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--bc-po-primary);
    /* A long coupon description never takes more than two lines. */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.bc-po__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 10px;
    margin-top: 3px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--bc-po-muted);
}

.bc-po__use--code {
    display: none;
}

.bc-po__use b {
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--bc-po-primary);
}

.bc-po__fact::before {
    content: '·';
    margin-right: 8px;
}

/* Code + Copy */
.bc-po__actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
}

.bc-po__code {
    padding: 7px 12px;
    background: #fff;
    border: 1.5px dashed #b8b8b8;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.2;
    color: var(--bc-po-primary);
    white-space: nowrap;
    user-select: all;
}

.bc-po__copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    padding: 8px 16px;
    background: var(--bc-po-primary);
    border: 0;
    border-radius: 7px;
    font: 600 14px/1.2 'Inter', sans-serif;
    color: #fff;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.2s;
}

.bc-po__copy:hover,
.bc-po__copy:focus-visible {
    background: #1a2f2f;
}

.bc-po__copied-label,
.bc-po__copy.is-copied .bc-po__copy-label {
    display: none;
}

.bc-po__copy.is-copied .bc-po__copied-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.bc-po__copied-label svg {
    width: 14px;
    height: 14px;
}

.bc-po__copy.is-copied {
    background: #15803d;
}

/* "+ N more offers" */
.bc-po__toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    width: calc(100% - 32px);
    margin: 0 16px;
    padding: 10px 0 12px;
    background: none;
    border: 0;
    border-top: 1px solid var(--bc-po-line);
    font: 600 14px/1.2 'Inter', sans-serif;
    color: var(--bc-po-primary);
    text-align: left;
    cursor: pointer;
}

/* Focus ring for keyboard users only, not after a mouse click. */
.bc-po__toggle:focus,
.bc-po__copy:focus {
    outline: none;
}

.bc-po__toggle:focus-visible,
.bc-po__copy:focus-visible {
    outline: 2px solid var(--bc-po-gold);
    outline-offset: 2px;
}

.bc-po__toggle[hidden] {
    display: none;
}

.bc-po__toggle:hover > span {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.bc-po__toggle svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s;
}

.bc-po__toggle-less,
.bc-po:not(.is-collapsed) .bc-po__toggle-more {
    display: none;
}

.bc-po:not(.is-collapsed) .bc-po__toggle-less {
    display: inline;
}

.bc-po:not(.is-collapsed) .bc-po__toggle svg {
    transform: rotate(180deg);
}

.bc-po__status {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

/* Narrow box (phones, narrow columns): code moves into the text, Copy stays. */
@container (max-width: 520px) {
    .bc-po__head {
        padding: 11px 14px;
    }

    .bc-po__title {
        font-size: 17px;
    }

    .bc-po__list {
        padding: 0 14px;
    }

    .bc-po__item {
        gap: 12px;
    }

    .bc-po__icon {
        width: 34px;
        height: 26px;
    }

    .bc-po__offer {
        font-size: 14.5px;
    }

    .bc-po__use--code {
        display: inline;
    }

    .bc-po__use--hint,
    .bc-po__code {
        display: none;
    }

    .bc-po__toggle {
        width: calc(100% - 28px);
        margin: 0 14px;
    }
}
