/* capo-frontend.css — Add-On Panel Styles */

/* ── Panel wrapper ──────────────────────────────────────────────────────────── */
.capo-addon-panel {
    /* margin: 1.5em 0; */
    padding: 1.25em 1.5em;
    border: 1px solid #e2e2e2;
    border-radius: 6px;
    background: #fafafa;
    clear: both;
}

.capo-addon-panel__title {
    margin: 0 0 1em;
    font-size: 1em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #333;
}

/* ── Item list ──────────────────────────────────────────────────────────────── */
.capo-addon-items {
    display: flex;
    flex-direction: column;
    gap: .75em;
}

/* ── Individual item ────────────────────────────────────────────────────────── */
.capo-addon-item {
    display: flex;
    align-items: center;
    gap: .9em;
    padding: .75em 1em;
    border: 1px solid #e2e2e2;
    border-radius: 5px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, background .15s;
    user-select: none;
}

.capo-addon-item:hover {
    border-color: #bbb;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.capo-addon-item.is-checked {
    border-color: var(--wp--preset--color--primary, #0071a1);
    background: #f0f7ff;
    box-shadow: 0 0 0 2px rgba(0, 113, 161, .15);
}

/* ── Hidden native checkbox ─────────────────────────────────────────────────── */
.capo-addon-item__checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* ── Custom checkbox icon ───────────────────────────────────────────────────── */
.capo-addon-item__check-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 2px solid #ccc;
    border-radius: 4px;
    background: #fff;
    color: transparent;
    transition: border-color .15s, background .15s, color .15s;
}

.capo-addon-item__check-icon svg {
    width: 13px;
    height: 13px;
}

.capo-addon-item.is-checked .capo-addon-item__check-icon {
    border-color: var(--wp--preset--color--primary, #0071a1);
    background: var(--wp--preset--color--primary, #0071a1);
    color: #fff;
}

/* ── Thumbnail ──────────────────────────────────────────────────────────────── */
.capo-addon-item__image {
    flex-shrink: 0;
}

.capo-addon-item__image img {
    display: block;
    width: 54px;
    height: 54px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #eee;
}

/* ── Info block ─────────────────────────────────────────────────────────────── */
.capo-addon-item__info {
    display: flex;
    flex-direction: column;
    gap: .2em;
    flex: 1;
    min-width: 0;
}

.capo-addon-item__name {
    font-weight: 600;
    font-size: .95em;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.capo-addon-item__desc {
    font-size: .82em;
    color: #666;
    line-height: 1.3;
}

.capo-addon-item__price {
    font-size: .9em;
    font-weight: 600;
    color: var(--wp--preset--color--primary, #0071a1);
    margin-top: .1em;
}

.capo-addon-item__price .woocommerce-Price-amount {
    font-size: inherit;
}

/* ── Footer bar ─────────────────────────────────────────────────────────────── */
.capo-addon-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1em;
    margin-top: 1em;
    padding-top: 1em;
    border-top: 1px solid #e2e2e2;
    flex-wrap: wrap;
}

.capo-addon-footer__summary {
    font-size: .9em;
    color: #555;
}

.capo-addon-footer__btn {
    flex-shrink: 0;
}

.capo-addon-footer__btn:disabled {
    opacity: .7;
    cursor: not-allowed;
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media ( max-width: 600px ) {
    .capo-addon-item__image img {
        width: 42px;
        height: 42px;
    }

    .capo-addon-panel {
        padding: 1em;
    }

    .capo-addon-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .capo-addon-footer__btn {
        width: 100%;
        text-align: center;
    }
}
