/* =========================================================
   Seramia Cart Stepper — Estilos del control de cantidad
   Compatible con: Elementor Floating Cart, Side Cart WooCommerce
   ========================================================= */

/* ----------------------------------------------------------
   Ocultar el texto "N ×" original que muestra WooCommerce/
   Elementor en el carrito flotante y reemplazarlo con el stepper
   ---------------------------------------------------------- */

/* Selector genérico: aplica en casi todos los side-cart plugins */
.e-cart-item__quantity,
.woocommerce-cart-form__cart-item .qty,
.side-cart-item-qty,
.woo-cart-item-qty,
[class*="cart"] [class*="quantity"]:not(.seramia-stepper-wrap) {
    /* No ocultamos con display:none para no romper otros layouts;
       la lógica JS inserta el stepper y esconde este nodo. */
}

/* ----------------------------------------------------------
   Wrapper del stepper
   ---------------------------------------------------------- */
.seramia-stepper-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0;
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid rgba(200, 175, 120, 0.45);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(4px);
    height: 32px;
    margin-top: 6px;
    user-select: none;
}

/* ----------------------------------------------------------
   Botones − y +
   ---------------------------------------------------------- */
.seramia-stepper-wrap .seramia-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    color: #c8af78;          /* dorado del sitio */
    font-size: 18px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
    flex-shrink: 0;
    padding: 0;
}

.seramia-stepper-wrap .seramia-btn:hover {
    background: rgba(200, 175, 120, 0.18);
    color: #e8d49a;
}

.seramia-stepper-wrap .seramia-btn:active {
    background: rgba(200, 175, 120, 0.35);
    transform: scale(0.92);
}

.seramia-stepper-wrap .seramia-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* ----------------------------------------------------------
   Input de cantidad (solo lectura visual)
   ---------------------------------------------------------- */
.seramia-stepper-wrap .seramia-qty-input {
    width: 34px;
    text-align: center;
    border: none;
    background: transparent;
    color: #9A9A8E;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    padding: 0;
    -moz-appearance: textfield;
    pointer-events: none;   /* evitar edición manual; usar botones */
}

.seramia-stepper-wrap .seramia-qty-input::-webkit-inner-spin-button,
.seramia-stepper-wrap .seramia-qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ----------------------------------------------------------
   Separadores verticales entre botón / input / botón
   ---------------------------------------------------------- */
.seramia-stepper-wrap .seramia-sep {
    width: 1px;
    height: 18px;
    background: rgba(200, 175, 120, 0.3);
    flex-shrink: 0;
}

/* ----------------------------------------------------------
   Animación de "cargando" mientras espera la respuesta AJAX
   ---------------------------------------------------------- */
.seramia-stepper-wrap.is-loading {
    opacity: 0.55;
    pointer-events: none;
}

.seramia-stepper-wrap.is-loading .seramia-qty-input {
    animation: seramia-pulse 0.7s ease infinite alternate;
}

@keyframes seramia-pulse {
    from { opacity: 1; }
    to   { opacity: 0.3; }
}

/* ----------------------------------------------------------
   Subtotal — resaltar actualización
   ---------------------------------------------------------- */
.seramia-subtotal-updated {
    animation: seramia-flash 0.45s ease;
}

@keyframes seramia-flash {
    0%   { color: #c8af78; }
    50%  { color: #ffffff; }
    100% { color: inherit; }
}

/* ----------------------------------------------------------
   Responsive: carrito flotante en móvil
   ---------------------------------------------------------- */
@media (max-width: 480px) {
    .seramia-stepper-wrap {
        height: 28px;
    }
    .seramia-stepper-wrap .seramia-btn {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }
    .seramia-stepper-wrap .seramia-qty-input {
        width: 28px;
        font-size: 13px;
    }
}
