/* ====================== Reset y Body ====================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
body {
    font-family: 'Segoe UI', sans-serif;
    background: #f8f9fa;
    color: #333;
    padding: 20px;
    padding-top: 120px; /* Ajuste por navbar fija */
}

/* ====================== Encabezados ====================== */
h1 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 32px;
    color: #2c3e50;
}



.categorias-lista {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 15px;
  padding: 40px 10%;
}

.categoria-item {
  background: #f4f4f4;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  text-decoration: none;
  font-weight: bold;
  color: #333;
  transition: 0.2s;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.categoria-item:hover {
  background: #eaeaea;
  transform: scale(1.03);
}

.btn-categorias {
  background: #0077cc;
  color: white;
  padding: 8px 14px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
}

.btn-categorias:hover {
  background: #005fa3;
}

.titulo-categoria {
  text-align: center;
  font-size: 1.5rem;
  margin: 30px 0 10px;
  color: #333;
  font-weight: 600;
}




/* =================== Paginación =================== */
.paginacion {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 30px 0;
    flex-wrap: wrap;
    font-family: "Segoe UI", Arial, sans-serif;
}

.paginacion a,
.paginacion span {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 14px;
    text-decoration: none;
    color: #333;
    background: #f9f9f9;
    border: 1px solid #ddd;
    transition: all 0.3s ease;
    min-width: 40px;
    text-align: center;
}

.paginacion a:hover {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.paginacion .activo {
    background: #007bff;
    color: #fff !important;
    font-weight: 600;
    border-color: #007bff;
    pointer-events: none;
}

.paginacion span {
    background: transparent;
    border: none;
    color: #666;
    font-weight: bold;
    cursor: default;
}

/* Responsive */
@media (max-width: 480px) {
    .paginacion {
        gap: 5px;
    }
    .paginacion a,
    .paginacion span {
        padding: 6px 10px;
        font-size: 13px;
        min-width: 34px;
    }
}


/* ==================== NAVBAR BASE ==================== */
nav.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(90deg, #000428, #004e92);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 40px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.35);
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
    z-index: 1000;
    font-family: 'Roboto', sans-serif;
    transition: top 0.6s ease-in-out;
}

/* ==================== LOGO ==================== */
.navbar .logo-link {
    display: flex;
    align-items: center;
    margin-right: 20px;
    background: #fff;
    border-radius: 12px;
    padding: 5px;
}

.navbar .logo-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.navbar .logo-link:hover .logo-img {
    transform: scale(1.1) rotate(-3deg);
    filter: drop-shadow(0 0 8px rgba(0,123,255,0.7));
}

/* ==================== TÍTULO ==================== */
.navbar-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 1px;
    text-align: center;
    flex: 1;
    color: #ffffff;
    text-shadow: 1px 1px 6px rgba(0,0,0,0.6);
}

/* ==================== BUSCADOR ==================== */
.navbar .search-container {
    flex: 2;
    display: flex;
    justify-content: center;
    margin: 0 20px;
}

.navbar .search-container input,
.navbar .search-container select {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #444;
    outline: none;
    font-size: 0.9rem;
    transition: all 0.2s ease-in-out;
}

.navbar .search-container input {
    flex: 2;
}

.navbar .search-container input:focus,
.navbar .search-container select:focus {
    border-color: #007bff;
    box-shadow: 0 0 6px rgba(0,123,255,0.6);
    color: #007bff;
    font-weight: bold;
}

/* ==================== LINKS ==================== */
.nav-links {
    display: flex;
    gap: 18px;
}

.nav-links a {
    color: #ecf0f1;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.nav-links a:hover {
    background: #3498db;
    color: #fff;
    transform: translateY(-2px);
}

/* ==================== BOTONES ==================== */
a, button, input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #3498db;
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
}

a:hover, button:hover, input[type="submit"]:hover {
    background-color: #e74c3c;
}

/* === CARRITO FLOTANTE === */
nav.navbar .carrito-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #e74c3c;
    border-radius: 50px;
    padding: 10px 20px;
    font-weight: bold;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    z-index: 999;
    transition: all 0.3s ease;
}

nav.navbar .carrito-float:hover {
    background: #c0392b;
    transform: scale(1.05);
}

/* Contador del carrito */
nav.navbar .carrito-float span {
    background: #2ecc71;
    color: #fff;
    font-size: 13px;
    padding: 3px 8px;
    border-radius: 50%;
    font-weight: bold;
}

/* ====================== Catálogo ====================== */
.catalogo {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
    margin-top: 100px;
}

