/* =============================================================
   OG Accessory – ogaccessory.css
   ============================================================= */

/* ── Sección principal ── */
.ogaccessory-products {
    margin: 0rem 0;
    font-family: inherit;
    padding: 1.25rem 1rem;
    background: rgba(232, 0, 90, 0.1);
    border-radius: 10px;
    border: 1px solid #E5E7EB
}

.ogaccessory-title {
    color: #1C1C1C;
    margin-bottom: 1rem;
    font-weight: 500;
    font-style: Medium;
    font-size: 22px;
    line-height: 100%;
}

/* ── Lista ── */
.ogaccessory-list {
    display: flex;
    flex-direction: column;
    gap: .625rem;
}

/* ── Item ── */
.ogaccessory-item {
    display: flex;
    align-items: center;
    gap: .875rem;
    background: #fff;
    border: 2px solid #e8e8e8;
    border-radius: 14px;
    padding: .75rem 1rem;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.ogaccessory-item.is-selected {
    border-color: #e0005a;
    box-shadow: 0 0 0 1px rgba(224, 0, 90, .1);
}

/* ── Checkbox ── */
.ogaccessory-check-wrap { flex-shrink: 0; }

.ogaccessory-check-label {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin: 0;
}

.ogaccessory-check-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
}

.ogaccessory-check-icon {
    width: 20px;
    height: 20px;
    border-radius: 8px;
    border: 2px solid #d0d0d0;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .18s, border-color .18s;
    color: transparent;
    flex-shrink: 0;
}

.ogaccessory-check-label input:checked ~ .ogaccessory-check-icon {
    background: #e0005a;
    border-color: #e0005a;
    color: #fff;
}

.ogaccessory-check-icon svg { width: 14px; height: 14px; }

/* ── Imagen ── */
.ogaccessory-img-link {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    width: 64px;
    height: 64px;
    min-width: 64px; 
    border-radius: 10px;
    overflow: hidden;
}

.ogaccessory-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    display: block;
}

.ogaccessory-img-placeholder {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ogaccessory-img-placeholder svg {
    width: 28px;
    height: 28px;
    color: #bbb;
}

/* ── Info ── */
.ogaccessory-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .1rem;
}

.ogaccessory-name {
    font-size: 1.1rem!important;
    color: #222 !important;
    text-decoration: none;
    white-space: normal;
    text-overflow: ellipsis;
    line-height: 1.3;
    display: block;
}

.ogaccessory-name:hover { color: #e0005a !important; text-decoration: none; }

.ogaccessory-quantity-label {
    font-size: .78rem;
    color: #888;
    display: block;
}

.ogaccessory-price {
    font-size: .95rem;
    font-weight: 700;
    color: #222;
    display: block;
    margin-top: .15rem;
}

.ogaccessory-item.is-selected .ogaccessory-price {
    color: #e0005a;
}

/* ── Botón unitario ── */
.ogaccessory-btn-single {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    min-width: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: transparent;
    border: 2px solid #e0005a;
    color: #e0005a;
    cursor: pointer;
    position: relative;
    outline: none;
    transition: background .18s, color .18s, border-color .18s, transform .15s;
}

.ogaccessory-btn-single:hover {
    background: #e0005a;
    color: #fff;
    transform: scale(1.08);
}

.ogaccessory-btn-single:focus-visible {
    outline: 2px solid #e0005a;
    outline-offset: 2px;
}

/* Loading */
.ogaccessory-btn-single.is-loading {
    color: transparent;
    pointer-events: none;
}

.ogaccessory-btn-single.is-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid #e0005a;
    border-top-color: transparent;
    border-radius: 50%;
    animation: oga-spin .6s linear infinite;
}

/* Éxito */
.ogaccessory-btn-single.is-added {
    background: #28a745;
    border-color: #28a745;
    color: #fff;
}

.ogaccessory-btn-single.is-added::after { display: none; }

