/* ============================================================
   Quantity Discount – Bundle & Save  v1.3.0
   ============================================================ */

/* ---- Contenedor ---- */
.qd-wrapper {
    margin: 16px 0 20px;
    font-family: inherit;
}

/* ---- Header con líneas ---- */
.qd-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.qd-header-line {
    flex: 1;
    height: 1px;
    background: #ccc;
}

.qd-header-text {
    font-weight: 800;
    font-size: 0.85rem;
    color: #222;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

/* ---- Filas ---- */
.qd-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ---- Fila individual ---- */
.qd-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s;
    user-select: none;
    overflow: visible;
}

.qd-row:hover {
    border-color: #999;
}

/* ---- Fila seleccionada ---- */
.qd-row--selected {
    border-color: #222;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

/* ---- Fila "Más popular" destacada ---- */
.qd-row--popular {
    border-color: #222;
    border-width: 2px;
    background: #fff;
}

.qd-row--popular.qd-row--selected {
    border-color: #222;
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
}

/* ---- Badge "Más popular" (esquina superior derecha, rotado) ---- */
.qd-popular-badge {
    position: absolute;
    top: -12px;
    right: 12px;
    background: #2ecc40;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    transform: rotate(-4deg);
    box-shadow: 0 2px 6px rgba(46,204,64,.35);
    z-index: 2;
    line-height: 1.3;
}

/* ---- Radio button custom ---- */
.qd-radio {
    flex: 0 0 22px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qd-radio input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 22px;
    height: 22px;
    margin: 0;
    cursor: pointer;
}

.qd-radio-circle {
    width: 22px;
    height: 22px;
    border: 2px solid #ccc;
    border-radius: 50%;
    background: #fff;
    transition: border-color .15s, background .15s;
    position: relative;
}

.qd-radio input[type="radio"]:checked + .qd-radio-circle {
    border-color: #222;
    background: #222;
}

.qd-radio input[type="radio"]:checked + .qd-radio-circle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

/* ---- Info (izquierda) ---- */
.qd-row-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.qd-row-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #222;
    line-height: 1.2;
}

.qd-row--popular .qd-row-title {
    font-size: 1.1rem;
}

.qd-row-subtitle {
    font-size: 0.8rem;
    color: #666;
    font-weight: 400;
}

.qd-row--selected .qd-row-subtitle {
    font-weight: 600;
}

/* Badge de etiqueta (label custom, ej: "envío gratis") */
.qd-row-label-badge {
    display: inline-block;
    margin-top: 2px;
    background: #d4f5d4;
    color: #1a7a1a;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 20px;
    text-transform: lowercase;
    letter-spacing: 0.02em;
    width: fit-content;
}

/* ---- Precios (derecha) ---- */
.qd-row-prices {
    flex: 0 0 auto;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
}

.qd-row-total {
    font-size: 1.2rem;
    font-weight: 800;
    color: #222;
    line-height: 1.2;
}

.qd-row-original {
    font-size: 0.8rem;
    color: #aaa;
    text-decoration: line-through;
    font-weight: 400;
}

/* ---- Nota ---- */
.qd-note {
    margin-top: 10px;
    font-size: 0.75rem;
    color: #999;
    margin-bottom: 0;
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
    .qd-row {
        padding: 10px 12px;
        gap: 10px;
    }

    .qd-row-title {
        font-size: 0.95rem;
    }

    .qd-row-total {
        font-size: 1.05rem;
    }

    .qd-popular-badge {
        font-size: 0.6rem;
        padding: 3px 8px;
        right: 8px;
    }
}
