/* --- css/store.css --- */

/* Estilos base */
:root {
    --page-bg-color: #f8fafc;
    --primary-color: #8b70e5;
    --primary-color-dark: #7c62d5;
    --footer-height: 150px; /* Fallback */
    --text-color-main: #191919; 
}

body { 
    font-family: 'Lexend', sans-serif; /* <-- FUENTE ACTUALIZADA */
    color: var(--text-color-main); 
}

/* Clase para evitar que el botón flotante choque con el footer */
body > #view-cart-popup.avoid-footer {
    bottom: calc(var(--footer-height) + 1rem);
}

/*
 * =============================================================
 * LÓGICA DE VISIBILIDAD DEFINITIVA (Basada en estado)
 * =============================================================
 */

/* 1. Por defecto, el botón está oculto. */
#view-cart-popup {
  display: none;
}

/* 2. Se muestra si #app TIENE 'cart-not-empty' y NO TIENE 'view-cart-active'. */
#app.cart-not-empty:not(.view-cart-active) #view-cart-popup {
  display: flex;
}

/*
 * =============================================================
 * LÓGICA DE POSICIONAMIENTO PARA ESCRITORIO
 * =============================================================
 */

/* Cuando el botón está dentro del ancla de escritorio, cambiamos su
   posicionamiento de 'fixed' (flotante) a 'static' (en el flujo normal).
*/
#desktop-cart-anchor > #view-cart-popup {
    position: static;
}


/* --- Estilos para el botón de agregar animado --- */
.action-button-container {
    position: relative;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    height: 42px;
    width: 130px;
}
.action-button-inner {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    background-color: #252525;
    border-radius: 9999px;
    height: 42px;
    transition: width 0.35s cubic-bezier(0.65, 0, 0.35, 1);
    width: 42px;
    overflow: hidden;
    color: var(--mint-color, #00ffbd);
}
.action-button-inner.is-expanded {
    width: 130px;
}
.stepper-controls {
    display: flex;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s ease 0.15s;
    pointer-events: none;
    flex-grow: 1;
    justify-content: space-around;
    padding-left: 0.75rem;
}
.action-button-inner.is-expanded .stepper-controls {
    opacity: 1;
    pointer-events: auto;
}
.plus-btn {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
}
.product-quantity-change-btn {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0.5rem;
}
.product-quantity-change-btn:hover {
    background-color: rgba(255,255,255,0.1);
    border-radius: 50%;
}
.action-button-inner span {
    font-weight: bold;
    font-size: 1.125rem;
}

/* --- Estilos del carrusel y misceláneos --- */

.stepper-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background-color: #d1d5db; transition: all 0.3s ease;
}
.stepper-dot.active {
    background-color: var(--primary-color); transform: scale(1.25);
}
@keyframes cart-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}
.cart-animating {
    animation: cart-bounce 0.4s ease-in-out;
}
.carousel-card {
    background-size: cover;
    background-position: center;
    position: relative;
}
.card-carousel-container {
    scrollbar-width: none; /* Firefox */
}
.card-carousel-container::-webkit-scrollbar {
    display: none; /* Safari and Chrome */
}
.file-input-label {
    cursor: pointer; border: 2px dashed #e2e8f0; padding: 1rem;
    border-radius: 0.75rem; display: flex; align-items: center;
    justify-content: center; transition: all 0.2s ease;
}
.file-input-label:hover { border-color: var(--primary-color); background-color: #f1f5f9; }

/* Estilos para el carrito */
.quantity-change-btn {
   background-color: var(--text-color-main); /* Cambiado a #252525 */
    border: none;
    color: var(--mint-color, #00ffbd);
    cursor: pointer;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.quantity-change-btn:hover {
    background-color: #4a4a4a;
}
.quantity-change-btn i {
    font-size: 1.25rem;
}
#cartItems .font-bold {
    color: var(--mint-color, #00ffbd);
    font-size: 1.25rem;
}

/*
 * =============================================================
 * ESTILO SECUNDARIO PARA BOTÓN DE CUPÓN
 * =============================================================
 */
#apply-discount-btn {
    background-color: transparent !important; /* Sobrescribe la clase de Tailwind */
    border: 2px solid var(--primary-color);
    color: var(--primary-color) !important; /* Sobrescribe la clase de Tailwind */
    transition: all 0.2s ease-in-out;
}

#apply-discount-btn:hover {
    background-color: var(--primary-color) !important; /* Sobrescribe la clase de Tailwind */
    color: white !important;
}


/*
 * =============================================================
 * ESTILOS PARA EL ARRASTRE DEL CARRUSEL
 * =============================================================
 */

/* Cambia el cursor para indicar que el elemento es movible */
#card-carousel {
  cursor: grab;
}