/* Error */
.ogaccessory-btn-single.is-error {
    background: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

.ogaccessory-btn-single.is-error::after { display: none; }

@keyframes oga-spin { to { transform: rotate(360deg); } }

/* ── Footer ── */
.ogaccessory-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    gap: 1rem;
    padding: .875rem 0 0;
    border-top: 1px solid #eee;
    flex-wrap: wrap;
}

.ogaccessory-footer-summary {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: .3rem;
    font-size: .95rem;
    color: #555;
}

.ogaccessory-selected-count {
    font-size: 1rem;
    font-weight: 700;
    color: #333;
}

.ogaccessory-selected-word {
    font-size: .9rem;
    color: #666;
}

.ogaccessory-total-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: #e0005a;
    display: block;
    width: 100%;
    margin-top: .1rem;
    min-height: 1.5rem;  /* reserva espacio para evitar salto de layout */
}

/* ── Botón masivo ── */
.ogaccessory-btn-bulk {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: #e0005a;
    border: none;
    color: #fff;
    font-weight: 700;
    font-size: .82rem;
    letter-spacing: .04em;
    padding: .75rem 1.4rem;
    border-radius: 8px;
    white-space: nowrap;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .18s, opacity .18s, transform .15s;
}

.ogaccessory-btn-bulk:hover:not(:disabled) {
    opacity: .88;
    transform: translateY(-1px);
    color: #fff;
}

.ogaccessory-btn-bulk:focus-visible {
    outline: 2px solid #e0005a;
    outline-offset: 2px;
}

.ogaccessory-btn-bulk:disabled {
    opacity: .4;
    cursor: not-allowed;
    transform: none;
}

.ogaccessory-btn-bulk.is-added  { background: #28a745; }
.ogaccessory-btn-bulk.is-error  { background: #dc3545; }

/* Spinner dentro del botón masivo */
.oga-bulk-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,.5);
    border-top-color: #fff;
    border-radius: 50%;
    animation: oga-spin .6s linear infinite;
    flex-shrink: 0;
}

/* ── Toast ── */
.ogaccessory-toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(calc(100% + 2rem));
    z-index: 9999;
    padding: .75rem 1.5rem;
    border-radius: 8px;
    font-size: .9rem;
    font-weight: 600;
    color: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,.18);
    pointer-events: none;
    white-space: nowrap;
    transition: transform .3s cubic-bezier(.34,1.56,.64,1), opacity .3s ease;
    opacity: 0;
}

.ogaccessory-toast--success { background: #28a745; }
.ogaccessory-toast--error   { background: #dc3545; }

.ogaccessory-toast--visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ── Responsive ── */
@media (max-width: 576px) {
    .ogaccessory-products {
        padding: 1rem .75rem;
        border-radius: 10px;
    }

    .ogaccessory-item {
        gap: .5rem;
        padding: .6rem .75rem;
        border-radius: 12px;
    }

    .ogaccessory-img-link {
        width: 52px;
        height: 52px;
        min-width: 52px;
    }

    .ogaccessory-img { width: 48px; height: 48px; }

    .ogaccessory-name  { font-size: .82rem; }
    .ogaccessory-price { font-size: .88rem; }

    .ogaccessory-btn-single {
        width: 36px;
        height: 36px;
        min-width: 36px;
    }

    .ogaccessory-btn-single svg { width: 15px; height: 15px; }

    .ogaccessory-footer {
        flex-direction: column;
        align-items: stretch;
        gap: .75rem;
    }

    .ogaccessory-footer-summary { justify-content: flex-start; }

    .ogaccessory-btn-bulk {
        width: 100%;
        justify-content: center;
        padding: .85rem 1rem;
        font-size: .85rem;
    }

    .ogaccessory-toast {
        font-size: .82rem;
        padding: .65rem 1.25rem;
        max-width: 90vw;
        white-space: normal;
        text-align: center;
    }
}
