/* Archivo: estilos/Styles.css (Versión Unificada) */

/* --- ESTILOS GENERALES --- */
body {
    font-family: 'Inter', sans-serif;
    background-color: #fdfaf6;
    color: #333;
}
html {
    scroll-behavior: smooth;
}

/* --- ESTILOS DE LA PÁGINA DE LOGIN --- */
.login-page-bg {
    background-image: url('../recursos/fondo.png');
    background-size: cover;
    background-position: center;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}
.login-container {
    background-color: white;
    padding: 2.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

/* --- ESTILOS DEL HEADER --- */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    transition: all 0.3s ease-in-out;
    background-color: transparent;
    height: 90px;
    display: flex;
    align-items: center;
    transform: translateY(-100%); /* Inicia oculto */
}
.main-header.header-visible {
    transform: translateY(0); /* Se muestra */
}
.main-header.scrolled {
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    color: #333;
}
.main-header.scrolled a, .main-header.scrolled button { color: #333; }
.main-header.scrolled #businessNameDisplay { color: #8b5cf6; }
.main-header.scrolled a:hover { color: #8b5cf6; }

#headerLogo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 1rem;
    transition: all 0.3s ease-in-out;
    transform: translateY(0);
}
.main-header.scrolled #headerLogo {
    width: 120px;
    height: 120px;
    transform: translateY(30px);
}
#headerLogo:hover { 
    transform: translateY(30px) rotate(360deg) scale(1.1); 
}
.main-header.scrolled #headerLogo:hover {
    transform: translateY(0) rotate(360deg) scale(1.1);
}

/* --- ESTILOS DEL CARRUSEL DE INICIO --- */
.carousel-container {
    position: absolute; 
    top: 0;
    left: 0;
    width: 100%;
    height: 100%; 
    overflow: hidden;
    z-index: 1; /* Capa más baja, solo para el fondo */
}
#dynamicCarouselSlides {
    height: 100%;
}
.carousel-slide {
    display: none; 
    width: 100%;
    height: 100%; 
    background-size: cover;
    background-position: center;
    position: relative; 
    opacity: 0;
    transition: opacity 0.8s ease-in-out; 
}
.carousel-slide.active {
    display: block !important; 
    opacity: 1 !important; 
}
.carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2.5rem;
    background: linear-gradient(to top, rgba(0,0,0,0.7), rgba(0,0,0,0));
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    z-index: 10; /* Por encima de la imagen, pero debajo de los botones */
}


.carousel-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.5);
    color: #333;
    border: none;
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 1.5rem;
    font-weight: bold;
    border-radius: 9999px; 
    transition: background-color 0.3s ease, color 0.3s ease;
    z-index: 30; /* Capa más alta, para estar sobre todo */
}
.carousel-button:hover {
    background-color: rgba(255, 255, 255, 0.8);
    color: #000;
}
.carousel-button.prev { left: 1rem; }
.carousel-button.next { right: 1rem; }

.carousel-dots {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 30; /* También en la capa más alta */
}
.dot {
    width: 12px;
    height: 12px;
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.dot.active {
    background-color: #fff;
}


/* --- ESTILOS PARA MODALES --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s 0.3s;
}
.modal.active {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease;
}
.modal-dialog {
    width: 90%;
    max-width: 500px;
    transform: translateY(-30px);
    transition: transform 0.3s ease;
}
.modal.active .modal-dialog {
    transform: translateY(0);
}
.modal-content {
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}
.modal-body {
    padding: 1.5rem;
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background-color: #f9fafb;
    border-top: 1px solid #e5e7eb;
}
.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
}
.close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #9ca3af;
}
.close:hover {
    color: #111827;
}

/* --- ESTILOS DEL BOTÓN FLOTANTE DEL CARRITO --- */
#floatingCartBtn {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background-color: #ef4444;
    color: white;
    border-radius: 9999px;
    padding: 1rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    z-index: 999;
}
#floatingCartBtn:hover {
    background-color: #dc2626;
    transform: scale(1.1);
}
#floatingCartBtn .cart-icon {
    width: 2rem;
    height: 2rem;
}
#floatingCartBtn #cartItemCountFloating {
    position: absolute;
    top: -0.25rem;
    right: -0.25rem;
    background-color: #f97316;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: 9999px;
    height: 1.25rem;
    width: 1.25rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}
#floatingCartBtn #cartItemCountFloating:not(.hidden) {
    display: flex;
    align-items: center;
    justify-content: center;
}
/* Estilo para la imagen (columna izquierda) */
.cart-item {
    display: flex;
    align-items: flex-start; /* Alinea los items al inicio (arriba) */
    padding: 1rem 0;
    border-bottom: 1px solid #e5e7eb; /* gray-200 */
}
.cart-item:last-child {
    border-bottom: none;
}

/* Estilo para la imagen (columna izquierda) */
.cart-item-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 0.5rem; /* rounded-md */
    margin-right: 1rem; /* mr-4 */
    flex-shrink: 0; /* Evita que la imagen se encoja */
}

/* Contenedor para toda la información (columna derecha) */
.cart-item-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100px; /* Asegura que tenga la misma altura que la imagen */
}

/* Contenedor para el nombre y precio unitario */
.cart-item-info {
    text-align: left;
    margin-bottom: 0.5rem;
}

/* Contenedor para la fila inferior (controles y subtotal) */
.cart-item-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto; /* Empuja este contenedor hacia la parte de abajo */
}

.cart-item-quantity-controls {
    display: flex;
    align-items: center;
}

