/* Definición de variables CSS para modo claro y oscuro */
:root {
    --background-color: #f0f0f0;
    --text-color: #1a1a1a;
    --header-bg: #d3d3d3;
    --nav-bg: rgba(180, 180, 180, 0.85);
    --nav-hover-bg: #a9a9a9;
    --nav-hover-text: #000000;
    --card-bg: white;
    --card-back-bg: #f9f9f9;
    --card-shadow: rgba(0, 0, 0, 0.1);
    --card-hover-shadow: rgba(0, 0, 0, 0.2);
    --price-color: #e91e63;
    --price-hover: #c2185b;
    --inventory-color: #555;
    --out-of-stock-bg: rgba(50, 50, 50, 0.8);
    --out-of-stock-text: white;
    --border-color: #e91e63; 
    --border-hover-color: #e91e63;
    --icon-color: #000000;
    --search-bar-bg: #ffffff;
    --modal-bg: rgba(0, 0, 0, 0.8);
    --modal-content-bg: #ffffff;
    --modal-button-bg: #666666; /* Color más neutro para los botones */
    --modal-button-hover-bg: #4d4d4d; /* Color más oscuro al pasar el mouse */
    --modal-button-text: #ffffff;
}

[data-theme="dark"] {
    --background-color: #1a1a1a;
    --text-color: #e5e5e5;
    --header-bg: #333333;
    --nav-bg: rgba(60, 60, 60, 0.85);
    --nav-hover-bg: #5a5a5a;
    --nav-hover-text: #ffffff;
    --card-bg: #2c2c2c;
    --card-back-bg: #353535;
    --card-shadow: rgba(255, 255, 255, 0.1);
    --card-hover-shadow: rgba(255, 255, 255, 0.2);
    --price-color: #ff4d8d;
    --price-hover: #ff6699;
    --inventory-color: #b0b0b0;
    --out-of-stock-bg: rgba(200, 200, 200, 0.8);
    --out-of-stock-text: #333;
    --border-color: #ff4d8d;
    --border-hover-color: transparent;
    --icon-color: #ffffff;
    --search-bar-bg: rgba(59, 59, 59, 0.767);
    --modal-bg: rgba(0, 0, 0, 0.9);
    --modal-content-bg: #2c2c2c;
    --modal-button-bg: #999999; /* Color más claro para tema oscuro */
    --modal-button-hover-bg: #b3b3b3; /* Color más claro al pasar el mouse */
    --modal-button-text: #000000; /* Texto oscuro para contraste en tema oscuro */
    
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    font-family: 'Roboto', Arial, sans-serif;
    overflow-x: hidden;
    position: relative;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Contenedor Header */
header {
    position: sticky;
    top: 0;
    z-index: 30;
    width: 100vw;
    left: 0;
    margin: 0;
    padding: 0;
}

/* Barra superior fija (top-bar) */
.top-bar {
    background-color: var(--header-bg);
    color: var(--text-color);
    padding: 8px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 30;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 2px 4px var(--card-shadow);
    font-family: 'Poppins', sans-serif;
    font-weight: bold;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Agrupar por bloques */
.nombre-local,
.barra-busqueda,
.iconos-contacto {
    display: flex;
    align-items: center;
}

/* Ajustes a cada sección */
.nombre-local {
    flex: 1;
    font-size: 24px;
}

.barra-busqueda {
    flex: 2;
    justify-content: center;
    padding: 0 20px;
}

.iconos-contacto {
    flex: 1;
    justify-content: flex-end;
    gap: 15px;
}

/* Nombre del negocio */
.store-name {
    color: var(--text-color);
    transition: color 0.3s ease;
    text-decoration: none;
}

/* Íconos */
.icono-ws,
.icono-ubicacion {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    color: var(--text-color);
    transition: color 0.3s ease;
    text-decoration: none;
}

.icono-ws i,
.icono-ubicacion i {
    font-size: 16px;
    color: var(--icon-color);
    transition: color 0.3s ease;
}

/* Botón de cambio de tema */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
}

.theme-icon {
    font-size: 20px;
    color: var(--text-color);
    transition: transform 0.3s ease, color 0.3s ease;
}

.theme-icon:hover {
    transform: scale(1.2);
    color: var(--border-color);
}

/* Botón de menú (oculto en desktop) */
.menu-toggle {
    display: none;
}

/* Barra de búsqueda */
.search-bar {
    padding: 8px;
    width: 100%;
    max-width: 450px;
    box-sizing: border-box;
    background-color: var(--search-bar-bg);
    color: var(--text-color);
    border: 1px solid var(--card-shadow);
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    font-family: 'Roboto', sans-serif;
    font-weight: normal;
}

.search-bar:focus {
    outline: none;
    border-color: var(--border-color);
}

/* Barra de navegación */
.nav-container {
    display: block;
}

.nav-bar {
    background-color: var(--nav-bg);
    padding: 6px 0;
    text-align: center;
    position: sticky;
    z-index: 30;
    width: 100vw;
    left: 0;
    box-sizing: border-box;
    margin: 0;
    box-shadow: 0 2px 4px var(--card-shadow);
    transition: background-color 0.3s ease;
}

.nav-bar ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.nav-bar li {
    display: flex;
}

.nav-bar a {
    color: var(--text-color);
    text-decoration: none;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    height: 100%;
    width: 100%;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease;
    font-size: 16px;
}

.nav-bar a:hover {
    background-color: var(--nav-hover-bg);
    color: var(--nav-hover-text);
}

/* Estilos de la galería */
.gallery-section {
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.gallery-section h1 {
    text-align: center;
    font-size: 32px;
    margin-bottom: 30px;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
    font-size: 1.5em;
    font-weight: bold;
}

.section-icon i {
    font-size: 1.2em;
}

.section-title {
    font-family: Arial, sans-serif;
}

.product-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.product-card {
    position: relative;
    height: 450px; /* Altura fija para desktop */
    background-color: var(--card-bg);
    border-radius: 10px;
    box-shadow: 0 4px 8px var(--card-shadow);
    transition: transform 0.6s ease, box-shadow 0.3s ease;
    border: 2px solid transparent;
    overflow: hidden;
    perspective: 1000px;
    transform-style: preserve-3d;
    display: flex; /* Añadido para controlar el contenido interno */
    flex-direction: column; /* Añadido para alinear verticalmente */
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px var(--card-hover-shadow);
    border: 2px solid transparent;
}

:root .product-card:hover {
    background: transparent;
    border: 2px solid;
    border-image: linear-gradient(45deg, #00f0ff, #ff00ff, #00ff00, #00f0ff) 1;
    border-image-slice: 1;
    animation: vibrant-border 8s linear infinite;
}

[data-theme="dark"] .product-card:hover {
    background: transparent;
    border: 2px solid;
    border-image: linear-gradient(45deg, #00f0ff, #ff00ff, #00ff00, #00f0ff) 1;
    border-image-slice: 1;
    animation: neon-border 8s linear infinite;
}

@keyframes vibrant-border {
    0% { border-image-source: linear-gradient(45deg, #00f0ff, #ff00ff, #00ff00, #00f0ff); }
    100% { border-image-source: linear-gradient(405deg, #00f0ff, #ff00ff, #00ff00, #00f0ff); }
}

@keyframes neon-border {
    0% { border-image-source: linear-gradient(45deg, #00f0ff, #ff00ff, #00ff00, #00f0ff); }
    100% { border-image-source: linear-gradient(405deg, #00f0ff, #ff00ff, #00ff00, #00f0ff); }
}

@media (prefers-reduced-motion: reduce) {
    .product-card:hover {
        transform: none;
        border: 2px solid #00f0ff;
    }

    [data-theme="dark"] .product-card:hover {
        animation: none;
        border: 2px solid #00f0ff;
    }
}

.product-card.out-of-stock-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(50, 50, 50, 0.7);
    z-index: 1;
    pointer-events: none;
}

.product-card.flipped .card-front {
    transform: rotateY(180deg);
    opacity: 0;
    pointer-events: none; /* Desactiva interacciones en la cara frontal cuando está volteada */
}

.product-card.flipped .card-back {
    transform: rotateY(0deg);
    opacity: 1;
    z-index: 10;
}

.card-front,
.card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%; /* Ocupa toda la altura de la tarjeta */
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
    text-align: center;
    transition: transform 0.6s ease, opacity 0.6s ease;
    backface-visibility: hidden; /* Oculta la cara trasera durante la rotación */
}

.card-front {
    background-color: var(--card-bg);
    transform: rotateY(0deg);
    opacity: 1;
    z-index: 2;
    justify-content: space-between;
}

.card-back {
    background-color: var(--card-back-bg);
    transform: rotateY(180deg); /* Inicia rotada para que esté oculta */
    opacity: 0;
    z-index: 1;
    pointer-events: none;
    position: relative;
    display: flex;
    flex-direction: column;
    padding-bottom: 50px; /* Espacio reservado en la parte inferior para el botón */
}

.product-card.flipped .card-back {
    pointer-events: auto;
}

.product-image {
    width: 100%;
    height: 220px;
    object-fit: contain;
    margin-bottom: 15px;
}

.product-name {
    font-size: 16px;
    font-weight: 700;
    margin: 10px 0 5px;
    color: var(--text-color);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    max-height: 48px;
}

.product-price {
    font-size: 18px;
    font-weight: bold;
    color: var(--price-color);
    margin: 5px 0;
}

.product-inventory {
    font-size: 14px;
    color: var(--inventory-color);
    margin: 5px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.out-of-stock {
    position: absolute;
    top: 10px;
    right: 10px;
    transform: none;
    background-color: #ff3333;
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
    z-index: 3;
    pointer-events: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
}

[data-theme="dark"] .out-of-stock {
    background-color: #ff6666;
    color: #000000;
    box-shadow: 0 2px 4px rgba(255, 255, 255, 0.2);
}

.tech-specs-link,
.back-link {
    font-size: 14px;
    color: var(--price-color);
    text-decoration: none;
    padding: 10px 20px;
    border: 1px solid var(--price-color);
    border-radius: 5px;
    width: fit-content;
    transition: color 0.3s ease, background-color 0.3s ease;
    z-index: 20;
    cursor: pointer;
    pointer-events: auto;
}

.tech-specs-link {
    margin-top: auto;
    align-self: center;
}

.back-link {
    position: absolute;
    bottom: 15px; /* Ajustado para simular un margen inferior */
    left: 50%;
    transform: translateX(-50%); /* Centrado horizontal */
    font-size: 14px;
    color: var(--price-color);
    text-decoration: none;
    padding: 10px 20px;
    border: 1px solid var(--price-color);
    border-radius: 5px;
    width: fit-content;
    transition: color 0.3s ease, background-color 0.3s ease;
    z-index: 20;
    cursor: pointer;
    pointer-events: auto;
}

.tech-specs-link:hover,
.back-link:hover {
    color: var(--price-hover);
    background-color: rgba(233, 30, 99, 0.1);
}

.tech-specs {
    text-align: left;
    padding: 15px 0;
    padding-bottom: 15px; /* Reducido a un valor básico */
    flex-grow: 1;
    overflow-y: auto; /* Permite el desplazamiento vertical */
    margin-bottom: 0; /* Eliminado el margen inferior para usar el espacio completo */
    width: 100%; /* Asegura que ocupe el ancho completo, pero su contenido se alinee a la izquierda */
}

.tech-specs h4 {
    font-size: 16px;
    color: var(--text-color);
    margin-bottom: 15px;
    line-height: 1.3;
}

.tech-specs ul {
    list-style: disc;
    padding-left: 20px;
    font-size: 14px;
    color: var(--inventory-color);
    margin: 0;
}

.tech-specs li {
    margin-bottom: 8px;
    line-height: 1.4;
}

/* Estilo para la scrollbar en tech-specs */
.tech-specs::-webkit-scrollbar {
    width: 6px;
}

.tech-specs::-webkit-scrollbar-track {
    background: var(--card-back-bg);
    border-radius: 3px;
}

.tech-specs::-webkit-scrollbar-thumb {
    background: var(--inventory-color);
    border-radius: 3px;
}

.tech-specs::-webkit-scrollbar-thumb:hover {
    background: var(--price-color);
}


/* Modal para imágenes */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-bg);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.modal[aria-hidden="false"] {
    display: flex;
    opacity: 1;
}

.modal-content {
    background-color: var(--modal-content-bg);
    padding: 20px;
    border-radius: 10px;
    max-width: 90%;
    max-height: 90vh;
    position: relative;
    box-shadow: 0 4px 8px var(--card-shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: background-color 0.3s ease;
    width: 100%;
    max-width: 800px; /* Ajustamos el ancho máximo del contenido */
}

.modal-image-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%; /* La imagen ocupa todo el contenedor */
}

.modal-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 5px;
    transition: opacity 0.3s ease;
}

/* Ajustamos los botones de navegación para que estén fuera del modal-content */
.modal-nav {
    position: fixed; /* Cambiamos a fixed para posicionarlos respecto a la ventana */
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--modal-button-bg);
    color: var(--modal-button-text);
    border: none;
    padding: 10px;
    cursor: pointer;
    font-size: 24px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001; /* Aseguramos que esté por encima del contenido */
}

.modal-nav:hover {
    background-color: var(--modal-button-hover-bg);
}

.modal-nav.prev {
    left: calc(47% - 450px); /* Posicionamos a la izquierda del centro de la pantalla */
}

.modal-nav.next {
    right: calc(47% - 450px); /* Posicionamos a la derecha del centro de la pantalla */
}

.modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background-color: var(--modal-button-bg);
    color: var(--modal-button-text);
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 18px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background-color: var(--modal-button-hover-bg);
}

.modal-caption {
    margin-top: 10px;
    font-size: 16px;
    color: var(--text-color);
    text-align: center;
    transition: color 0.3s ease;
}
.search-results-gallery {
    display: none; /* Oculta por defecto */
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px auto;
    padding: 0 20px;
    max-width: 1200px;
    visibility: visible !important; /* Forzar visibilidad */
}

.search-results-gallery[style*="display: grid"] {
    display: grid !important; /* Asegurar que se muestre cuando está activo */
}

.search-results-gallery p {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 16px;
    color: #333;
    margin: 20px 0;
}

.search-results-gallery .product-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: block !important;
}

.search-results-gallery .product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.search-results-gallery .product-image {
    width: 100%;
    height: 200px;
    object-fit: contain;
    cursor: pointer;
}

.search-results-gallery .product-name {
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
    color: #333;
}

.search-results-gallery .product-price {
    font-size: 1rem;
    color: #007bff;
    padding: 5px 10px;
    text-align: center;
}

.search-results-gallery .product-inventory {
    font-size: 0.9rem;
    color: #666;
    padding: 5px 10px;
    text-align: center;
}

.search-results-gallery .out-of-stock {
    background: #dc3545;
    color: white;
    text-align: center;
    padding: 5px;
    font-size: 0.9rem;
}

.search-results-gallery .tech-specs-link {
    display: block;
    text-align: center;
    padding: 10px;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 0 0 8px 8px;
    transition: background 0.3s ease;
}

.search-results-gallery .tech-specs-link:hover {
    background: #0056b3;
}
.highlight-product {
    animation: highlight 3s ease;
    border: 2px solid #ff4c29;
    box-shadow: 0 0 10px rgba(255, 76, 41, 0.5);
}

@keyframes highlight {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
/* Footer Styles */
.footer {
    background-color: var(--header-bg);
    color: var(--text-color);
    padding: 40px 20px;
    border-top: 2px solid var(--border-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-section {
    flex: 1;
    min-width: 200px;
}

.footer-section h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

.footer-section p {
    font-size: 14px;
    line-height: 1.6;
    margin: 5px 0;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: var(--nav-hover-text);
}

.footer-section p i {
    margin-right: 8px;
    color: var(--icon-color);
}

.footer-section p a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section p a:hover {
    color: var(--nav-hover-text);
}

.footer-bottom {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.footer-bottom p {
    font-size: 14px;
    margin: 0;
    color: var(--text-color);
}