/* assets/css/style.css */

:root {
    --primary: #ff4747;
    /* Rojo tipo AliExpress */
    --whatsapp: #25D366;
    /* Verde WhatsApp */
    --dark: #222;
    --light: #f5f5f5;
    --radius: 12px;
}

body {
    background-color: #f2f3f7;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding-bottom: 80px;
    /* Espacio para barra inferior móvil */
}

/* --- Header Transparente --- */
.navbar-custom {
    transition: all 0.3s ease;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 100%);
    padding: 15px 0;
}

.navbar-custom.scrolled {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 10px 0;
}

.navbar-custom.scrolled .nav-link,
.navbar-custom.scrolled .navbar-brand {
    color: var(--dark) !important;
}

/* --- Hero --- */
.hero-wrapper {
    position: relative;
    height: 70vh;
    overflow: hidden;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
}

.hero-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-content {
    position: absolute;
    bottom: 40px;
    left: 20px;
    right: 20px;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* --- Categorías (Iconos FontAwesome) --- */
.cat-scroll {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding: 20px 0;
    scrollbar-width: none;
}

.cat-scroll::-webkit-scrollbar {
    display: none;
}

.cat-bubble {
    min-width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--dark);
    font-size: 0.8rem;
    font-weight: 600;
}

/* Nuevo estilo para circulo de icono */
.cat-icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    /* Tamaño del icono */
    color: var(--primary);
    /* Color del icono */
    margin-bottom: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
}

.cat-bubble:active .cat-icon-wrapper {
    transform: scale(0.95);
    background: var(--light);
}

/* --- Cards de Productos --- */
.product-card {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
    height: 100%;
    text-decoration: none;
    color: inherit;
    display: block;
    cursor: pointer;
}

.product-card:active {
    transform: scale(0.98);
}

.product-img-wrapper {
    position: relative;
    padding-top: 100%;
    overflow: hidden;
}

.product-img-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    padding: 10px;
}

.product-title {
    font-size: 0.9rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.6em;
    margin-bottom: 5px;
}

.price-tag {
    color: var(--primary);
    font-weight: 800;
    font-size: 1.1rem;
}

/* --- Banner Publicidad --- */
.ad-banner {
    border-radius: var(--radius);
    overflow: hidden;
    margin: 20px 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.ad-banner img {
    width: 100%;
    height: auto;
    display: block;
}

/* --- Barra flotante inferior (Móvil) --- */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    padding: 10px 20px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* --- Botón Flotante WhatsApp --- */
.btn-whatsapp-float {
    position: fixed;
    bottom: 90px;
    /* Encima de la barra nav móvil */
    right: 20px;
    background-color: var(--whatsapp);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 999;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-whatsapp-float:hover {
    background-color: #1ebe57;
    transform: scale(1.1);
    color: white;
}

/* --- Estilos Recibo (ver_pedido.php) --- */
.receipt-container {
    max-width: 600px;
    margin: 30px auto;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    border-top: 5px solid var(--primary);
}

.receipt-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px dashed #eee;
}

.receipt-status {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    display: inline-block;
    margin-top: 10px;
}

/* =========================================
   NUEVO: ESTILOS PARA BUSCADOR Y STOCK
   (Agregar al final de style.css)
   ========================================= */

/* --- 1. Estilos del Buscador en el Header --- */
.search-form {
    position: relative;
    width: 100%;
    max-width: 400px; /* Ancho máximo en PC */
    margin: 0 15px; /* Separación lateral */
}

.search-input {
    width: 100%;
    border-radius: 20px;
    border: none;
    padding: 8px 15px;
    padding-right: 40px; /* Espacio para el icono */
    /* Fondo semitransparente para que se vea bien sobre tu video */
    background: rgba(255, 255, 255, 0.2); 
    color: white;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.8);
}

.search-input:focus {
    outline: none;
    background: white;
    color: var(--dark);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.btn-search-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: white;
    cursor: pointer;
}

/* Ajustes cuando el header hace scroll (se vuelve blanco) */
.navbar-custom.scrolled .search-input {
    background: #f0f0f0; /* Gris claro sobre fondo blanco */
    color: var(--dark);
}
.navbar-custom.scrolled .search-input::placeholder {
    color: #999;
}
.navbar-custom.scrolled .btn-search-icon {
    color: var(--dark);
}

/* --- 2. Estilos para Productos Agotados (Stock) --- */

/* Necesario para posicionar el cartel de agotado dentro de la tarjeta */
.product-card {
    position: relative; 
}

/* Capa semitransparente que cubre la imagen si no hay stock */
.sold-out-overlay {
    position: absolute;
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0;
    background: rgba(255, 255, 255, 0.7); /* Blanco al 70% */
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius); /* Respetar bordes redondeados */
}

/* La etiqueta negra de "AGOTADO" */
.badge-sold-out {
    background: #333;
    color: white;
    padding: 5px 12px;
    font-weight: 800;
    font-size: 0.8rem;
    text-transform: uppercase;
    transform: rotate(-10deg); /* Ligeramente inclinado */
    border: 2px solid white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}