/* Cambia el cursor a "agarrando" y evita la selección de texto durante el arrastre */
#card-carousel.is-grabbing {
  cursor: grabbing;
  user-select: none;
}

footer {
    background-color: var(--text-color-main); /* Usa el color #252525 */
    color: white; /* Para que el texto dentro sea legible */
    padding: 2rem 1rem; /* Espaciado opcional para que se vea mejor */
    text-align: center;
}

/* --- INICIO: Estilos del Loader --- */
.loader-container {
    position: fixed;
    inset: 0;
    background-color: rgba(23, 23, 23, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: opacity 0.3s ease;
}
.loader-content {
    text-align: center;
    font-weight: 500;
    font-family: 'Lexend', sans-serif;
}
.loader-content p {
    color: #fff5d6; /* Un gris más claro (casi blanco) para mejor contraste */
    font-size: 1rem; 
    margin-top: 0.5rem; /* Espacio entre el logo y el texto */
}
.loader-content img {
    width: 120px;
    display: block;
    margin: 0 auto 1rem;
    animation: pulse 1.5s infinite ease-in-out;
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}
/* Estilos para el ícono de error en los inputs */
.form-input-error {
    border-width: 2px;
    border-color: #EF4444; /* Rojo de Tailwind */
    padding-right: 2.5rem !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23EF4444'%3e%3cpath fill-rule='evenodd' d='M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12zm8.706-1.442c0-.662.538-1.2 1.2-1.2s1.2.538 1.2 1.2v5.562c0 .662-.538 1.2-1.2 1.2s-1.2-.538-1.2-1.2V10.558zM12 7.5a.75.75 0 100-1.5.75.75 0 000 1.5z' clip-rule='evenodd' /%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.625rem center;
    background-size: 1.25rem 1.25rem;
}
/* --- FIN: Estilos del Loader --- */

/*
 * =============================================================
 * NUEVOS ESTILOS PARA LA ANIMACIÓN DEL CARRITO VACÍO
 * =============================================================
 */
@keyframes wheelie {
  0%, 100% {
    transform: rotate(0deg);
  }
  30% {
    transform: rotate(-25deg);
  }
  50% {
    transform: rotate(15deg);
  }
  70% {
    transform: rotate(-5deg);
  }
}

.empty-cart-icon-wheelie {
  animation: wheelie 2s infinite ease-in-out;
  transform-origin: bottom center; /* Asegura que la rotación sea desde la base */
  color: var(--primary-color); /* Cambia el color del ícono a morado */
  display: inline-block; /* Necesario para que la transformación funcione correctamente */
}


/* FIX: Estilos para el mensaje de carrito vacío simplificados */
.empty-cart-message-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/*
 * =============================================================
 * AJUSTE PERSONALIZADO PARA EL LOGO
 * =============================================================
 */
#menuView header img, #store-closed-overlay header img {
    height: 2rem; /* 32px */
}


/*
 * =============================================================
 * ESTILOS PARA EL COMPROBANTE
 * =============================================================
 */
#receipt-page-overlay {
    position: fixed;
    inset: 0;
    background-color: white;
    z-index: 60;
    display: flex;
    flex-direction: column;
    transition: opacity 0.3s ease;
}
#receipt-page-overlay.hidden {
    display: none;
}
#receipt-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}
#receipt-page-title {
    font-weight: 600;
    color: #1e293b;
}
#receipt-page-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}
#receipt-page-iframe {
    flex-grow: 1;
    border: none;
    width: 100%;
    height: 100%;
}
