/* ============================================================
   WC Checkbox Add-ons — Frontend Styles
   ============================================================ */

.wcca-addons-wrapper {
    margin: 16px 0 20px;
    padding: 18px 20px;
    border: 1px solid #e2e4e7;
    border-radius: 6px;
    background: #fafbfc;
}

/* Section title */
.wcca-section-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.wcca-required {
    color: #b32d2e;
    font-size: 14px;
}

/* Description */
.wcca-section-description {
    font-size: 13px;
    color: #6c757d;
    margin: 0 0 14px;
}

/* Options list */
.wcca-options-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wcca-option-item {
    margin: 0;
}

.wcca-option-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
    transition: color .15s;
}

.wcca-option-label:hover {
    color: #2271b1;
}

/* Custom checkbox style */
.wcca-checkbox {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #8c8f94;
    border-radius: 3px;
    background: #fff;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color .15s, background .15s;
    position: relative;
}

.wcca-checkbox:hover {
    border-color: #2271b1;
}

.wcca-checkbox:checked {
    background: #2271b1;
    border-color: #2271b1;
}

.wcca-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 0;
    width: 6px;
    height: 10px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

/* Option text */
.wcca-option-text {
    flex: 1;
}

/* Price badge */
.wcca-option-price {
    font-size: 12px;
    font-weight: 600;
    color: #2271b1;
    background: #e8f0fe;
    padding: 2px 7px;
    border-radius: 12px;
    white-space: nowrap;
}

/* Validation message */
.wcca-validation-msg {
    color: #b32d2e;
    font-size: 13px;
    margin-top: 10px;
    padding: 8px 12px;
    background: #fff2f2;
    border-left: 3px solid #b32d2e;
    border-radius: 2px;
}

/* Responsive */
@media (max-width: 480px) {
    .wcca-addons-wrapper {
        padding: 14px 14px;
    }

    .wcca-option-price {
        display: block;
        margin-top: 2px;
    }
}

/* ============================================================
   Price Breakdown Panel
   Shown/hidden by toggling wcca-breakdown-visible / hidden classes.
   Uses max-height + opacity transition (no display:none so animation works).
   ============================================================ */

#wcca-price-breakdown {
    margin-top: 0;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #d0d5dd;
    background: #fff;
    font-size: 14px;
    line-height: 1.5;

    /* Default state: hidden */
    max-height: 0;
    opacity: 0;
    border-width: 0;
    margin-top: 0;
    pointer-events: none;
    transition: max-height .28s ease, opacity .22s ease, margin-top .22s ease, border-width .22s ease;
}

#wcca-price-breakdown.wcca-breakdown-visible {
    max-height: 400px;   /* large enough for any realistic number of rows */
    opacity: 1;
    border-width: 1px;
    margin-top: 14px;
    pointer-events: auto;
}

#wcca-price-breakdown.wcca-breakdown-hidden {
    max-height: 0;
    opacity: 0;
    border-width: 0;
    margin-top: 0;
    pointer-events: none;
}

/* Each row inside the panel */
.wcca-bd-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 14px;
}

.wcca-bd-row + .wcca-bd-row {
    border-top: 1px solid #f2f4f7;
}

/* Product price row */
.wcca-bd-product {
    background: #f9fafb;
}

.wcca-bd-product .wcca-bd-label {
    color: #6c757d;
    font-size: 13px;
}

.wcca-bd-product .wcca-bd-value {
    color: #374151;
    font-weight: 500;
}

/* Add-on rows */
.wcca-bd-addon .wcca-bd-label {
    color: #374151;
}

.wcca-bd-addon-price {
    color: #2271b1;
    font-weight: 600;
}

/* Divider before total */
.wcca-bd-divider {
    height: 2px;
    background: linear-gradient(90deg, #e5e7eb 0%, #d1d5db 100%);
}

/* Total row */
.wcca-bd-total {
    background: #f0f7ff;
    padding: 11px 14px;
}

.wcca-bd-total .wcca-bd-label {
    font-weight: 700;
    font-size: 13px;
    color: #1a1a2e;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.wcca-bd-total-price {
    font-size: 20px;
    font-weight: 800;
    color: #2271b1;
}

/* Responsive */
@media (max-width: 480px) {
    .wcca-bd-row {
        padding: 8px 12px;
    }
    .wcca-bd-total-price {
        font-size: 17px;
    }
}

/* ============================================================
   Cart / Checkout — per-addon breakdown rows
   These appear inside WooCommerce's .wc-item-meta list
   ============================================================ */

/* "Base price" row — muted, smaller */
.woocommerce-cart .wc-item-meta .wc-item-meta-label,
.woocommerce-checkout .wc-item-meta .wc-item-meta-label {
    font-weight: 500;
}

/* Free badge on no-cost add-ons */
.wcca-bd-free {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #00a32a;
    background: #e6f7ec;
    padding: 1px 7px;
    border-radius: 10px;
}

/* Item total row — bold both sides */
.wc-item-meta li:last-child .wc-item-meta-label,
.wc-item-meta li:last-child p {
    /* WooCommerce wraps value in <p> */
}
