/* === Cards de producto en móvil (<1024px) y en la app (cualquier ancho) ===
   En vez de las tallas sobre la imagen (.elg-pcard-quick-add, 04-pdp.css), un "+" a la derecha del nombre que abre
   el panel de tallas y colores (.elg-pcard-sheet, Magento_Catalog::product/list/item-js.phtml). Los colores de la
   derecha del nombre pasan bajo el precio: el color actual y cuántos más hay. En la web de escritorio no cambia nada. */

.elg-pcard-plus,
.elg-pcard-colors-mini { display: none; }

.elg-pcard-plus {
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    margin-right: -0.25rem;
    padding: 0;
    background: transparent;
    border: 0;
    color: #041D40;
    cursor: pointer;
}
.elg-pcard-plus svg { width: 1.125rem; height: 1.125rem; }

.elg-pcard-colors-mini {
    align-items: center;
    gap: 0.5rem;
    /* Misma altura cerrado y abierto: cuadrito de 1rem + el hueco del contorno del seleccionado (3px arriba y abajo) */
    height: calc(1rem + 6px);
    margin-top: 0.375rem;
}
.elg-pcard-colors-mini-toggle,
.elg-pcard-colors-mini-close {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0 0 0 3px; /* el cuadrito, alineado con el primero de la lista abierta */
    background: transparent;
    border: 0;
    font-size: 0.6875rem;
    line-height: 1;
    color: rgba(4, 29, 64, 0.7);
    cursor: pointer;
}
.elg-pcard-colors-mini-close {
    flex-shrink: 0;
    padding: 0 0.25rem;
    font-size: 0.875rem;
}
/* Abierto: todos los colores en la misma línea; si no caben, scroll lateral (no tapa la card de abajo) */
.elg-pcard-colors-mini-list {
    display: flex;
    flex: 0 1 auto;
    min-width: 0;
    gap: 0.625rem;
    overflow-x: auto;
    padding: 3px; /* que se vea el contorno del seleccionado */
    scrollbar-width: none;
}
.elg-pcard-colors-mini-list::-webkit-scrollbar { display: none; }
.elg-pcard-colors-mini-list .elg-pcard-color {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
}
.elg-pcard-colors-mini-swatch {
    /* Mismo tamaño que los colores desplegados */
    width: 1rem;
    height: 1rem;
    border: 1px solid rgba(4, 29, 64, 0.2);
    flex-shrink: 0;
}

@media (max-width: 1023px) {
    .elg-pcard-quick-add,
    .elg-pcard-name-row .elg-pcard-colors { display: none !important; }
    .elg-pcard-plus,
    .elg-pcard-colors-mini { display: flex; }
}
html.is-app .elg-pcard-quick-add,
html.is-app .elg-pcard-name-row .elg-pcard-colors { display: none !important; }
html.is-app .elg-pcard-plus,
html.is-app .elg-pcard-colors-mini { display: flex; }

/* --- Panel desde abajo (<dialog> modal: queda por encima de la barra de la app y del carrito) --- */
.elg-pcard-sheet {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #041D40;
}
.elg-pcard-sheet[open] {
    display: flex;
    align-items: flex-end;
}
.elg-pcard-sheet::backdrop { background: rgba(4, 29, 64, 0.35); }

.elg-pcard-sheet-panel {
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    background: var(--color-bg, #fff);
    padding: 1.25rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
    text-align: center;
    animation: elg-pcard-sheet-up 0.25s ease-out;
}
@keyframes elg-pcard-sheet-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.elg-pcard-sheet-head {
    position: relative;
    padding: 0 2rem;
}
.elg-pcard-sheet-title {
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    line-height: 1.3;
}
.elg-pcard-sheet-close {
    position: absolute;
    top: 50%;
    right: -0.25rem;
    transform: translateY(-50%);
    display: inline-flex;
    width: 2rem;
    height: 2rem;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: transparent;
    border: 0;
    color: #041D40;
    cursor: pointer;
}
.elg-pcard-sheet-close svg { width: 1.5rem; height: 1.5rem; }

.elg-pcard-sheet-group { margin-top: 1.25rem; }
.elg-pcard-sheet-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin-bottom: 0.75rem;
}

.elg-pcard-sheet-sizes {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem 0.5rem;
}
.elg-pcard-sheet-size {
    min-width: 2.75rem;
    padding: 0.375rem 0.5rem;
    background: transparent;
    border: 0;
    border-bottom: 1px solid transparent;
    font-size: 0.875rem;
    font-weight: 500;
    color: #041D40;
    cursor: pointer;
    position: relative;
}
.elg-pcard-sheet-size.is-selected { border-bottom-color: #041D40; }
/* Últimas unidades (azul) y preventa (rojo): punto debajo de la talla, como en las tallas de la card (04-pdp.css) */
.elg-pcard-sheet-size.is-low::after,
.elg-pcard-sheet-size.is-preorder::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0.1rem;
    width: 4px;
    height: 4px;
    margin-left: -2px;
    border-radius: 50%;
    background: #041D40;
}
.elg-pcard-sheet-size.is-preorder::after { background: #dc2626; }
.elg-pcard-sheet-size.is-out {
    color: rgba(4, 29, 64, 0.35);
    text-decoration: line-through;
}
.elg-pcard-sheet-hint {
    margin-top: 0.5rem;
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    color: #dc2626;
}

.elg-pcard-sheet-colors {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}
.elg-pcard-sheet-color {
    width: 1.125rem;
    height: 1.125rem;
    padding: 0;
    border: 1px solid rgba(4, 29, 64, 0.2);
    cursor: pointer;
    position: relative;
}
/* Seleccionado: raya debajo, como en el diseño */
.elg-pcard-sheet-color.is-selected::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -0.3125rem;
    height: 1px;
    background: #041D40;
}

.elg-pcard-sheet-add {
    display: block;
    width: 100%;
    margin-top: 1.5rem;
    padding: 0.875rem 1rem;
    background: #041D40;
    border: 1px solid #041D40;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    cursor: pointer;
}
.elg-pcard-sheet-error {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #dc2626;
}
