/* ===============================
   VARIABLES
=================================*/
:root{
  --bg:#f5f6f8;
  --card:#ffffff;
  --text:#1c1e21;
  --muted:#6b7280;
  --border:#e4e6eb;
  --primary:#E1306C;
  --footer:#f0f2f5;

  --shadow: 0 10px 24px rgba(0,0,0,.08);
}

body.dark{
  --bg:#0f0f10;
  --card:#17181a;
  --text:#ffffff;
  --muted:#b6b8bd;
  --border:#2a2c30;
  --footer:#121314;

  --shadow: 0 10px 26px rgba(0,0,0,.45);
}

/* ===============================
   RESET / GLOBAL
=================================*/
*{ box-sizing:border-box; }

html, body{
  width:100%;
  max-width:100%;
  overflow-x:hidden; /* ✅ evita scroll lateral y “header corto” */
}

body{
  margin:0;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  background:var(--bg);
  color:var(--text);
  transition: .25s ease;
}

a{ color:inherit; text-decoration:none; }

.layout, .header-inner, .sidebar, main{ min-width:0; }

/* ===============================
   HEADER
=================================*/
.site-header{
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3000;

  width: 100%;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.header-inner{
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 14px;

  display:flex;
  align-items:center;
  gap:12px;
}

.header-left{
  display:flex;
  align-items:center;
  gap:12px;
  min-width: 0;
}

.logo{
  font-weight: 800;
  font-size: 18px;
  white-space: nowrap;
}

.header-right{
  margin-left:auto;
  display:flex;
  align-items:center;
  gap:10px;
}

/* botones icono */
.icon-btn{
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background: rgba(0,0,0,.03);
  border: 1px solid transparent;
  cursor:pointer;
}

body.dark .icon-btn{ background: rgba(255,255,255,.06); }

.icon-btn:hover{ border-color: rgba(0,0,0,.10); }
body.dark .icon-btn:hover{ border-color: rgba(255,255,255,.14); }

.icon-btn svg{
  width: 22px;
  height: 22px;
  stroke: currentColor;
}

/* buscador */
.search-wrapper{
  position: relative;
  flex: 1 1 auto;
  max-width: 680px;
  min-width: 200px;
}

.search-icon{
  position:absolute;
  left:14px;
  top:50%;
  transform:translateY(-50%);
  width:18px;
  height:18px;
  opacity:.55;
  pointer-events:none;
}

/* ✅ glass effect */
.search-input{
  width:100%;
  padding: 12px 46px 12px 42px;
  border-radius: 999px;
  border: 1px solid var(--border);
  outline:none;
  font-size: 15px;
  color: var(--text);

  background: rgba(255,255,255,.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  transition: .2s ease;
}

body.dark .search-input{
  background: rgba(20,20,22,.55);
}

.search-input:focus{
  border-color: rgba(225,48,108,.65);
  box-shadow: 0 0 0 4px rgba(225,48,108,.14);
}

.clear-search{
  position:absolute;
  right:10px;
  top:50%;
  transform:translateY(-50%);
  width:32px;
  height:32px;
  border-radius:999px;
  border:none;
  background: transparent;
  cursor:pointer;
  opacity:.7;
  display:none;
  font-size:22px;
  line-height:0;
  color:inherit;
}

.clear-search:hover{
  opacity:1;
  background: rgba(0,0,0,.05);
}
body.dark .clear-search:hover{
  background: rgba(255,255,255,.08);
}

/* ✅ MOBILE header: 2 filas */
@media(max-width:768px){
  .header-inner{
    flex-wrap: wrap;
    gap:10px;
    padding: 10px 12px;
  }

  .search-wrapper{
    order:3;
    flex: 1 1 100%;
    max-width: 100%;
    min-width: 0;
  }

  .logo{ font-size: 17px; }
}

/* safe area notch */
@supports (padding: max(0px)){
  .header-inner{
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
}

/* ===============================
   CATBAR MOBILE (NUEVO)
================================= */
.catbar-mobile{ display:none; }

@media (max-width:768px){
  .catbar-mobile{
    display:block;
    position: sticky;
    top: 62px; /* ✅ ajusta 56-74 si quieres */
    z-index: 2400;

    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    border-bottom: 1px solid var(--border);
  }

  .catbar-inner{
    display:flex;
    gap:12px;
    padding: 10px 12px 12px;

    overflow-x:auto;
    overflow-y:hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width:none;

    max-width:100%;
  }
  .catbar-inner::-webkit-scrollbar{ display:none; }

  .catchip{
    flex:0 0 auto;
    width:64px;
    min-width:64px;
    height:64px;

    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:6px;

    border-radius:18px;
    border:1px solid transparent;

    background: rgba(0,0,0,.05);
    color: var(--text);
    text-decoration:none;

    transition:.18s ease;
  }

  body.dark .catchip{ background: rgba(255,255,255,.08); }

  .catchip:hover{
    transform: translateY(-1px);
    border-color: rgba(0,0,0,.10);
  }
  body.dark .catchip:hover{ border-color: rgba(255,255,255,.16); }

  .catchip.active{
    background: linear-gradient(45deg,#E1306C,#F77737);
    color:#fff;
    border-color: transparent;
    box-shadow: 0 8px 18px rgba(225,48,108,.30);
  }

  .catemoji{ font-size:20px; line-height:1; }

  .catlabel{
    font-size:11px;
    line-height:1.1;
    text-align:center;
    max-width:58px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    opacity:.85;
  }
  .catchip.active .catlabel{ opacity:1; }
}

/* ===============================
   LAYOUT
=================================*/
.layout{
  max-width:1200px;
  margin:0 auto;
  padding: 22px 16px;

  display:grid;
  grid-template-columns: 260px 1fr;
  gap: 18px;
}

@media(max-width:768px){
  .layout{
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 14px 12px;
  }
}

/* ===============================
   SIDEBAR / CATEGORÍAS (DESKTOP)
=================================*/
.sidebar{ width:100%; max-width:100%; }

.sidebar-title{
  margin: 6px 0 14px;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: .6;
}

/* Desktop lista */
.sidebar-links{
  display:flex;
  flex-direction: column;
  gap:10px;
}

.side-link{
  position: relative;
  display:flex;
  align-items:center;
  gap:12px;

  padding:12px 14px;
  border-radius:16px;
  border:1px solid transparent;

  background: rgba(0,0,0,.04);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);

  transition:.2s ease;
  overflow:visible;
}

body.dark .side-link{ background: rgba(255,255,255,.06); }

.side-link:hover{
  border-color: rgba(0,0,0,.12);
  transform: translateX(2px);
}
body.dark .side-link:hover{ border-color: rgba(255,255,255,.18); }

.side-link.active{
  background: linear-gradient(45deg,#E1306C,#F77737);
  color:#fff;
  border-color: transparent;
  font-weight:700;
  box-shadow: 0 6px 18px rgba(225,48,108,.25);
}

.side-icon{
  width:28px;
  height:28px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:18px;
  flex:0 0 auto;
}

.side-text{
  font-size:14px;
  line-height:1.2;
}

/* Sticky desktop */
@media(min-width:769px){
  .sidebar{
    position: sticky;
    top: 92px;
    align-self: start;
  }
}

/* ✅ móvil: ocultar sidebar categories (se usan en catbar) */
@media(max-width:768px){
  .sidebar-desktop{ display:none; }
}

/* ===============================
   CARDS
=================================*/
.cards{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(280px,1fr));
  gap: 18px;
}

@media(max-width:768px){
  .cards{
    grid-template-columns: 1fr;
    max-width: 420px;
    margin: 0 auto;
    gap: 16px;
  }
}

.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow:hidden;
  transition: .25s ease;
}

.card:hover{
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.cover{ height: 130px; }
.cover img{ width:100%; height:100%; object-fit:cover; display:block; }

.avatar{
  width: 92px;
  height: 92px;
  border-radius: 50%;
  margin: -46px auto 10px;
  display:block;
  object-fit:cover;
  border: 4px solid var(--card);
  background:#d9dbe0;
}

.card-body{
  text-align:center;
  padding: 6px 14px 18px;
}

.card-body h3{
  margin: 6px 0 4px;
  font-size: 18px;
}

.card-body p{
  margin:0;
  color: var(--muted);
  font-size: 13px;
}

.card-actions{
  margin-top: 12px;
  display:flex;
  justify-content:center;
  gap:10px;
  align-items:center;
}

.profile-btn{
  padding: 10px 14px;
  border-radius: 999px;
  border:none;
  cursor:pointer;
  background: linear-gradient(45deg,#E1306C,#F77737);
  color:#fff;
  font-weight: 800;
  text-decoration:none;
}

.profile-btn:hover{ opacity:.92; }

.heart-btn{
  border:none;
  background:transparent;
  cursor:pointer;
  font-size: 18px;
  line-height: 1;
  transform: translateY(1px);
  color:inherit;
}

.heart-btn.active{ color:#E1306C; }

/* ===============================
   FOOTER
=================================*/
footer{
  background: var(--footer);
  margin-top: 56px;
  padding: 44px 0 18px;
  border-top: 1px solid var(--border);
}

.footer-container{
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.footer-grid{
  display:grid;
  grid-template-columns: repeat(4,1fr);
  gap: 34px;
  margin-bottom: 24px;
}

.footer-col h4{
  margin: 0 0 12px;
  font-size: 16px;
}

.footer-col p{
  margin: 0 0 10px;
  line-height: 1.5;
  color: var(--muted);
}

.footer-col a{
  display:block;
  margin-bottom: 8px;
  opacity: .85;
}

.footer-col a:hover{
  opacity:1;
  color: var(--primary);
}

.footer-bottom{
  border-top: 1px solid var(--border);
  padding-top: 16px;
  font-size: 14px;
  opacity: .82;
  display:flex;
  justify-content:space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-social{
  display:flex;
  gap: 10px;
  align-items:center;
}

.social-btn{
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border: 1px solid var(--border);
  background: transparent;
  transition:.2s ease;
}

.social-btn svg{
  width:18px;
  height:18px;
}

.social-btn:hover{
  transform:translateY(-2px);
  background: linear-gradient(45deg,#E1306C,#F77737);
  color:#fff;
  border-color:transparent;
}

@media(max-width:900px){
  .footer-grid{ grid-template-columns: repeat(2,1fr); }
}

@media(max-width:600px){
  .footer-grid{ grid-template-columns: 1fr; gap: 18px; }
  .footer-bottom{ justify-content:center; text-align:center; }
}

/* ===============================
   PERFIL MODERNO
=================================*/
.profile-wrapper{
  max-width: 900px;
  margin: 34px auto 0;
  padding: 0 16px;
}

.profile-cover img{
  width:100%;
  height: 240px;
  object-fit: cover;
  border-radius: 22px;
  border: 1px solid var(--border);
}

.profile-card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 44px 22px 26px;
  margin-top: -64px;
  text-align: center;
  box-shadow: var(--shadow);
}

.profile-avatar{
  width: 122px;
  height: 122px;
  border-radius: 50%;
  object-fit: cover;
  border: 6px solid var(--card);
  margin-top: -92px;
  background: #d9dbe0;
}

.profile-card h1{
  margin: 14px 0 6px;
  font-size: 26px;
  letter-spacing: -0.3px;
}

.profile-category{
  margin: 0 0 18px;
  opacity: .7;
  color: var(--muted);
}

.profile-stats{
  display:flex;
  justify-content:center;
  gap: 38px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.stat{
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--card) 85%, transparent);
}

.stat strong{
  display:block;
  font-size: 18px;
}

.stat span{
  display:block;
  font-size: 12px;
  opacity: .7;
  color: var(--muted);
  margin-top: 2px;
}

.profile-actions{
  display:flex;
  justify-content:center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0 6px;
}

.insta-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;

  padding: 10px 16px;
  border-radius: 999px;
  background: linear-gradient(45deg,#E1306C,#F77737);
  color:#fff;
  font-weight: 800;
  border: none;
}

.insta-btn svg{
  width: 18px;
  height: 18px;
}

.insta-btn:hover{ opacity:.92; }

.ghost-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;

  padding: 10px 16px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--border);
  font-weight: 700;
  color: var(--text);
}

.ghost-btn svg{
  width: 18px;
  height: 18px;
}

.ghost-btn:hover{
  border-color: rgba(225,48,108,.45);
  box-shadow: 0 0 0 4px rgba(225,48,108,.10);
}

.profile-story{
  margin-top: 16px;
  text-align: left;
  line-height: 1.7;
  color: color-mix(in srgb, var(--text) 90%, transparent);
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 14px;
}

.profile-embed{
  margin-top: 18px;
}

.embed-head{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap: 10px;
  padding: 10px 4px;
}

.embed-title{
  font-weight: 800;
  letter-spacing: -0.2px;
}

.embed-sub{
  font-size: 12px;
  opacity: .7;
  color: var(--muted);
}

.embed-frame{
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
}

.embed-frame iframe{
  width:100%;
  height: 520px;
  border:0;
  display:block;
}

@media(max-width:768px){
  .profile-cover img{ height: 210px; }
  .embed-frame iframe{ height: 520px; } /* puedes bajar a 480 si quieres */
}
/* ===============================
   PERFIL (NUEVO)
================================= */
.profile-page{
  max-width:1200px;
  margin:0 auto;
  padding: 16px 12px 26px;
}

.profile-hero{ margin-top: 10px; }

.profile-cover{
  position:relative;
  width:100%;
  height: 220px;
  border-radius: 18px;
  overflow:hidden;
  border: 1px solid var(--border);
  background: rgba(0,0,0,.04);
}
.profile-cover img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.profile-cover-fade{
  position:absolute;
  inset:0;
  background: linear-gradient(180deg, rgba(0,0,0,.0) 35%, rgba(0,0,0,.20) 100%);
  pointer-events:none;
}

.profile-shell{
  display:grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 16px;
  margin-top: -46px;
  padding: 0 10px;
}

.profile-card{
  background: color-mix(in srgb, var(--card) 88%, transparent);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  position:relative;
}

.profile-avatar{
  width: 104px;
  height: 104px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--card);
  background: #d9dbe0;
  margin-top: -54px;
}

.profile-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-top: 8px;
}

.profile-title h1{
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
}
.profile-category{
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.profile-badges{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-size: 13px;
  color: var(--text);
  opacity: .92;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,.03);
}
body.dark .badge{ background: rgba(255,255,255,.06); }
.badge svg{ width:16px; height:16px; }

.profile-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top: 14px;
}

.btn-primary, .btn-ghost{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 800;
  text-decoration:none;
  cursor:pointer;
}
.btn-primary{
  background: linear-gradient(45deg,#E1306C,#F77737);
  color:#fff;
}
.btn-primary:hover{ opacity:.92; }

.btn-ghost{
  border-color: var(--border);
  background: rgba(0,0,0,.03);
}
body.dark .btn-ghost{ background: rgba(255,255,255,.06); }
.btn-ghost:hover{
  border-color: rgba(225,48,108,.45);
}

.btn-primary svg, .btn-ghost svg{
  width:18px; height:18px;
}

.profile-story{
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.profile-story h3{
  margin: 0 0 8px;
  font-size: 15px;
}
.profile-story-text{
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

.profile-embed{
  background: color-mix(in srgb, var(--card) 88%, transparent);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  height: fit-content;
}

.embed-head{ margin-bottom: 10px; }
.embed-title{
  font-weight: 900;
  font-size: 15px;
}
.embed-sub{
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.embed-frame{
  border-radius: 14px;
  overflow:hidden;
  border: 1px solid var(--border);
  background: rgba(0,0,0,.03);
}
.embed-frame iframe{
  width:100%;
  min-height: 520px;
  border:0;
  display:block;
  background: transparent;
}

/* Recomendados */
.recs{
  max-width:1200px;
  margin: 22px auto 0;
  padding: 0 12px;
}
.recs-head h2{
  margin:0;
  font-size: 18px;
}
.recs-head p{
  margin: 6px 0 14px;
  color: var(--muted);
  font-size: 14px;
}

.recs-grid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.rec-card{
  border:1px solid var(--border);
  border-radius: 16px;
  overflow:hidden;
  background: var(--card);
  transition: .2s ease;
}
.rec-card:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.rec-cover{ height: 70px; }
.rec-cover img{ width:100%; height:100%; object-fit:cover; display:block; }
.rec-body{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 10px 12px 12px;
}
.rec-avatar{
  width:40px; height:40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--card);
  background:#d9dbe0;
}
.rec-name{
  font-weight: 900;
  font-size: 14px;
  line-height: 1.15;
}
.rec-cat{
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

/* Responsive perfil */
@media(max-width: 980px){
  .profile-shell{ grid-template-columns: 1fr; margin-top: -40px; }
  .embed-frame iframe{ min-height: 520px; }
  .recs-grid{ grid-template-columns: repeat(2, 1fr); }
}

@media(max-width: 560px){
  .profile-cover{ height: 200px; }
  .profile-avatar{ width: 96px; height: 96px; margin-top: -50px; }
  .profile-title h1{ font-size: 20px; }
  .recs-grid{ grid-template-columns: 1fr; }
}
/* ===============================
   PROFILE STATS (visitas)
=================================*/
.profile-stats{
  margin-top: 12px;
  display:flex;
  justify-content:center;
  gap:12px;
  flex-wrap:wrap;
}

.profile-stats .stat{
  min-width:110px;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid var(--border);
  background: color-mix(in srgb, var(--card) 82%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  text-align:center;
}

.profile-stats .stat strong{
  display:block;
  font-size:16px;
  font-weight:800;
}

.profile-stats .stat span{
  display:block;
  margin-top:2px;
  font-size:12px;
  color:var(--muted);
}