/* === Mi cuenta — Cambios y devoluciones (Webkul_MpRmaSystem) ===
 * customer/allrma.phtml + allrma-list.phtml (listado) y customer/rma.phtml (detalle).
 * Port de los componentes PWA YBRma / YBRmaRow con sus mismos colores:
 * #00295a botones, #363b4f texto, #344079 títulos de columna, #1979c3 enlaces. */

.elg-ybrma { max-width: 800px; }
/* Invitado (1column, sin menú lateral de Mi cuenta): listado y detalle centrados */
.mprmasystem-guest-allrma .elg-ybrma,
.mprmasystem-guest-rma .elg-ybrma { margin-left: auto; margin-right: auto; }

/* Bloques informativos (solo mobile, como en el PWA) */
.elg-ybrma-info { margin-bottom: 40px; }
.elg-ybrma-info p,
.elg-ybrma-info span {
    font-weight: 300;
    line-height: normal;
    color: #363b4f;
    font-size: 1rem;
}
.elg-ybrma-info p { margin-bottom: 1rem; }
.elg-ybrma-advice {
    text-align: center;
    width: 80%;
    margin: 0 auto 20px;
}
.elg-ybrma-advice strong,
.elg-ybrma-info b { font-weight: 600; }
.elg-ybrma-block { margin-bottom: 20px; }
.elg-ybrma-block-title {
    display: block;
    margin-bottom: 0.5rem;
}
.elg-ybrma-link {
    display: inline-block;
    font-weight: 600;
    color: #363b4f;
    text-decoration: underline;
    margin: 20px 0 0;
    cursor: pointer;
    background: none;
    border: 0;
    padding: 0;
    font-size: 1rem;
}

/* Botón "Solicitar cambio o devolución" (solo desktop) */
.elg-ybrma-new {
    display: none;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 50px;
    background-color: #00295a;
    color: #fff;
    font-size: 1.25rem;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
}
.elg-ybrma-new:hover { color: #fff; opacity: 0.9; }

/* En mobile el listado se despliega con "Ver mis cambios/devoluciones" */
.elg-ybrma-list-wrap { display: none; }
.elg-ybrma-list-wrap.is-open { display: block; }

@media (min-width: 768px) {
    .elg-ybrma-info { display: none; }
    .elg-ybrma-new { display: flex; }
    .elg-ybrma-list-wrap { display: block; }
}

/* Fila de RMA (YBRmaRow) */
.elg-ybrma-list { margin-top: 10px; }
.elg-ybrma-row {
    display: flex;
    min-height: 130px;
    width: 100%;
    margin: 5px 0 15px;
    border-bottom: 1px solid #ccc;
}
.elg-ybrma-row-image {
    flex: 0 0 120px;
    width: 120px;
    height: 124px;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.elg-ybrma-row-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.elg-ybrma-row-placeholder {
    width: 95%;
    height: auto;
    color: #0f233f;
    opacity: 0.35;
}
.elg-ybrma-slider {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.elg-ybrma-slider-prev,
.elg-ybrma-slider-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: 0;
    padding: 0 4px;
    font-size: 1.25rem;
    line-height: 1;
    color: #0f233f;
    cursor: pointer;
}
.elg-ybrma-slider-prev { left: 0; }
.elg-ybrma-slider-next { right: 0; }
.elg-ybrma-row-info {
    font-size: 0.875rem;
    color: #223041;
    line-height: 18px;
    margin: auto 0;
}
.elg-ybrma-bold {
    font-weight: bold;
    color: #000;
}
.elg-ybrma-link-label {
    color: #1979c3;
    cursor: pointer;
    text-decoration: none;
}
.elg-ybrma-link-label:hover { text-decoration: underline; }
.elg-ybrma-empty {
    margin-top: 50px;
    text-align: center;
    font-size: 0.875rem;
    color: #00295a;
}

/* Detalle (YBRma::renderRmaSeleccionado) */
.elg-ybrma-generado {
    text-align: center;
    font-size: 1rem;
    text-transform: uppercase;
    color: green;
    margin-bottom: 1rem;
}
.elg-ybrma-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.875rem;
    min-height: 30px;
    margin-top: 20px;
    border-bottom: 1px solid #ccc;
}
.elg-ybrma-section-title { font-size: 1.25rem; }
.elg-ybrma-section-date {
    line-height: 30px;
    white-space: nowrap;
}
.elg-ybrma-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding-top: 20px;
}
.elg-ybrma-col-title {
    color: #344079;
    width: 80%;
    border-bottom: 1px solid #ccc;
    font-weight: bold;
    line-height: 20px;
}
.elg-ybrma-col-content {
    font-size: 0.8125rem;
    margin-bottom: 14px;
    word-break: break-word;
}
@media (min-width: 768px) {
    .elg-ybrma-col-title { width: 95%; margin: 0 2.5% 14px; }
    .elg-ybrma-col-content { width: 95%; margin: 0 2.5% 14px; }
}
.elg-ybrma-label {
    font-style: italic;
    font-weight: bold;
}

