/* === GALERÍA DE PRODUCTOS (galeria.html) === */

.galeria-detalle h2 {
    
    color: #7e22ce;
    text-align: center;
    text-transform: uppercase;
    font-size: 1.8rem;
    margin-bottom: 24px;
}

.galeria-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 28px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px 60px;
}

.galeria-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    text-align: center;
    transition: transform 0.2s;
}

.galeria-card:hover {
    transform: translateY(-4px);
}

.galeria-card img {
    width: 100%;
    height: 240px;
    object-fit: contain;
    background-color: #fdf2f8;
    padding: 12px;
    box-sizing: border-box;
}

.galeria-card .galeria-info {
    padding: 16px;
}

.galeria-card h4 {
    font-size: 1rem;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.precio-tag {
    display: inline-block;
    background: #E8A0BF;
    color: white;
    font-weight: bold;
    padding: 6px 16px;
    border-radius: 20px;
}

.producto-descripcion {
    font-size: 0.82rem;
    color: #6b21a8;
    margin: 6px 0 4px 0;
    line-height: 1.4;
}

/* === FORMULARIO ADMIN (subir producto) === */

.form-admin-galeria {
    max-width: 500px;
    margin: 0 auto 40px;
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.form-admin-galeria h3 {
    
    color: #7e22ce;
    text-align: center;
    margin-bottom: 16px;
}

.form-admin-galeria form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-admin-galeria input,
.form-admin-galeria textarea {
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.95rem;
}

.form-admin-galeria textarea {
    resize: vertical;
    min-height: 60px;
}

/* Acciones de admin en cada tarjeta (editar/eliminar, futuro) */
.galeria-acciones {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}

.btn-eliminar {
    background-color: #e57373;
}

.btn-eliminar:hover {
    background-color: #d35f5f;
}

.galeria-detalle {
    background-image: url('../img/prod2.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* === ZOOM en imagen al pasar el mouse === */
.galeria-card {
    overflow: hidden;
}

.galeria-card img {
    transition: transform 0.4s ease;
}

.galeria-card:hover img {
    transform: scale(1.08);
}

/* === MODAL DE ZOOM ESTILO MERCADOLIBRE === */
.img-zoom-wrap {
    position: relative;
    cursor: zoom-in;
    overflow: hidden;
}

.zoom-hint {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 12px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    white-space: nowrap;
}

.img-zoom-wrap:hover .zoom-hint {
    opacity: 1;
}

.modal-zoom-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.modal-zoom-overlay.activo {
    display: flex;
}

.cerrar-zoom-btn {
    position: fixed;
    top: 20px;
    right: 28px;
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.cerrar-zoom-btn:hover {
    background: rgba(255,255,255,0.3);
}

.zoom-container {
    width: 80vw;
    height: 80vh;
    overflow: hidden;
    border-radius: 12px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: crosshair;
}

#zoom-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.1s ease;
    transform-origin: 50% 50%;
    user-select: none;
}

/* === MODAL DE EDICIÓN === */
.modal-editar-box {
    background: white;
    border-radius: 16px;
    padding: 28px;
    width: 100%;
    max-width: 420px;
    position: relative;
}

.modal-editar-box h3 {
    font-weight: bold;
    color: #4A2370;
    text-align: center;
    margin-bottom: 16px;
}

.modal-editar-box form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-editar-box input,
.modal-editar-box textarea {
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.95rem;
}

.modal-editar-box small {
    color: #8A7A95;
    font-size: 0.75rem;
    margin-top: -6px;
}

.modal-editar-box textarea {
    resize: vertical;
    min-height: 60px;
}

/* Botones de acción en cada tarjeta */
.galeria-acciones {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

.btn-editar {
    background-color: #7B4F9E;
}

.btn-editar:hover {
    background-color: #634082;
}

.btn-eliminar {
    background-color: #e57373;
}

.btn-eliminar:hover {
    background-color: #d35f5f;
}

/* === CONTADOR DE CANTIDAD + BOTÓN COMPRAR === */
.cantidad-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 14px 0 10px;
}

.btn-cantidad {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1.5px solid #D4C8DC;
    background: transparent;
    color: #7B4F9E;
    font-weight: bold;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.btn-cantidad:hover {
    background-color: #F3E5FB;
}

.cantidad-valor {
    min-width: 24px;
    text-align: center;
    font-weight: bold;
    color: #2A1A35;
    font-size: 15px;
}

.btn-comprar {
    width: 100%;
    background-color: #7B4F9E;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
}

.btn-comprar:hover {
    background-color: #634082;
}

/* === BUSCADOR DE LA GALERÍA === */
.buscador-galeria {
    max-width: 400px;
    margin: 0 auto 24px;
    padding: 0 16px;
}

#buscar-galeria {
    width: 100%;
    padding: 10px 16px;
    border: 1.5px solid #D4C8DC;
    border-radius: 20px;
    font-size: 0.9rem;
    font-family: inherit;
    box-sizing: border-box;
}

#buscar-galeria:focus {
    outline: none;
    border-color: #7B4F9E;
}

/* === BADGE DE STOCK === */
.stock-tag {
    display: block;
    font-size: 0.75rem;
    font-weight: bold;
    color: #2A7A52;
    margin: 6px 0;
}

.stock-tag.poco {
    color: #A05A00;
}

.stock-tag.agotado {
    color: #c0392b;
}

.mensaje-agotado {
    font-size: 0.8rem;
    color: #c0392b;
    font-style: italic;
    margin: 10px 0;
}
