/* ═══════════════════════════════════════════════════════════════
 *  WayAcross Accessories — Front-end styles
 * ═══════════════════════════════════════════════════════════════ */

.wa-acc-section {
    margin: 1.2rem 0;
    padding: 1rem 0 0;
    border-top: 1px solid #e5e5e5;
}

.wa-acc-title {
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #333;
    margin: 0 0 0.8rem;
}

/* ─── Item ────────────────────────────────────────────────────── */

.wa-acc-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.wa-acc-item {
    position: relative;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 0.6rem 0.8rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fafafa;
}

.wa-acc-item:hover {
    border-color: #ccc;
}

.wa-acc-item:has(.wa-acc-check:checked) {
    border-color: #2e7d32;
    background: #f1f8e9;
    box-shadow: 0 0 0 1px #2e7d32;
}

.wa-acc-item--oos {
    opacity: 0.5;
    pointer-events: none;
}

.wa-acc-item--hidden {
    display: none;
}

/* ─── Label (clickable area) ──────────────────────────────────── */

.wa-acc-label {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    cursor: pointer;
    margin: 0;
    width: 100%;
}

/* ─── Custom checkbox ─────────────────────────────────────────── */

.wa-acc-check {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.wa-acc-check-visual {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: 2px solid #bbb;
    border-radius: 4px;
    background: #fff;
    position: relative;
    transition: background 0.15s, border-color 0.15s;
}

.wa-acc-check:checked + .wa-acc-check-visual {
    background: #2e7d32;
    border-color: #2e7d32;
}

.wa-acc-check:checked + .wa-acc-check-visual::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 6px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.wa-acc-check:focus + .wa-acc-check-visual {
    box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.3);
}

/* ─── Image ───────────────────────────────────────────────────── */

.wa-acc-image {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #eee;
}

.wa-acc-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ─── Info (name + combination) ───────────────────────────────── */

.wa-acc-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.wa-acc-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wa-acc-combination {
    font-size: 0.78rem;
    padding: 0.2rem 0.4rem;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: #fff;
    max-width: 180px;
}

/* ─── Price ───────────────────────────────────────────────────── */

.wa-acc-price {
    flex-shrink: 0;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.1rem;
}

.wa-acc-price-old {
    font-size: 0.75rem;
    color: #999;
    text-decoration: line-through;
}

.wa-acc-price-final {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
}

.wa-acc-saving {
    font-size: 0.7rem;
    color: #2e7d32;
    font-weight: 500;
    background: #e8f5e9;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
}

/* ─── Out of stock ────────────────────────────────────────────── */

.wa-acc-oos-label {
    position: absolute;
    top: 50%;
    right: 0.8rem;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: #c62828;
    font-weight: 600;
    text-transform: uppercase;
}

/* ─── Show more ───────────────────────────────────────────────── */

.wa-acc-show-more {
    display: block;
    width: 100%;
    padding: 0.5rem;
    border: 1px dashed #ccc;
    border-radius: 6px;
    background: transparent;
    color: #666;
    font-size: 0.82rem;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s, color 0.15s;
}

.wa-acc-show-more:hover {
    background: #f5f5f5;
    color: #333;
}

/* ─── Total ───────────────────────────────────────────────────── */

.wa-acc-total {
    margin-top: 0.8rem;
    padding: 0.6rem 0.8rem;
    background: #f5f5f5;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wa-acc-total-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #555;
}

.wa-acc-total-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: #333;
}

/* ─── Feedback ────────────────────────────────────────────────── */

.wa-acc-feedback {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 0.8rem 1.2rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    z-index: 9999;
    animation: waAccSlideIn 0.3s ease;
}

.wa-acc-feedback--success {
    background: #2e7d32;
    color: #fff;
}

.wa-acc-feedback--error {
    background: #c62828;
    color: #fff;
}

@keyframes waAccSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── Responsive ──────────────────────────────────────────────── */

@media (max-width: 768px) {
    .wa-acc-label {
        flex-wrap: wrap;
    }

    .wa-acc-info {
        flex-basis: calc(100% - 80px);
    }

    .wa-acc-price {
        flex-basis: 100%;
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
        margin-top: 0.3rem;
        padding-left: 27px;
    }

    .wa-acc-name {
        white-space: normal;
    }
}
