/* =======================================================
   PALETA FORTUZIA
======================================================= */
:root{
  --brand:   #4B2F82;   /* morado principal - botones */
  --accent:  #77B147;   /* verde acento */
  --aux:     #786D96;   /* morado grisáceo */

  --chrome:  #B2C1E3;   /* CELESTE para header/top/footer */
  --paper:   #FFFFFF;   /* fondo central BLANCO */
  --text:    #000000;
  --muted:   #6b6f78;
  --white:   #FFFFFF;

  --shadow-sm: 0 6px 18px rgba(20,30,60,.06);
  --shadow-md: 0 10px 24px rgba(20,30,60,.08);
  --shadow-lg: 0 16px 36px rgba(20,30,60,.10);
}

/* =======================================================
   RESET / BASE
======================================================= */
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:var(--paper);
  color:var(--text);
  font-family:Inter,system-ui,Segoe UI,Roboto,Arial,sans-serif;
  display:flex;flex-direction:column;min-height:100vh;
}
img{max-width:100%;height:auto;display:block}
#app{display:flex;flex-direction:column;min-height:100vh}
main{flex:1;background:var(--paper)}
.container{width:min(1180px,93%);margin-inline:auto}
.muted{color:var(--muted)}
.mono{font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace}
html{-webkit-text-size-adjust:100%}
.btn{white-space:nowrap;max-width:100%}