.producto {
    background: #fff;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}

.producto:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

/* Imagen o placeholder */
.producto img, .producto .placeholder {
    width: 100%;
    height: 250px;
    border-radius: 10px;
    margin-bottom: 15px;
    object-fit: cover;
    background: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    font-weight: bold;
    font-size: 18px;
}
.producto:hover img, .producto:hover .placeholder {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.producto h3 { font-size: 18px; color: #2c3e50; margin-bottom: 8px; }
.producto p { font-size: 14px; color: #555; margin-bottom: 8px; }
.precio { font-weight: bold; color: #e74c3c; font-size: 16px; margin-bottom: 10px; }

/* Catálogo de 5 columnas y centrado */
.catalogo {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 25px;
    margin: 20px auto;
    max-width: 1400px; /* centrado y límite ancho */
}

/* ====================== Carrito ====================== */
.carrito-vacio {
    text-align: center;
    background: #fff;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    max-width: 500px;
    margin: 50px auto;
}
.carrito-vacio h2 { font-size: 28px; color: #2c3e50; margin-bottom: 15px; }
.carrito-vacio p { font-size: 16px; color: #555; margin-bottom: 25px; }
.carrito-vacio a.btn-icon {
    background-color: #3498db;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s;
}
.carrito-vacio a.btn-icon:hover { background-color: #e74c3c; }

/* Tabla del carrito */
table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-top: 20px;
}
table th, table td {
    padding: 12px 15px;
    text-align: center;
    border-bottom: 1px solid #eee;
}
table th {
    background: #3498db;
    color: white;
    font-weight: 600;
}
table tr:last-child td { border-bottom: none; }

.subtotal { font-weight: bold; color: #e74c3c; }

.btn-eliminar {
    background: #e74c3c;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s;
}
.btn-eliminar:hover { background: #c0392b; }

/* Total y finalizar */
.carrito-total {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
}
.carrito-total h2 { margin: 0; font-size: 20px; color: #2c3e50; }
.carrito-total a { padding: 10px 20px; }

/* Inputs cantidad */
input.cantidad {
    width: 60px;
    padding: 5px;
    text-align: center;
    border-radius: 6px;
    border: 1px solid #ccc;
}

/* ====================== Modal Galería ====================== */
.modal {
    display: none; /* oculto por defecto */
    position: fixed;
    z-index: 10000;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.85); /* Fondo oscuro */
    transition: opacity 0.3s ease;
}

/* Contenedor de las imágenes */
.modal-content {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 20px;
    overflow-x: auto;
    max-width: 90%;
    margin: 0 auto;
}

/* Imagen dentro del modal */
.modal-content img.zoom-img {
    max-height: 80vh;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.4);
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.modal-content img.zoom-img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0,0,0,0.5);
}

/* Botón cerrar */
.modal .cerrar {
    position: absolute;
    top: 20px;
    right: 25px;
    color: #fff;
    font-size: 35px;
    font-weight: bold;
    transition: color 0.3s;
    cursor: pointer;
    user-select: none;
}

.modal .cerrar:hover {
    color: #e74c3c;
}

/* Scroll horizontal suave en dispositivos pequeños */
@media (max-width: 1024px) {
    .modal-content {
        flex-wrap: nowrap;
        overflow-x: scroll;
        padding: 10px;
    }

    .modal-content img.zoom-img {
        max-height: 60vh;
    }
}

/* Efecto de transición al mostrar modal */
.modal.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {opacity: 0;}
    to {opacity: 1;}
}

/* Modal slider */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.8);
    transition: 0.3s;
}
.modal.show { display: block; }

.modal-slider {
    position: relative;
    max-width: 800px;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    display: flex;
    overflow: hidden;
    width: 100%;
    border-radius: 10px;
}

.zoom-img {
    max-width: 100%;
    max-height: 80vh;
    margin: auto;
    transition: transform 0.3s;
    display: none;
}
.zoom-img.active { display: block; }

.cerrar {
    position: absolute;
    top: 20px;
    right: 35px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}
.cerrar:hover { color: #3498db; }

.prev, .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    margin-top: -22px;
    padding: 16px;
    color: white;
    font-weight: bold;
    font-size: 28px;
    border-radius: 3px;
    user-select: none;
    background: rgba(0,0,0,0.3);
    transition: 0.3s;
}
.prev:hover, .next:hover { background: rgba(52,152,219,0.7); }
.prev { left: 0; }
.next { right: 0; }

/* Cada contenedor de slide */
.modal-slide {
    position: relative; /* esto permite que la marca se posicione sobre la imagen */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Imagen del modal */
.modal-slide img.zoom-img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 10px;
    display: block;
}

/* Marca de agua centrada */
.marca-agua {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 8vw; /* tamaño relativo a la ventana */
    font-weight: bold;
    color: rgba(255, 255, 255, 0.25); /* translucida */
    text-shadow: 2px 2px 10px rgba(0,0,0,0.4);
    text-align: center;
    pointer-events: none;
    white-space: nowrap;
    user-select: none;
    z-index: 10; /* asegurarse que esté sobre la imagen */
}

/* ====================== Responsivo ====================== */
@media (max-width: 1024px) {
    
    .catalogo { 
        grid-template-columns: 1fr;
        
    }
    
    table th, table td { 
        font-size: 14px; padding: 8px;
        
    }
    
        
    .carrito-total { flex-direction: column;
        align-items: flex-start; 
        gap: 10px; }

    .search-container {
        align-items: stretch;
        max-width: 100%;
        padding: 5px;
        margin: 0;
    }
        
    .sobre_nosotros{
        display: none;
    }
    
        .modal-slide img.zoom-img {
        max-height: 50vh;
    }
    .marca-agua {
        font-size: 14vw;
    }
    .cerrar {
        font-size: 24px;
    }
    .prev, .next {
        font-size: 20px;
        padding: 10px;
    }
    .producto img, .producto .placeholder {
        height: 300px;
    }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 992px) {
    nav.navbar {
        flex-direction: column;
        height: auto;
        padding: 20px;
        text-align: center;
    }
        .sobre_nosotros{
        display: none;
    }
      body {
    padding-top: 280px; /* altura navbar en mobile */
  }

    .navbar-title {
        font-size: 22px;
        margin: 10px 0;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .search-container {
        margin-top: 12px;
        width: 100%;
    }

    .search-container input#buscador {
        width: 100%;
    }
    .producto img, .producto .placeholder {
        height: 300px;
    }
}

@media (max-width: 600px) {
    .logo-img {
        width: 60px;
        height: 60px;
    }
        .sobre_nosotros{
        display: none;
    }
      body {
    padding-top: 280px; /* altura navbar en mobile */
  }

    .navbar-title {
        font-size: 18px;
    }

    nav.navbar .btn-inicio {
        padding: 8px 12px;
        font-size: 14px;
    }

    .nav-links a {
        font-size: 13px;
        padding: 5px 8px;
    }
}
