@charset "utf-8";
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  /* Paleta de marca (tomada de juguetron_logistics/DESIGN.md) */
  --jt-primary: #006e0d;
  --jt-primary-bright: #39a935;
  --jt-on-primary: #ffffff;
  --jt-secondary: #5e5e60;
  --jt-bg: #f5fced;
  --jt-surface: #ffffff;
  --jt-surface-alt: #eff6e8;
  --jt-surface-high: #e4eadc;
  --jt-border: #becab6;
  --jt-text: #171d15;
  --jt-text-muted: #3f4a3b;
  --jt-danger: #ba1a1a;
  --jt-danger-bg: #ffdad6;
  --jt-success-bg: #e3f6e9;
  --jt-lego-yellow: #ffed00;
  /* Paleta pastel para los botones de estado (look "juguete", sin perder legibilidad) */
  --jt-state-1: #d7f2da; /* verde pastel */
  --jt-state-2: #fff3b0; /* amarillo pastel */
  --jt-state-3: #cfe4fb; /* azul pastel */
  --jt-state-4: #ffd9d0; /* naranja/rojo pastel */
  --jt-state-5: #e6d9fb; /* morado pastel */
  --radius-sm: 0.5rem;
  --radius-lg: 1rem;
  --sidebar-w: 240px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: var(--jt-bg);
  color: var(--jt-text);
}

h1, h2, h3, .jt-heading {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  color: var(--jt-text);
}

/* ---------- Shell con sidebar (paginas autenticadas) ---------- */
.jt-app-shell {
  display: flex;
  min-height: 100vh;
}

.jt-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--jt-surface);
  border-right: 1px solid var(--jt-surface-high);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.jt-sidebar-header {
  padding: 24px 20px;
  text-align: center;
  border-bottom: 1px solid var(--jt-surface-high);
}
.brand-logo-sidebar {
  max-width: 160px;
  height: auto;
  margin-bottom: 8px;
}
.jt-sidebar-header .brand-sub {
  font-size: 11px;
  color: var(--jt-text-muted);
  margin-top: 2px;
}

.jt-sidebar-nav {
  flex: 1;
  padding: 16px 12px;
}
.jt-sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--jt-text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
}
.jt-sidebar-nav a:hover { background: var(--jt-surface-alt); }
.jt-sidebar-nav a.active {
  background: var(--jt-surface-alt);
  color: var(--jt-primary);
  font-weight: 600;
  border-right: 3px solid var(--jt-primary);
}
.jt-sidebar-nav .icon { font-size: 17px; line-height: 1; }

.jt-sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--jt-surface-high);
}
.jt-sidebar-footer .user {
  font-size: 12.5px;
  color: var(--jt-text-muted);
  margin-bottom: 10px;
  word-break: break-word;
}
.jt-sidebar-footer form { margin: 0; }
.sidebar-change-pw {
  display: block;
  font-size: 12.5px;
  color: var(--jt-primary);
  text-decoration: none;
  margin-bottom: 10px;
  font-weight: 600;
}
.sidebar-change-pw:hover { text-decoration: underline; }