/* =======================================================
   TOP STRIP & HEADER (CELESTE)
======================================================= */
.top-strip{
  background:var(--chrome);
  color:#111;
  text-align:center;
  font-weight:800;
  letter-spacing:.5px;
  font-size:12px;
  padding:8px 10px;
}
.header{
  background:var(--chrome);
  color:#111;
  border-bottom:1px solid rgba(0,0,0,.08);
}
.header__wrap{height:78px;display:flex;align-items:center;justify-content:space-between}
.brand{display:flex;align-items:center;gap:12px;text-decoration:none;color:#111}
.brand img{height:46px}
.brand__text{font-family:Montserrat,Inter;font-weight:800;font-size:20px;letter-spacing:.5px;color:#111}
.tagline{font-size:12px;opacity:.9;color:#111}
.nav .btn{
  border:1.5px solid rgba(0,0,0,.25);
  color:#1f2328;
  margin-left:8px;
  background:#fff;
}
.nav .btn:hover{filter:brightness(.98)}
.nav .active{background:#eef2ff}

/* =======================================================
   TOPBAR (paneles internos)
======================================================= */
.topbar{
  background:var(--chrome);
  color:#111;
  padding:12px 0;
  border-bottom:1px solid rgba(0,0,0,.08);
}
.topbar a{color:#1f2328;text-decoration:underline}

/* =======================================================
   BOTONES
======================================================= */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  padding:12px 16px;border-radius:12px;border:2px solid transparent;
  text-decoration:none;font-weight:700;cursor:pointer
}
.btn:disabled{opacity:.6;cursor:not-allowed}
.btn-primary{background:var(--brand);color:#fff}
.btn-primary:hover{filter:brightness(.95)}
.btn-success{background:var(--accent);color:#0b2a0d}
.btn-ghost{background:transparent;color:#2a2a2a;border-color:#2a2a2a}
.btn.outline{background:#fff;border-color:#dfe3ee;color:#1f2328}
.btn.danger{background:#d73a49;color:#fff}

/* =======================================================
   FORMULARIOS
======================================================= */
label{display:block;font-weight:600;margin:8px 0 6px}
input,select,textarea{
  width:100%;
  padding:10px 12px;
  border:1px solid #cfd4e2;
  border-radius:10px;
  background:#fff;
  font:inherit;
  outline:none;
}
input:focus,select:focus,textarea:focus{
  border-color:#9aa3b8;
  box-shadow:0 0 0 4px rgba(75,47,130,.12);
}
.form-inline{display:flex;gap:10px;align-items:center;flex-wrap:wrap}

/* =======================================================
   TARJETAS / TABLAS
======================================================= */
.card{
  background:#fff;border:1px solid #e3e3e3;border-radius:14px;padding:16px;
  box-shadow:var(--shadow-sm);
}
.table{width:100%;border-collapse:collapse}
.table th,.table td{padding:10px;border-top:1px solid #e9edf4}
.table th{text-align:left;color:#475569;font-weight:700;font-size:14px}
.table thead tr:first-child th{border-top:0}

/* =======================================================
   ALERTAS
======================================================= */
.alert{
  background:#fff3c4;border:1px solid #f0d98a;border-radius:10px;padding:10px 12px;margin:10px 0
}
.alert.success{background:#e6f7ea;border-color:#bfe6c9}
.alert.error{background:#ffe6e8;border-color:#ffc8cc}

/* =======================================================
   HERO / TÍTULOS
======================================================= */
.hero{padding:34px 0 30px}
.hero h1{
  font-family:Montserrat,Inter,sans-serif;
  font-weight:800;font-size:42px;
  line-height:1.06;text-align:center;margin:6px 0 0;letter-spacing:.5px
}
.hero h1 span{color:#fff;background:var(--brand);padding:2px 8px;border-radius:8px}
.hero .sub{text-align:center;margin:10px 0 18px;letter-spacing:2px}

/* Subtítulo centrado */
.subtitle {
  display:block;
  text-align:center;
  font-family:Montserrat, Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-size:20px;
  font-weight:600;
  letter-spacing:1px;
  margin:6px auto 20px;
  color: var(--text);
}

/* =======================================================
   SLIDER
======================================================= */
.figure{
  position:relative;background:#fff;border-radius:16px;overflow:hidden;border:1px solid #e1e1e1;
  box-shadow:var(--shadow-lg);max-width:1120px;margin:0 auto 18px;
}
.slider{position:relative;overflow:hidden;aspect-ratio:16/9;min-height:420px}
.slides{display:flex;height:100%;transition:transform .4s ease}
.slide{min-width:100%;height:100%;user-select:none;touch-action:pan-y;display:flex;align-items:center;justify-content:center;background:#fff}
.slide img{width:100%;height:100%;object-fit:contain}
.snav{position:absolute;inset:0;display:flex;align-items:center;justify-content:space-between;pointer-events:none}
.sbtn{pointer-events:auto;background:rgba(0,0,0,.55);border:0;color:#fff;width:44px;height:44px;border-radius:999px;display:grid;place-items:center;margin:14px;cursor:pointer}
.sbtn:hover{background:rgba(0,0,0,.7)}

/* =======================================================
   SECTION LISTADO (INDEX)
======================================================= */
.section{padding:30px 0;background:var(--paper)}
.section__head{text-align:center;margin-bottom:16px}
.section__head h2{font-family:Montserrat,Inter;margin:0}
.activities-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap:18px;
}
.activities-grid .tile{
  display:block;
  text-decoration:none;
  color:inherit;
  background:#fff;
  border:1px solid #dfe3ee;
  border-radius:14px;
  overflow:hidden;
  box-shadow:0 8px 24px rgba(20,30,60,.06);
  transition:transform .18s ease, box-shadow .18s ease;
}
.activities-grid .tile:hover{
  transform:translateY(-2px);
  box-shadow:0 14px 32px rgba(20,30,60,.10);
}
.activities-grid .thumb{width:100%;aspect-ratio:16/9;background:#f6f7fb;border-bottom:1px solid #eef1f7;overflow:hidden}
.activities-grid .thumb img{width:100%;height:100%;object-fit:cover}
.activities-grid .body{padding:12px 14px 14px}
.activities-grid .title{font-family:Montserrat,Inter;font-weight:700;margin:0}
.actions{display:flex;gap:12px;justify-content:center;flex-wrap:wrap;margin:18px 0}

/* =======================================================
   LOGIN / SIGNUP
======================================================= */
.login-page{background:var(--paper);display:flex;align-items:center;justify-content:center;padding:40px 16px;}
.login-card{width:min(520px,94%);background:#fff;border:1px solid #e3e3e3;border-radius:16px;padding:20px 18px;box-shadow:var(--shadow-md);}
.login-card h2{margin:0 0 12px;font-family:Montserrat,Inter;font-weight:800;color:#111827;}
.login-card form button.btn{width:100%;margin-top:10px}
.login-card .muted{text-align:center;margin-top:8px}

/* =======================================================
   FOOTER
======================================================= */
.footer{background:var(--chrome);color:#111;margin-top:18px;border-top:1px solid rgba(0,0,0,.08);}
.foot__wrap{display:flex;align-items:center;justify-content:space-between;padding:18px 0}
.social a{color:#1f2328;text-decoration:none;margin-left:12px;opacity:.9}
.social a:hover{opacity:1}

/* =======================================================
   PROGRESO DE ACTIVIDAD (barra)
======================================================= */
.progress-wrap{
  max-width:1120px;margin:18px auto;padding:18px 16px;background:#fff;
  border:1px solid #e3e3e3;border-radius:14px;box-shadow:var(--shadow-sm);
}
.progress-bar{
  height:18px;border-radius:999px;background:#eef1f7;overflow:hidden;border:1px solid #e3e7f2;
}
.progress-fill{
  height:100%;
  background: var(--brand);
  transition: width .6s ease;

  /* ✅ Rayas animadas reactivadas */
  background-image: repeating-linear-gradient(
    45deg,
    rgba(255,255,255,.28) 0 12px,
    rgba(255,255,255,0) 12px 24px
  );
  animation: prog-stripes 1.2s linear infinite;
}
@keyframes prog-stripes{
  0%   { background-position:0 0; }
  100% { background-position:48px 0; }
}

/* =======================================================
   COMBOS
======================================================= */
.combo-section{padding:10px 0 26px;background:var(--paper);}
.combo-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px}
.combo{background:#fff;border:1px solid #e3e3e3;border-radius:16px;padding:16px 14px;box-shadow:var(--shadow-sm);transition:.18s}
.combo:hover{transform:translateY(-2px);box-shadow:0 14px 32px rgba(20,30,60,.10);}
.combo-free{background:rgba(119,177,71,.12);border:1px solid rgba(119,177,71,.35);color:#0b2a0d;padding:8px 10px;border-radius:10px;font-weight:700;}

/* =======================================================
   BADGES DE ESTADÍSTICAS (ADMIN ACTIVIDADES)
======================================================= */
.badge-stats {
  display: inline-flex;
  gap: 8px;
  margin-left: 8px;
  font-size: 13px;
  font-weight: 700;
}
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.badge.disponibles { background: #16a34a; }  /* Verde */
.badge.vendidos    { background: #9333ea; }  /* Morado */
.badge.total       { background: #2563eb; }  /* Azul */
.badge.regalos     { background: #f59e0b; }  /* Naranja */

/* =======================================================
   RESPONSIVE (tablets/phones)
======================================================= */
@media (max-width:1024px){
  .hero h1{font-size:38px}
  .header__wrap{height:auto;padding:10px 0 12px;gap:10px}
  .nav .btn{padding:10px 12px}
}

@media (max-width:768px){
  .hero h1{font-size:32px}

  /* Header en columna y botones anchos */
  .header__wrap{flex-direction:column; align-items:stretch}
  .brand{justify-content:center}
  .nav{
    display:grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap:8px;
  }
  .actions .btn{width:100%}

  /* Grid de actividades: 2 por fila */
  .activities-grid{grid-template-columns: repeat(2, 1fr); gap:14px}

  /* Slider más cómodo en móvil */
  .figure{margin:0 12px 18px;border-radius:14px}
  .slider{
    aspect-ratio:auto;
    min-height:260px;
  }
  .slide{padding:12px}
  .slide img{
    width:auto;
    max-width:100%;
    height:auto;
    max-height:70vh;
    margin:0 auto;
    object-fit:contain;
  }
}

@media (max-width:480px){
  .nav{grid-template-columns:1fr}
  .activities-grid{grid-template-columns:1fr}
  .slider{min-height:220px}
  .slide img{max-height:60vh}
}

/* =======================================================
   AJUSTE RESPONSIVE TABLA ADMIN_ORDENES (mejorado)
======================================================= */
.table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}

/* Estético en pantallas estrechas */
@media (max-width:640px){
  /* No rompas cada palabra en todas las celdas */
  .table{table-layout:auto;width:100%}
  .table th,.table td{
    word-break:normal;
    overflow-wrap:normal;
    white-space:nowrap;
    font-size:13px;
    vertical-align:top;
  }

  /* Emails / enlaces no rompan el layout */
  .table td a{word-break:break-word; overflow-wrap:anywhere}

  /* Columna de tickets: permite varias líneas, en 2 columnas y con scroll si es muy larga */
  .table td.mono{
    white-space:normal;
    word-break:break-word;
    overflow-wrap:anywhere;
    column-count:2;         /* ✅ dos columnas para que se vea lindo */
    column-gap:12px;
    font-size:13px;
    line-height:1.25;
    max-height:220px;       /* límite visual */
    overflow:auto;          /* scroll dentro de la celda si se pasa */
    padding-right:6px;
  }

  /* Botones en columna y ocupando ancho */
  td:last-child .btn{
    display:block;
    width:100%;
    margin:6px 0;
  }

  /* Badges compactos */
  .pill{white-space:nowrap}
}

/* ====== FIX desktop: botón largo en columna "Acción" ====== */
@media (min-width: 769px){
  .table td:last-child{
    white-space: normal;     /* permite que el texto envuelva */
    max-width: 220px;        /* ancho razonable de la celda */
  }
  .table td:last-child .btn{
    white-space: normal;     /* el texto del botón sí puede partirse */
    padding: 10px 12px;      /* un poco más compacto */
    font-size: 14px;
    max-width: 100%;         /* nunca más ancho que la celda */
    text-align: center;      
  }
}

/* ===== FIX móvil: nombre de usuario y rol dentro del cuadro ===== */
@media (max-width: 768px){
  .nav .btn {
    font-size: 15px;
    padding: 10px 12px;
    text-align: center;
    word-break: break-word;
    white-space: normal;  /* permite salto de línea */
  }

  /* Si usas el texto del nombre junto a Mi cuenta */
  .nav .btn span,
  .nav .btn small {
    display: block;      /* fuerza a que el rol o usuario bajen una línea */
    font-size: 13px;
    line-height: 1.3;
    color: #333;
  }

  /* Evita que el menú se salga del ancho */
  .header__wrap {
    padding: 8px;
  }
  .nav {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 6px;
  }
}
