/* ==========================================================
   ITERAFLOW SHOP - MOBILE APP CORE STYLES
   ========================================================== */

:root {
    /* Variables vinculadas a ACF (con fallbacks) */
    --if-primary: #0F172A;   /* Color principal para botones y barra */
    --if-accent: #3b82f6;    /* Color para precios y estados activos */
    --if-bg: #F8FAFC;        /* Fondo grisáceo muy suave para la App */
    --if-surface: #FFFFFF;   /* Fondo blanco para las cards */
    --if-text-title: #1e293b;
    --if-text-muted: #64748b;
    --if-radius: 24px;       /* Bordes muy redondeados tipo App moderna */
    --if-shadow-sm: 0 4px 12px rgba(0,0,0,0.03);
    --if-shadow-lg: 0 15px 35px rgba(15, 23, 42, 0.15);
}

/* 1. Reset & Layout Base */
body {
    background-color: var(--if-bg);
    font-family: 'Inter', -apple-system, sans-serif;
    color: var(--if-text-title);
    margin: 0;
    padding-bottom: 110px; /* Espacio para que la barra inferior no tape el contenido */
    -webkit-tap-highlight-color: transparent;
}

.if-app-wrapper {
    max-width: 500px; /* Limita el ancho en desktop para mantener estética móvil */
    margin: 0 auto;
    min-height: 100vh;
}

/* 2. Header & Banner */
.if-app-header {
    background: linear-gradient(135deg, var(--if-primary) 0%, #1e40af 100%);
    color: white;
    border-radius: 0 0 var(--if-radius) var(--if-radius);
    padding: 40px 20px;
}

.if-logo-ring {
    width: 85px;
    height: 85px;
    background: white;
    border-radius: 50%;
    padding: 3px;
    display: inline-block;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.if-logo-ring img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* 3. Categorías (Chips / Estilo Horizontal) */
.if-categories-row {
    margin-top: -25px; /* Sube los chips para que monten sobre el header */
    padding-bottom: 10px;
}

.if-cat-chip {
    display: inline-flex;
    align-items: center;
    padding: 12px 24px;
    background: var(--if-surface);
    border-radius: 50px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: var(--if-shadow-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
    white-space: nowrap;
    margin-right: 10px;
}

.if-cat-chip.active {
    background: var(--if-primary);
    color: white;
    transform: scale(1.05);
}

/* 4. Cards de Producto (Variante Vertical / Carrusel) */
.if-product-card-v {
    background: var(--if-surface);
    border-radius: var(--if-radius);
    padding: 12px;
    width: 170px !important; /* Crucial para Swiper slides */
    box-shadow: var(--if-shadow-sm);
    transition: transform 0.2s ease;
}

.if-card-img-container {
    position: relative;
    border-radius: calc(var(--if-radius) - 8px);
    overflow: hidden;
    aspect-ratio: 1 / 1;
}

.if-card-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.if-btn-add-float {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--if-primary);
    color: white;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.if-product-info-v h4 {
    font-size: 15px;
    font-weight: 700;
    margin: 10px 0 4px;
    color: var(--if-text-title);
}

.if-price-v {
    color: var(--if-accent);
    font-weight: 800;
    font-size: 14px;
}

/* 5. Barra Inferior Flotante (Píldora de Checkout) */
.if-checkout-bar {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 420px;
    z-index: 9999;
}

.if-cart-pill {
    background: var(--if-primary);
    border-radius: 100px;
    padding: 14px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    box-shadow: var(--if-shadow-lg);
}

.if-cart-total-label {
    font-size: 12px;
    opacity: 0.8;
    display: block;
}

.if-cart-amount {
    font-size: 18px;
    font-weight: 800;
}

.if-btn-view-cart {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    border-radius: 50px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 700;
    backdrop-filter: blur(10px);
}

/* 6. Ajustes de Swiper (Carruseles) */
.swiper-container {
    overflow: visible !important; /* Permite que las sombras no se corten */
    padding-left: 20px;
}

.if-avatar-wrapper {
    width: 120px;
    height: 120px;
    border-radius: 50%;
}

.if-hero-banner {
    border-radius: 0 0 40px 40px; /* Curva suave al final del azul */
}

/* selector de cantidad reutilizable */
.if-qty-selector {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--if-border);
    border-radius: var(--if-radius);
    overflow: hidden;
}
.if-qty-selector .if-qty-input {
    width: 50px;
    text-align: center;
    border: none;
    padding: 4px;
}
.if-qty-selector .if-qty-btn {
    width: 32px;
    height: 32px;
    background: var(--if-primary);
    color: #fff;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 1rem;
    font-weight: 700;
    padding: 0;
    cursor: pointer;
}

/* removed duplicate rules */

/* control de cantidad genérico */
.if-qty-selector {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--if-border);
    border-radius: var(--if-radius);
    overflow: hidden;
}
.if-qty-selector .if-qty-input {
    width: 50px;
    text-align: center;
    border: none;
    padding: 4px;
}
.if-qty-selector .if-qty-btn {
    width: 32px;
    height: 32px;
    background: var(--if-primary);
    color: #fff;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 1rem;
    font-weight: 700;
    padding: 0;
    cursor: pointer;
}


/* Iconos de la barra superior */
.if-navbar .bi {
    font-size: 1.2rem;
}

#if-search-input:focus {
    box-shadow: none;
    outline: none;
}

/* Toast de notificaciones */
.if-toast {
    position: fixed;
    bottom: 120px; /* Encima de la cápsula de carrito */
    left: 50%;
    transform: translateX(-50%);
    background: var(--if-white);
    color: var(--if-text-title);
    padding: 12px 20px;
    border-radius: var(--if-radius);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    font-size: 0.9rem;
    max-width: 90%;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000010;
}

.if-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-10px);
}

.if-toast.error {
    background: #fee2e2;
    color: #dc2626;
    border-left: 4px solid #dc2626;
}

.if-toast.success {
    background: #d1fae5;
    color: #059669;
    border-left: 4px solid #059669;
}

#if-product-content .variations-select:focus {
    border-color: var(--if-input-focus, var(--if-primary));
    box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--if-input-focus, var(--if-primary)) 25%, transparent);
    outline: 0;
}

#if-product-content .if-variation-label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.2;
    color: var(--if-text-body);
}

#if-product-content .variations-select {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--if-text-body);
    border-radius: var(--if-radius) !important;
}

#if-product-content .variations-select option {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--if-text-body);
}

#if-product-content .if-qty-input {
    border-radius: var(--if-radius) !important;
}