.cart-item-subtotal {
    font-weight: 600;
    text-align: right;
}

/* NUEVO: Estilo para el contenedor de la lista con scroll */
#cartItemsList {
    max-height: 40vh; /* Altura máxima del 40% de la pantalla */
    overflow-y: auto; /* Activa el scroll vertical cuando es necesario */
    padding-right: 1rem; /* Espacio para la barra de scroll */
    margin-right: -1rem; /* Compensa el padding para mantener la alineación */
}
/* NUEVO: Estilos para el botón de Compartir y su menú */
.share-container {
    position: relative;
}

/* **CORRECCIÓN**: Se renombra la clase para que sea más genérica */
.share-btn {
    background-color: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 9999px;
    transition: background-color 0.2s ease;
    color: #6b7280; /* gray-500 */
}
.share-btn:hover {
    background-color: #f3f4f6; /* gray-100 */
    color: #111827; /* gray-900 */
}

.share-dropdown {
    position: absolute;
    bottom: 100%; /* Se posiciona encima del botón */
    right: 0;
    margin-bottom: 0.5rem;
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    width: 150px;
    z-index: 10;
    overflow: hidden;
}

.share-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    font-size: 0.875rem;
    color: #374151; /* gray-700 */
    text-decoration: none;
    transition: background-color 0.2s ease;
}
.share-link:hover {
    background-color: #f3f4f6; /* gray-100 */
}


/* --- ESTILOS DEL PANEL DE ADMINISTRACIÓN --- */
.admin-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #4a5568; 
}
.admin-form-group input, .admin-form-group textarea {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid #e2e8f0; 
    border-radius: 0.375rem; 
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.admin-form-group input:focus, .admin-form-group textarea:focus {
    outline: none;
    border-color: #a78bfa; 
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.5); 
}
.admin-button {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: background-color 0.2s ease-in-out, transform 0.1s ease-in-out;
}
.admin-button-primary {
    background-color: #8b5cf6;
    color: white;
}
.admin-button-primary:hover {
    background-color: #7c3aed;
    transform: translateY(-1px);
}
.admin-button-secondary {
    background-color: #e2e8f0;
    color: #4a5568;
}
.admin-button-secondary:hover {
    background-color: #cbd5e0;
    transform: translateY(-1px);
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}
.admin-item-card {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.admin-item-preview {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    border: 1px solid #e5e7eb;
    background-color: #f3f4f6;
}

/* --- ESTILOS PARA EL GESTOR DE IMÁGENES --- */
#uploadResult input {
    cursor: pointer;
    background-color: #f3f4f6;
    border: 1px solid #d1d5db;
    padding: 0.5rem;
    border-radius: 0.375rem;
    width: 100%;
    margin-top: 0.5rem;
}
#uploadResult .text-green-600 {
    color: #059669;
}
#uploadResult .text-red-500 {
    color: #ef4444;
}
.progress-bar-container {
    width: 100%;
    background-color: #e5e7eb;
    border-radius: 9999px;
    overflow: hidden;
}
.progress-bar {
    height: 1.25rem;
    background-color: #8b5cf6;
    width: 0%;
    border-radius: 9999px;
    text-align: center;
    line-height: 1.25rem;
    color: white;
    font-weight: bold;
    transition: width 0.4s ease;
}

/* --- ESTILOS DE LA NAVEGACIÓN DE CATEGORÍAS --- */
.category-nav {
    position: sticky;
    top: 0;
    background-color: #fdfaf6; 
    z-index: 50; 
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
}
.category-nav ul {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    list-style: none;
    padding: 0;
    margin: 0;
}
.category-link {
    padding: 0.5rem 1rem;
    border-radius: 9999px; 
    background-color: #e2e8f0; 
    color: #4a5568; 
    font-weight: 600;
    transition: background-color 0.2s ease, color 0.2s ease;
    text-decoration: none;
    cursor: pointer;
}
.category-link.active {
    background-color: #8b5cf6; 
    color: white;
}

/* --- ESTILOS DE BOTONES DEL CARRITO --- */
.quantity-btn {
    background-color: #e5e7eb;
    color: #374151;
    border: none;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    font-weight: bold;
    font-size: 1.125rem;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}
.quantity-btn:hover {
    background-color: #d1d5db;
    transform: scale(1.05);
}
.quantity-btn:active {
    transform: scale(0.95);
}
.btn-send-whatsapp {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}
.btn-send-whatsapp:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* --- ESTILOS PARA NIVEL 3 (BLOG, INSTAGRAM, NEWSLETTER) --- */
.blog-card {
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
}
.instagram-post {
    position: relative;
    overflow: hidden;
    border-radius: 0.5rem;
    aspect-ratio: 1 / 1;
}
.instagram-post img {
    transition: transform 0.3s ease;
}
.instagram-post:hover img {
    transform: scale(1.1);
}
.newsletter-section {
    border-bottom: 1px solid #4a5568;
    padding-bottom: 2rem;
    margin-bottom: 2rem;
}
/* --- AJUSTES RESPONSIVOS --- */

/* Para pantallas pequeñas (móviles) de hasta 768px de ancho */
@media (max-width: 768px) {
    /* Reduce el tamaño del título principal solo cuando se ha hecho scroll */
    .main-header.scrolled h1 {
        font-size: 1.5rem; /* Equivalente a text-2xl de Tailwind */
        line-height: 2rem;
        text-align: left;
    }
    .main-header.scrolled #headerLogo {
        width: 120px;
        height: 120px;
        transform: translateY(30)!important; 
    }
}