/* ================= RESET ================= */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ================= VARIABLES ================= */
:root {
    --bg-main: #0f172a;
    --bg-card: rgba(255, 255, 255, 0.95);

    --primary: #FF8C42;
    --primary-hover: #FF7F50;
    --accent: #E67E22;

    --text-main: #e2e8f0;
    --text-dark: #5a2e0c;
    --text-muted: #94a3b8;

    --border: #334155;

    --radius: 12px;
    --shadow: 0 15px 35px rgba(0,0,0,0.4);
}

/* ================= BODY ================= */
body {
    font-family: 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: var(--text-main);
}

/* ================= NAVBAR ================= */
.navbar {
    background: rgba(0,0,0,0.9) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.navbar-brand {
    font-weight: bold;
    color: var(--primary) !important;
}

/* ================= BOTONES ================= */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    border: none;
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-outline-success {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-outline-success:hover {
    background: var(--primary);
    color: white;
}

/* ================= SIDEBAR ================= */
.offcanvas {
    background: #020617;
}

.offcanvas a {
    transition: 0.3s;
}

.offcanvas a:hover {
    color: var(--primary);
}

/* ================= CARRUSEL ================= */
.carousel-item img {
    border-radius: 12px;
}

.carousel-caption {
    background: rgba(0,0,0,0.6);
    border-radius: 10px;
}

/* ================= GALERIA PRO ================= */
.galeria {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    padding: 20px;
}

/* TARJETA */
.producto-card {
    background: var(--bg-card);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: 0.3s;
    display: flex;
    flex-direction: column;
}

.producto-card:hover {
    transform: translateY(-5px) scale(1.02);
}

/* IMAGEN */
.producto-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    transition: 0.3s;
}

.producto-card:hover img {
    transform: scale(1.05);
}

/* INFO */
.producto-info {
    padding: 12px;
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.producto-info h5 {
    font-size: 14px;
    margin-bottom: 5px;
}

/* PRECIO */
.producto-precio {
    color: var(--accent);
    font-weight: bold;
    margin-top: auto;
}

/* BOTÓN */
.producto-btn {
    margin-top: 8px;
    padding: 6px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    cursor: pointer;
    transition: 0.3s;
}

.producto-btn:hover {
    opacity: 0.9;
}

/* ================= FORMULARIOS ================= */
.card {
    background: #1e293b;
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow);
}

.form-group label {
    font-size: 14px;
    color: var(--text-muted);
}

.form-group input {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: #0f172a;
    color: white;
}

.form-group input:focus {
    border-color: var(--primary);
    outline: none;
}

/* ================= LOGIN ================= */
.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* ================= ADMIN ================= */
.admin-wrap {
    max-width: 1200px;
    margin: auto;
    padding: 20px;
}

.admin-table img {
    max-width: 120px;
    border-radius: 8px;
}

/* ================= ALERTAS ================= */
.alert-error {
    background: #7f1d1d;
    color: #fecaca;
    padding: 10px;
    border-radius: 6px;
}

/* ================= FOOTER PRO ================= */
.mega-footer {
    background: linear-gradient(135deg, #FF8C42, #FF7F50);
    color: white;
    padding: 50px 20px 20px;
    margin-top: 40px;
}

.footer-title {
    font-weight: bold;
    margin-bottom: 10px;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links a {
    color: white;
    text-decoration: none;
    transition: 0.3s;
}

.footer-links a:hover {
    padding-left: 5px;
}

.footer-line {
    border-top: 1px solid rgba(255,255,255,0.3);
    margin: 20px 0;
}

@media (max-width: 1200px) {
    .galeria {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 900px) {
    .galeria {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .galeria {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 400px) {
    .galeria {
        grid-template-columns: 1fr;
    }
}
/* TOPBAR */
.topbar {
    position: fixed;   /*  CAMBIO CLAVE */
    top: 0;
    left: 0;
    width: 100%;

    z-index: 1000;     /* menor que sidebar */
}
/*  SIDEBAR DEFINITIVA (SIN BUGS) */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;

    width: 260px;
    height: 100vh;

    background: #020617;

    z-index: 999999;

    padding: 25px 20px;

    display: flex;
    flex-direction: column;

    /* 🔥 CLAVE: usar transform en vez de left */
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

/* ACTIVA */
.sidebar.active {
    transform: translateX(0);
}
.container {
    margin-top: 70px; /*  evita que el contenido quede debajo */
}
/* LINKS */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 99999 !important; /* asegurar que quede encima */
}

.sidebar a:hover {
    background: #1e293b;
    color: white;
}

/* ICONOS */
.sidebar i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

/* LOGOUT */
.sidebar .logout {
    margin-top: auto;
    background: #7f1d1d;
    color: #fecaca;
    text-align: center;
}

.carousel,
.carousel-inner,
.carousel-item,
.carousel-caption,
.carousel-control-prev,
.carousel-control-next {
    z-index: 0 !important;
    position: relative; /* evitar contextos inesperados */
}

/* 🔥ASEGURAR QUE NADA SUPERE LA SIDEBAR */
body {
    position: relative;
    z-index: 0;
    overflow-x: hidden;
}

.sidebar {
    z-index: 999999 !important;
}
.topbar {
    z-index: 9999;
    position: fixed;
}
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}