/* ===== VARIABLES ===== */
:root {
    --fondo: #1F2933;
    --panel: #374151;
    --input: #4B5563;
    --borde: #6B7280;
    --acento: #F97316;
    --acento-hover: #EA580C;
    --texto: #F9FAFB;
}

/* ===== BASE ===== */
body {
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
    color: white;
    background: linear-gradient(135deg, #1F2933, #111827);
    min-height: 100vh;
    transition: background 0.8s ease;
    overflow-x: hidden;
}

/* ===== FONDO ANIMADO CON CUADRÍCULA ===== */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 200%;
    height: 200%;
    background:
        linear-gradient(rgba(249,115,22,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(249,115,22,0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: moveBg 25s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes moveBg {
    from { transform: translate(0, 0); }
    to   { transform: translate(-200px, -200px); }
}

/* ===== BANNER PRINCIPAL ===== */
.banner {
    height: 280px;
    width: 100%;
    position: relative;
    z-index: 1;
    background: linear-gradient(
        135deg,
        rgba(17, 24, 39, 0.98),
        rgba(31, 41, 51, 0.98),
        rgba(55, 65, 81, 0.95)
    );
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid rgba(249,115,22,0.25);
}

.banner::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        circle at center,
        rgba(249,115,22,0.08),
        transparent 70%
    );
}

.banner-content {
    text-align: center;
    z-index: 1;
    animation: fadeSlide 1.2s ease forwards;
}

.banner-content h1 {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.banner-content p {
    font-size: 18px;
    opacity: 0.9;
}

@keyframes fadeSlide {
    from { opacity: 0; transform: translateY(25px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ===== USER PANEL (logout) ===== */
.user-panel {
    position: absolute;
    top: 20px;
    right: 30px;
    display: flex;
    gap: 15px;
    align-items: center;
    z-index: 10;
}

.logout-form {
    display: inline;
    margin: 0;
    padding: 0;
}

/* ✅ LOGOUT BTN — especificidad alta para no ser pisado por "button" global */
button.logout-btn {
    background: #EF4444 !important;
    color: white !important;
    padding: 6px 14px !important;
    border-radius: 6px !important;
    border: none !important;
    cursor: pointer !important;
    font-size: 14px !important;
    font-weight: 600;
    transition: background 0.2s ease;
}

button.logout-btn:hover {
    background: #DC2626 !important;
}

/* ===== BOTONES GENERALES (no afectan logout) ===== */
button:not(.logout-btn) {
    padding: 12px 25px;
    border: none;
    border-radius: 30px;
    background: var(--acento);
    cursor: pointer;
    font-size: 16px;
    color: white;
    font-weight: bold;
    transition: background 0.3s ease, transform 0.2s ease;
}

button:not(.logout-btn):hover {
    background: var(--acento-hover);
    transform: scale(1.05);
}

.filtros, .marcas, .agente-btn, footer, .productos, .pedido, .chat-container {
    position: relative;
    z-index: 1;
}

/* ===== MAIN HEADER ===== */
.main-header {
    text-align: center;
    padding: 40px;
}

/* ===== FILTROS ===== */
.filtros {
    max-width: 900px;
    margin: 30px auto;
    text-align: center;
}

#buscador {
    width: 80%;
    padding: 14px 20px;
    font-size: 16px;
    border-radius: 30px;
    border: none;
    outline: none;
    box-shadow: 0 6px 18px rgba(0,0,0,0.2);
    margin-bottom: 20px;
}

.botones-filtro {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.botones-filtro button {
    padding: 10px 18px !important;
    border-radius: 25px !important;
    background: rgba(249,115,22,0.2) !important;
    color: white;
    font-weight: 600;
    border: 1px solid rgba(249,115,22,0.4) !important;
}

.botones-filtro button:hover {
    background: var(--acento) !important;
    transform: translateY(-2px);
}

/* ===== MARCAS ===== */
.marcas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 30px;
    padding: 40px;
}

.marca {
    background: rgba(55, 65, 81, 0.6);
    border: 1px solid rgba(107, 114, 128, 0.3);
    padding: 20px;
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.4s, box-shadow 0.4s, background 0.4s, border-color 0.3s;
    transform-style: preserve-3d;
    will-change: transform;
    cursor: pointer;
}

.marca img {
    max-width: 140px;
    max-height: 80px;
    transition: transform 0.5s;
}

.marca:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
    border-color: rgba(249,115,22,0.5);
}

.marca:hover img {
    transform: scale(1.2);
}

.marca-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
}

.marca-header img {
    max-height: 80px;
}

/* ===== PRODUCTOS ===== */
.productos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px,1fr));
    gap: 20px;
    padding: 20px;
}

.producto {
    background: rgba(255,255,255,0.12);
    padding: 20px;
    border-radius: 15px;
    cursor: pointer;
    transition: transform 0.3s, background 0.3s;
}

.producto:hover {
    transform: scale(1.05);
    background: rgba(255,255,255,0.25);
}

/* ===== PEDIDO ===== */
.pedido {
    padding: 20px;
}

/* ===== BOTÓN AGENTE IA ===== */
.agente-btn {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 40px 0;
}

.agente-btn a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 18px 40px;
    background: var(--acento);
    color: white;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 10px 25px rgba(249,115,22,0.35);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.agente-btn a:hover {
    background: var(--acento-hover);
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 18px 40px rgba(249,115,22,0.5);
}

/* ===== BOTÓN VOLVER ===== */
.btn-volver {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 22px;
    margin: 20px;
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 50px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
    transition: all 0.35s ease;
    position: relative;
    overflow: hidden;
}

.btn-volver .icon {
    font-size: 18px;
    transition: transform 0.35s ease;
}

.btn-volver:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.35);
}

.btn-volver:hover .icon {
    transform: translateX(-5px);
}

.btn-volver::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.25), transparent);
    transition: left 0.5s ease;
}

.btn-volver:hover::before {
    left: 100%;
}

/* ===== CHAT AGENTE IA ===== */
/* Los estilos del chat viven en agente.html para no pisarse */
.chat-container {
    max-width: 900px;
    margin: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 80vh;
}

/* ===== UPLOAD IMAGEN ===== */
/* upload-box estilos viven en agente.html */

/* ===== SCROLLBAR PERSONALIZADA ===== */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #111827;
}
::-webkit-scrollbar-thumb {
    background: #F97316;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #EA580C;
}

/* ===== RIPPLE EFFECT ===== */
button {
    position: relative;
    overflow: hidden;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.35);
    transform: scale(0);
    animation: ripple-anim 0.55s linear;
    pointer-events: none;
}

@keyframes ripple-anim {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ===== CASCADA DE TARJETAS ===== */
.marca.cascade {
    opacity: 0;
    transform: translateY(30px);
}

.marca.cascade.visible {
    animation: card-in 0.5s ease forwards;
}

@keyframes card-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}