.jt-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.jt-main-content {
  flex: 1;
  padding: 40px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

@media (max-width: 800px) {
  .jt-sidebar { display: none; }
  .jt-main-content { padding: 20px; }
}

/* ---------- Componentes compartidos ---------- */
.jt-card {
  background: var(--jt-surface);
  border: 1px solid var(--jt-surface-high);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
  padding: 24px;
}

.jt-page-header { margin-bottom: 28px; }
.jt-page-header h1 { font-size: 28px; margin: 0 0 6px; }
.jt-page-header p { color: var(--jt-text-muted); margin: 0; }

/* Encabezado colorido del directorio, con iconos de juguetes decorativos */
.jt-hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 56px 24px;
  margin-bottom: 24px;
  border-radius: var(--radius-lg);
  background-image:
    linear-gradient(160deg, rgba(0,60,8,0.72) 0%, rgba(0,30,4,0.75) 100%),
    url('/images/directorio-banner.jpg');
  background-size: cover;
  background-position: center;
  box-shadow: 0 10px 30px rgba(0,110,13,0.25);
}
.jt-hero h1 { color: white; margin: 0 0 8px; font-size: 30px; text-transform: uppercase; letter-spacing: 0.02em; }
.jt-hero p { color: rgba(255,255,255,0.92); margin: 0; font-size: 15px; text-transform: uppercase; letter-spacing: 0.03em; }
.jt-hero-icon {
  position: absolute;
  font-size: 34px;
  opacity: 0.28;
  pointer-events: none;
}
.jt-hero-icon-1 { top: 10px; left: 6%; transform: rotate(-12deg); }
.jt-hero-icon-2 { bottom: 12px; left: 14%; font-size: 26px; transform: rotate(10deg); }
.jt-hero-icon-3 { top: 16px; right: 8%; transform: rotate(14deg); }
.jt-hero-icon-4 { bottom: 8px; right: 15%; font-size: 30px; transform: rotate(-8deg); }
.jt-hero-icon-5 { top: 50%; left: 3%; transform: translateY(-50%) rotate(-6deg); color: #ffed00; }
@media (max-width: 700px) { .jt-hero-icon { display: none; } }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  background: var(--jt-primary);
  color: var(--jt-on-primary);
  border: none;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  text-decoration: none;
}
.btn:hover { background: #005a0a; }
.btn.outline {
  background: transparent;
  color: var(--jt-primary);
  border: 2px solid var(--jt-primary);
}
.btn.outline:hover { background: var(--jt-primary); color: white; }
.btn.secondary { background: var(--jt-surface-alt); color: var(--jt-text); border: 1px solid var(--jt-border); }
.btn.danger { background: var(--jt-danger); }
.btn.small { padding: 6px 12px; font-size: 12.5px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--jt-text-muted);
}

input[type=text], input[type=password], input[type=email], select {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1.5px solid var(--jt-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
  font-family: inherit;
  background: var(--jt-surface);
  color: var(--jt-text);
}
input:focus, select:focus {
  outline: none;
  border-color: var(--jt-primary);
  border-width: 2px;
}

.jt-alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin-bottom: 18px;
}
.jt-alert.error { background: var(--jt-danger-bg); color: var(--jt-danger); border: 1px solid #f4c7c1; }
.jt-alert.notice { background: var(--jt-success-bg); color: var(--jt-primary); border: 1px solid #bfe3cc; word-break: break-word; }

h2.section-title {
  font-size: 18px;
  margin-top: 0;
  font-family: 'Montserrat', sans-serif;
}

table.jt-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.jt-table th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--jt-secondary);
  border-bottom: 2px solid var(--jt-surface-alt);
  padding: 10px 8px;
}
table.jt-table td { padding: 10px 8px; border-bottom: 1px solid var(--jt-surface-alt); vertical-align: middle; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.badge.on { background: var(--jt-success-bg); color: var(--jt-primary); }
.badge.off { background: var(--jt-danger-bg); color: var(--jt-danger); }
.badge.lego { background: var(--jt-lego-yellow); color: #4a3b00; margin-left: 6px; }

.jt-form-inline { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.jt-form-inline > div { min-width: 160px; }

.jt-plain-page {
  max-width: 640px;
  margin: 60px auto;
  padding: 0 20px;
}

/* ---------- Stepper visual (directorio) ---------- */
.jt-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 24px;
}
.jt-step { display: flex; align-items: center; gap: 8px; opacity: 0.5; }
.jt-step.active, .jt-step.done { opacity: 1; }
.jt-step-circle {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--jt-surface-high);
  color: var(--jt-text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  transition: background 0.2s ease, color 0.2s ease;
}
.jt-step.active .jt-step-circle { background: var(--jt-primary); color: white; }
.jt-step.done .jt-step-circle { background: var(--jt-primary-bright); color: white; }
.jt-step-label { font-size: 13px; font-weight: 600; color: var(--jt-text); }
.jt-step-line {
  width: 60px; height: 2px;
  background: var(--jt-surface-high);
  transition: background 0.2s ease;
}
.jt-step-line.done { background: var(--jt-primary-bright); }
@media (max-width: 600px) {
  .jt-step-line { width: 28px; }
  .jt-step-label { display: none; }
}

/* ---------- Tarjetas esqueleto (mientras cargan las tiendas) ---------- */
.skeleton-card {
  background: var(--jt-surface);
  border: 1px solid var(--jt-surface-high);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.skeleton-card .skeleton-header { height: 84px; background: var(--jt-surface-high); }
.skeleton-card .skeleton-body { padding: 16px; }
.skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: var(--jt-surface-high);
  margin-bottom: 10px;
  animation: skeleton-pulse 1.1s ease-in-out infinite;
}
.skeleton-line.short { width: 60%; }
@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ---------- Login (sin sidebar) ---------- */
.jt-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image:
    linear-gradient(160deg, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.45) 100%),
    url('/images/tienda-fondo.jpg');
  background-size: cover;
  background-position: center;
}
.jt-login-card {
  width: 380px;
  background: var(--jt-surface);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
  text-align: center;
}
.brand-logo {
  max-width: 220px;
  height: auto;
  margin-bottom: 18px;
}
.jt-login-card h1 { font-size: 21px; margin: 0 0 4px; text-align: center; }
.jt-login-card p.subtitle { margin: 0 0 24px; font-size: 13px; color: var(--jt-text-muted); text-align: left; }
.jt-login-card form { text-align: left; }