/* Artículos */
.elg-ybrma-items { padding-top: 20px; }
.elg-ybrma-items-row {
    display: flex;
    width: 100%;
    font-size: 0.875rem;
    padding: 2px 0;
}
.elg-ybrma-items-head { font-weight: bold; }
.elg-ybrma-items-wide {
    width: 35%;
    text-align: left;
    padding-right: 0.5rem;
}
.elg-ybrma-items-narrow {
    width: 10%;
    text-align: right;
}

/* Pago requerido (status 5) */
.elg-ybrma-payment { padding-top: 15px; }
.elg-ybrma-payment-title { margin-bottom: 0.5rem; }
.elg-ybrma-required { color: red; }
.elg-ybrma-payment-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.75rem 0;
    cursor: pointer;
}
.elg-ybrma-payment-option img { max-width: 80px; }
.elg-ybrma-error { color: red; }
.elg-ybrma-payment-actions {
    width: 100%;
    text-align: center;
    margin: 15px 0;
}
.elg-ybrma-pay {
    height: 40px;
    background-color: #00295a;
    color: #fff;
    font-size: 1.125rem;
    padding: 0 5%;
    cursor: pointer;
    border: 0;
}

/* Enlaces "Atrás" / "Cerrar sesión" (back-link del PWA) */
.elg-ybrma-back {
    text-align: right;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}
.elg-ybrma-back a {
    color: #363b4f;
    text-decoration: none;
    cursor: pointer;
}
.elg-ybrma-back a:hover { text-decoration: underline; }
.elg-ybrma-back--guest {
    max-width: 800px;
    margin: 15px auto 0;
}

/* === Nueva RMA (YBNewRma + YBNewRmaRow + YBNewRmaDirRecogida) === */
.elg-ybnewrma {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 10px 2rem;
    color: #363b4f;
}
@media (min-width: 768px) {
    .elg-ybnewrma { padding: 0 20px 2rem; }
}
.elg-ybnewrma-heading {
    padding-top: 5px;
    margin-bottom: 1.5rem;
    text-align: center;
    color: #0d233f;
    font-weight: 400;
    font-size: 1.5rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}
@media (min-width: 768px) {
    .elg-ybnewrma-heading {
        font-weight: 300;
        font-size: 1.875rem;
        line-height: 1.2;
        letter-spacing: 5px;
    }
}
.elg-ybnewrma-field { margin-bottom: 0.5rem; }
.elg-ybnewrma-field--resolution { margin-top: 15px; }
.elg-ybnewrma-label,
.elg-ybnewrma-title {
    display: block;
    font-size: 0.875rem;
    color: #344079;
    font-weight: 700;
    margin-bottom: 5px;
}
.elg-ybnewrma-required { color: red; }
.elg-ybnewrma-select {
    width: 80%;
    height: 40px;
    padding: 0 40px 0 15px;
    border: 1px solid #ccc;
    background-color: #fff;
    font-size: 0.875rem;
    color: #363b4f;
}
.elg-ybnewrma-select:disabled { background-color: #f3f3f3; color: #777; }
@media (min-width: 768px) {
    .elg-ybnewrma-select { width: 100%; }
}
.elg-ybnewrma-select--small {
    display: block;
    width: 100%;
    height: 30px;
    padding: 0 30px 0 15px;
    margin: 5px 0 10px;
}
.elg-ybnewrma-alert {
    margin-top: 15px;
    padding-left: 18px;
    color: red;
    text-align: center;
    font-size: 0.875rem;
}
.elg-ybnewrma-section {
    margin-top: 20px;
    width: 100%;
}
.elg-ybnewrma-textarea {
    width: 100%;
    height: 100px;
    border: 1px solid #ccc;
    padding: 0.5rem;
    font-size: 0.875rem;
}
.elg-ybnewrma-payment { margin-top: 15px; font-size: 0.875rem; }
.elg-ybnewrma-payment .elg-ybrma-payment-option img { height: 40px; width: auto; max-width: none; }

.elg-ybnewrma-loading {
    display: flex;
    justify-content: center;
    padding: 1rem 0;
}
.elg-ybnewrma-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #d6dbe6;
    border-top-color: #00295a;
    border-radius: 50%;
    animation: elg-ybnewrma-spin 0.8s linear infinite;
}
@keyframes elg-ybnewrma-spin { to { transform: rotate(360deg); } }