.jt-login-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--jt-text-muted);
  font-size: 12px;
  margin: 18px 0 14px;
}
.jt-login-divider::before, .jt-login-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--jt-border);
}
.jt-login-divider span { padding: 0 10px; }

.sso-btn {
  width: 100%;
  background: var(--jt-surface);
  color: var(--jt-text);
  border: 1.5px solid var(--jt-border);
}
.sso-btn:hover { background: var(--jt-surface-alt); }
.sso-hint {
  font-size: 11.5px;
  color: var(--jt-text-muted);
  text-align: center;
  margin: 10px 0 0;
}

/* ---------- Directorio: filtro, estados, tiendas ---------- */
.jt-toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.jt-toolbar input[type=text] { margin-bottom: 0; flex: 1; min-width: 220px; }

.states-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 28px;
}
.state-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  color: var(--jt-text);
  background: var(--jt-state-1);
  transition: transform 0.1s ease;
}
.state-btn-icon { font-size: 15px; }
.state-btn:hover { transform: translateY(-2px); filter: brightness(0.97); }
.state-btn.active {
  outline: 3px solid var(--jt-primary);
  outline-offset: 1px;
}
/* Paleta rotativa tipo juguete para que la cuadricula de estados no se vea plana */
.states-grid .state-btn:nth-child(5n+1) { background: var(--jt-state-1); }
.states-grid .state-btn:nth-child(5n+2) { background: var(--jt-state-2); }
.states-grid .state-btn:nth-child(5n+3) { background: var(--jt-state-3); }
.states-grid .state-btn:nth-child(5n+4) { background: var(--jt-state-4); }
.states-grid .state-btn:nth-child(5n+5) { background: var(--jt-state-5); }

.stores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}
.store-card {
  background: var(--jt-surface);
  border: 1px solid var(--jt-surface-high);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.store-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 26px rgba(0,0,0,0.12);
}
.store-card .store-card-header {
  height: 84px;
  background: linear-gradient(135deg, var(--jt-primary-bright), var(--jt-primary));
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  color: white;
}
.store-card .store-card-header .icon-circle {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  color: var(--jt-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}
.store-card .store-card-header h3 {
  color: white;
  font-size: 16px;
  margin: 0;
}
.store-card .store-card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.store-card .store-card-body .code { font-size: 11.5px; color: var(--jt-text-muted); margin-bottom: 12px; }
.store-card .store-card-body button { margin-top: auto; }

/* Tiendas formato LEGO (codigo T07xx): identificador en amarillo en vez de verde. */
.store-card.lego .store-card-header {
  background: linear-gradient(135deg, #ffed00, #f2c300);
}
.store-card.lego .store-card-header h3,
.store-card.lego .store-card-header .lego-tag {
  color: #4a3b00;
}
.store-card.lego .store-card-header .icon-circle {
  color: #a68b00;
}
.lego-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-left: 6px;
  opacity: 0.85;
}

iframe.booking-frame {
  width: 100%;
  height: 640px;
  border: 1px solid var(--jt-surface-high);
  border-radius: var(--radius-lg);
  background: white;
}