/* Fila de artículo (YBNewRmaRow) */
.elg-ybnewrma-row {
    display: flex;
    width: 100%;
    margin: 10px 0 15px;
}
@media (min-width: 768px) {
    .elg-ybnewrma-row { justify-content: center; }
}
.elg-ybnewrma-row-check {
    width: 10%;
    margin: auto 0;
    padding-left: 10px;
}
.elg-ybnewrma-row-check input { width: 18px; height: 18px; cursor: pointer; }
.elg-ybnewrma-row-check input:disabled { cursor: not-allowed; }
.elg-ybnewrma-row-desc {
    width: 90%;
    display: flex;
}
.elg-ybnewrma-row-image {
    flex: 0 0 100px;
    width: 100px;
    cursor: pointer;
}
@media (min-width: 768px) {
    .elg-ybnewrma-row-image { flex-basis: 150px; width: 150px; }
}
.elg-ybnewrma-row-image img { width: 100%; height: auto; }
.elg-ybnewrma-row-data {
    width: calc(100% - 110px);
    margin-left: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-size: 0.875rem;
}
.elg-ybnewrma-row-data p { margin-bottom: 3px; }
.elg-ybnewrma-row-name {
    color: #344079;
    font-weight: 700;
}
.elg-ybnewrma-row-attrs { margin-bottom: 3px; }
.elg-ybnewrma-row-attrs dl,
.elg-ybnewrma-row-attrs dt,
.elg-ybnewrma-row-attrs dd { display: inline; margin: 0; }
.elg-ybnewrma-row-attrs dt { font-weight: 700; }
.elg-ybnewrma-row-attrs dt::after { content: ': '; }
.elg-ybnewrma-row-attrs dd { margin-right: 10px; }
.elg-ybnewrma-row-sku { margin-right: 10px; }
.elg-ybnewrma-row-error {
    color: red;
    font-size: 0.8125rem;
    margin: -6px 0 8px;
}
.elg-ybnewrma-no-change {
    color: red;
    font-size: 0.875rem;
    margin-top: 20px;
    text-transform: uppercase;
}

/* Dirección de recogida (YBNewRmaDirRecogida): label 30% / campo 70% */
.elg-ybnewrma-address { padding: 0 5px; }
.elg-ybnewrma-address-field {
    display: flex;
    align-items: center;
    width: 100%;
    margin-bottom: 10px;
}
.elg-ybnewrma-address-field label {
    width: 30%;
    color: #333;
    font-size: 0.875rem;
    padding-right: 0.5rem;
}
.elg-ybnewrma-address-field input,
.elg-ybnewrma-address-field select {
    width: 70%;
    height: 30px;
    padding: 0 15px;
    border: 1px solid #ccc;
    background-color: #fff;
    font-size: 0.875rem;
}
@media (min-width: 768px) {
    .elg-ybnewrma-address-field label { width: 20%; }
    .elg-ybnewrma-address-field input,
    .elg-ybnewrma-address-field select { width: 80%; }
}
.elg-ybnewrma-msg {
    margin-top: 20px;
    line-height: 18px;
    color: red;
    font-size: 0.875rem;
}
.elg-ybnewrma-submit {
    width: 100%;
    margin: 20px 0 50px;
    height: 50px;
    background-color: #00295a;
    color: #fff;
    font-size: 1.0625rem;
    font-weight: 300;
    text-transform: uppercase;
    cursor: pointer;
    border: 0;
}
.elg-ybnewrma-submit:disabled { opacity: 0.6; cursor: wait; }

/* === Login de invitado (YBGuestRmaLogin) === */
.elg-ybguestrma { padding: 20px 0 2rem; }
.elg-ybguestrma-form {
    margin: 40px auto;
    max-width: 550px;
    width: 90%;
}
.elg-ybguestrma-field label {
    display: block;
    color: #00295a;
    font-weight: 700;
    font-size: 0.875rem;
}
.elg-ybguestrma-field input {
    width: 100%;
    padding: 10px;
    font-size: 1rem;
    margin-bottom: 15px;
    border: 1px solid #ccc;
}
.elg-ybguestrma-submit {
    margin-top: 15px;
    background-color: #00295a;
    height: 50px;
    color: #fff;
    text-transform: uppercase;
    text-align: center;
    font-size: 1.125rem;
    font-weight: 300;
    width: 100%;
    border: 0;
    cursor: pointer;
}
