@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

*{margin:0;padding:0;box-sizing:border-box}
html{touch-action:manipulation}
body{
  font-family:'Inter',-apple-system,BlinkMacSystemFont,sans-serif;
  background:#f8f9fc;
  color:#1a1a2e;
  min-height:100vh;
  overflow-x:hidden;
  max-width:100vw;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  touch-action:pan-y;
  -webkit-overflow-scrolling:touch
}
img,video{max-width:100%;height:auto;pointer-events:none;-webkit-user-select:none;user-select:none}

/* HEADER */
.header{position:sticky;top:0;z-index:100;background:#fff;border-bottom:1px solid #e8ecf1;backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px)}
.header-inner{display:flex;align-items:center;gap:12px;padding:14px 16px;max-width:1000px;margin:0 auto}
.logo{font-size:1.6rem;font-weight:800;text-decoration:none;color:#1a1a2e;letter-spacing:-0.5px;display:flex;align-items:center;gap:2px}
.logo-accent{color:#4A90D9}
.search-form{flex:1;min-width:0}
.search-input{
  width:100%;padding:10px 16px;border-radius:24px;border:1.5px solid #dce0e8;
  background:#f4f6f9;color:#1a1a2e;font-size:0.9rem;outline:none;font-family:'Inter',sans-serif;
  transition:all .2s
}
.search-input:focus{border-color:#4A90D9;background:#fff;box-shadow:0 0 0 3px rgba(74,144,217,.12)}
.search-input::placeholder{color:#999}
.btn-icon{font-size:1.4rem;text-decoration:none;padding:8px;color:#777;transition:color .2s}
.btn-icon:hover{color:#4A90D9}

/* MAIN */
.main{padding:16px 16px 90px;max-width:1000px;margin:0 auto;overflow:hidden}

/* HERO */
.hero{text-align:center;padding:28px 16px 32px}
.hero h1{
  font-size:1.8rem;font-weight:800;letter-spacing:-1px;
  color:#1a1a2e;margin-bottom:6px
}
.hero p{color:#777;font-size:0.95rem;line-height:1.5}

/* TIENDAS GRID */
.tiendas-grid{display:grid;grid-template-columns:1fr;gap:2px;margin:0 -16px;width:calc(100% + 32px)}
.tienda-card{
  background:#fff;border-radius:0;overflow:hidden;text-decoration:none;color:#1a1a2e;
  display:flex;flex-direction:column;transition:all .2s;
  border-bottom:1px solid #e8ecf1
}
.tienda-card:active{background:#f4f6f9}
.tienda-card:last-child{border-bottom:none}
.card-img{width:100%;height:220px;overflow:hidden;background:#eef1f5;display:flex;align-items:center;justify-content:center;position:relative}
.card-img img{width:100%;height:100%;object-fit:cover;transition:transform .3s}
.tienda-card:hover .card-img img{transform:scale(1.03)}
.card-img-placeholder{font-size:4rem;font-weight:700;color:#4A90D9;opacity:.3;display:flex;align-items:center;justify-content:center;width:100%;height:100%}
.card-img-placeholder{font-size:4rem;font-weight:700;color:#4A90D9;opacity:.3}
.card-body{padding:16px 18px;display:flex;flex-direction:column;gap:6px}
.card-body h3{font-size:1.1rem;font-weight:700;color:#1a1a2e}
.tags{display:flex;flex-wrap:wrap;gap:5px}
.tag{
  background:#eef3fa;color:#4A90D9;font-size:0.7rem;font-weight:500;
  padding:3px 12px;border-radius:20px;letter-spacing:0.2px
}
.card-contact{font-size:0.85rem;color:#888;display:flex;align-items:center;gap:4px}
.card-footer{display:flex;justify-content:space-between;align-items:center;margin-top:4px}
.card-link{color:#4A90D9;font-size:0.85rem;font-weight:600}
.card-meta{display:flex;gap:10px;align-items:center;font-size:0.8rem;color:#888}

/* GALLERY */
.gallery{position:relative;overflow:hidden;border-radius:0;margin-bottom:20px;margin:0 -16px 20px;width:calc(100% + 32px)}
.gallery-track{display:flex;transition:transform .35s cubic-bezier(.25,.8,.25,1)}
.gallery-slide{min-width:100%;display:flex;justify-content:center;align-items:center}
.gallery-slide img{width:100%;height:300px;object-fit:cover}
.gallery-dots{display:flex;justify-content:center;gap:6px;padding:14px 0;position:absolute;bottom:0;left:0;right:0;background:linear-gradient(transparent,rgba(0,0,0,.6))}
.gallery-dots .dot{width:6px;height:6px;border-radius:50%;background:rgba(255,255,255,.4);cursor:pointer;transition:all .3s}
.gallery-dots .dot.active{background:#fff;width:24px;border-radius:3px}

/* TIENDA DETAIL */
.tienda-detail{padding-top:4px}
.back-link{display:inline-flex;align-items:center;gap:6px;color:#888;text-decoration:none;font-size:0.85rem;margin-bottom:16px;padding:8px 0;transition:color .2s}
.back-link:hover{color:#4A90D9}
.tienda-info h1{font-size:1.5rem;font-weight:800;margin-bottom:12px;letter-spacing:-0.3px;color:#1a1a2e}
.info-block{background:#fff;border-radius:14px;padding:16px;border:1px solid #e8ecf1;margin:12px 0}
.info-row{display:flex;gap:10px;margin-bottom:8px;font-size:0.95rem;align-items:center}
.info-row:last-child{margin-bottom:0}
.info-label{color:#888;min-width:80px;font-weight:500}
.info-row a{color:#4A90D9;text-decoration:none;font-weight:500}
.info-row a:hover{text-decoration:underline}
.descripcion{margin-top:16px;background:#fff;border-radius:14px;padding:18px;border:1px solid #e8ecf1}
.descripcion h3{font-size:0.8rem;color:#888;margin-bottom:8px;text-transform:uppercase;letter-spacing:1px}
.descripcion p{line-height:1.7;font-size:0.9rem;color:#444}

/* QR */
.qr-section{margin-top:20px}
.qr-section h3{font-size:0.8rem;color:#888;margin-bottom:12px;text-transform:uppercase;letter-spacing:1px}
.qr-row{display:flex;gap:24px;justify-content:flex-start}
.qr-item{text-align:center}
.qr-img{width:120px;height:120px;border-radius:12px;background:#fff;padding:8px;object-fit:contain;box-shadow:0 2px 12px rgba(0,0,0,.06);border:1px solid #e8ecf1}
.qr-item span{display:block;margin-top:6px;font-size:0.8rem;color:#777}

/* FORMS */
.panel-form{display:flex;flex-direction:column;gap:14px;margin-top:16px}
.form-group{display:flex;flex-direction:column;gap:6px}
.form-group label{font-size:0.85rem;color:#666;font-weight:600}
.form-group input,.form-group textarea,.search-input-big{
  padding:14px 16px;border-radius:12px;border:1.5px solid #dce0e8;background:#f8f9fc;
  color:#1a1a2e;font-size:0.95rem;outline:none;font-family:'Inter',sans-serif;transition:all .2s
}
.form-group input:focus,.form-group textarea:focus,.search-input-big:focus{border-color:#4A90D9;box-shadow:0 0 0 3px rgba(74,144,217,.12);background:#fff}
.form-group textarea{resize:vertical;min-height:100px}
.form-group input::placeholder,.form-group textarea::placeholder{color:#aaa}
.btn{
  display:inline-flex;align-items:center;justify-content:center;padding:14px 28px;
  border-radius:12px;border:none;background:#4A90D9;color:#fff;font-weight:600;
  font-size:0.95rem;cursor:pointer;text-decoration:none;transition:all .2s;font-family:'Inter',sans-serif
}
.btn:hover{background:#5B9EE0;transform:translateY(-1px)}
.btn:active{transform:translateY(0)}
.btn-full{width:100%}
.btn-secondary{background:#eef3fa;color:#4A90D9;border:1px solid #dce0e8}
.btn-secondary:hover{background:#e4ebf4}
.btn-sm{padding:8px 18px;border-radius:10px;background:#4A90D9;color:#fff;font-weight:600;font-size:0.8rem;border:none;cursor:pointer;text-decoration:none;display:inline-block;transition:all .2s}
.btn-sm:hover{background:#5B9EE0}
.btn-xs{padding:6px 12px;border-radius:8px;background:#eef3fa;color:#4A90D9;font-size:0.7rem;border:none;cursor:pointer;text-decoration:none;display:inline-block;transition:all .2s;font-weight:500}
.btn-xs:hover{background:#e4ebf4}
.btn-xs.danger{background:#fee2e2;color:#ef4444}
.btn-xs.danger:hover{background:#fecaca}
.error-msg{background:#fee2e2;border:1px solid #fecaca;color:#dc2626;padding:12px 16px;border-radius:10px;font-size:0.85rem}
.panel-links{margin-top:20px;text-align:center;font-size:0.85rem;color:#888}
.panel-links a{color:#4A90D9;text-decoration:none;font-weight:500}
.panel-links a:hover{text-decoration:underline}

/* PANEL DASHBOARD */
.panel-dashboard,.panel-edit,.admin-dashboard,.panel,.admin-login,.search-page,.error-page{padding-top:8px}
.panel-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px;gap:10px;flex-wrap:wrap}
.panel-header h2{font-size:1.25rem;font-weight:700;color:#1a1a2e}
.panel-user{color:#888;font-size:0.8rem;background:#eef3fa;padding:4px 12px;border-radius:20px}
.edit-card{flex-direction:row;min-height:110px}
.edit-card .card-img{width:110px;height:110px;flex-shrink:0}
.edit-card .card-body{flex:1;display:flex;flex-direction:column;justify-content:center;gap:4px}
.edit-card .card-body h3{font-size:0.95rem}

/* FOTOS GRID */
.fotos-grid{display:flex;flex-wrap:wrap;gap:10px;margin-top:14px}
.fotos-grid label{width:100%;font-size:0.85rem;color:#666;margin-bottom:2px;font-weight:600}
.foto-item{position:relative;width:90px;height:90px;border-radius:10px;overflow:hidden;background:#eef3fa;border:1px solid #dce0e8}
.foto-item img{width:100%;height:100%;object-fit:cover}
.foto-actions{position:absolute;bottom:0;left:0;right:0;display:flex;gap:3px;padding:4px;background:linear-gradient(transparent,rgba(0,0,0,.6));justify-content:center}
.principal-badge{background:#4A90D9;color:#fff;font-size:0.55rem;padding:2px 6px;border-radius:4px;font-weight:600}

/* STATS */
.stats-row{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-bottom:24px}
.stat-card{background:#fff;border-radius:14px;padding:16px 12px;text-align:center;border:1px solid #e8ecf1}
.stat-num{font-size:1.5rem;font-weight:800;color:#4A90D9;letter-spacing:-0.5px}
.stat-label{font-size:0.65rem;color:#888;margin-top:4px;text-transform:uppercase;letter-spacing:0.5px}

/* ADMIN TABLE */
.admin-table{overflow-x:auto;margin-top:14px;border-radius:12px;border:1px solid #e8ecf1}
.admin-table table{width:100%;border-collapse:collapse;font-size:0.8rem}
.admin-table th,.admin-table td{padding:10px 12px;text-align:left;border-bottom:1px solid #eef3fa}
.admin-table th{color:#888;font-weight:600;background:#f8f9fc;text-transform:uppercase;letter-spacing:0.5px;font-size:0.7rem}
.admin-table tr:last-child td{border-bottom:none}
.admin-table .actions{display:flex;gap:6px}
.badge-active{background:#eef3fa;color:#4A90D9;font-size:0.65rem;font-weight:500;padding:3px 10px;border-radius:20px;display:inline-block}
.badge-inactive{background:#fee2e2;color:#ef4444;font-size:0.65rem;font-weight:500;padding:3px 10px;border-radius:20px;display:inline-block}

/* SEARCH */
.search-page h2{font-size:1.25rem;font-weight:700;color:#1a1a2e;margin-bottom:4px}
.search-form-big{display:flex;gap:10px;margin:16px 0}
.search-input-big{flex:1}
.result-count{color:#888;font-size:0.85rem;margin-bottom:16px}

/* EMPTY STATE */
.empty{text-align:center;color:#888;padding:60px 20px}
.empty p{margin-bottom:20px;font-size:0.95rem;line-height:1.5}

/* BOTTOM NAV */
.bottom-nav{
  position:fixed;bottom:0;left:0;right:0;background:#fff;
  border-top:1px solid #e8ecf1;display:flex;z-index:200;
  padding:8px 0 calc(8px + env(safe-area-inset-bottom));
  justify-content:space-around;
}
.nav-item{text-decoration:none;color:#888;font-size:0.8rem;text-align:center;padding:6px 18px;border-radius:12px;transition:all .2s;font-weight:500}
.nav-item.active{color:#4A90D9;background:#eef3fa}

/* RESPONSIVE */
@media(min-width:640px){
  .tiendas-grid{grid-template-columns:repeat(2,1fr);gap:16px;margin:0;width:100%}
  .tienda-card{border-radius:12px;border:1px solid #e8ecf1;border-bottom:1px solid #e8ecf1}
  .tienda-card:active{transform:scale(0.97);box-shadow:0 2px 8px rgba(0,0,0,.06);background:#fff}
}
@media(min-width:900px){
  .tiendas-grid{grid-template-columns:repeat(3,1fr)}
}
@media(min-width:1200px){
  .tiendas-grid{grid-template-columns:repeat(4,1fr)}
}
@media(min-width:768px){
  .hero h1{font-size:2.4rem}
  .hero{padding:48px 16px 36px}
  .stats-row{grid-template-columns:repeat(4,1fr)}
  .gallery-slide img{height:450px}
  .main{padding:24px 24px 90px}
}

/* PRODUCTOS */
.productos-section{padding:16px;border-bottom:1px solid #e8ecf1}
.productos-section h3{font-size:0.8rem;color:#888;margin-bottom:12px;text-transform:uppercase;letter-spacing:1px}
.productos-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;padding:4px 0}
.producto-card{background:#fff;border:1px solid #e8ecf1;overflow:hidden;display:flex;flex-direction:column}
.producto-img{width:100%;height:140px;overflow:hidden;background:#eef1f5}
.producto-img img{width:100%;height:100%;object-fit:cover}
.producto-body{padding:12px 10px 10px;display:flex;flex-direction:column;gap:4px}
.producto-body h4{font-size:0.85rem;font-weight:600;color:#1a1a2e}
.producto-body p{font-size:0.75rem;color:#666;line-height:1.5;margin-top:2px}
.producto-body .tags{gap:3px}
.producto-body .tag{font-size:0.6rem;padding:2px 8px;margin-top:2px}

/* Panel productos */
.panel-productos{padding-top:8px}
.panel-productos h2{font-size:1.1rem}
.panel-productos h3{font-size:0.9rem;color:#888;margin:16px 0 10px}
.add-producto-form{background:#fff;border:1px solid #e8ecf1;padding:16px;margin:12px 0}
.add-producto-form h3{font-size:0.8rem;text-transform:uppercase;letter-spacing:1px;color:#888;margin:0 0 12px}
.productos-list{margin-top:4px}
.producto-item{display:flex;gap:10px;background:#fff;border-bottom:1px solid #e8ecf1;padding:10px;align-items:center}
.producto-item-img{width:60px;height:60px;flex-shrink:0;background:#eef1f5;overflow:hidden}
.producto-item-img img{width:100%;height:100%;object-fit:cover}
.producto-item-body{flex:1;min-width:0}
.producto-item-body strong{font-size:0.85rem;color:#1a1a2e}
.producto-item-body p{font-size:0.75rem;color:#666;margin-top:2px}
.producto-item-actions{flex-shrink:0}

/* Productos responsive escritorio */
@media(min-width:900px){
  .productos-grid{grid-template-columns:repeat(4,1fr);gap:14px}
  .producto-img{height:180px}
}

/* Panel editar producto */
.panel-edit-producto{padding-top:8px}
.fotos-section{margin-top:16px}
.fotos-section h3{font-size:0.8rem;color:#888;margin-bottom:12px;text-transform:uppercase;letter-spacing:1px}
.fotos-grid-clear{display:flex;flex-wrap:wrap;gap:10px}
.foto-card{position:relative;width:90px;height:90px;overflow:hidden;background:#eef1f5;border:1px solid #dce0e8;display:flex;flex-direction:column}
.foto-card img{width:100%;height:65px;object-fit:cover}
.foto-card-actions{display:flex;gap:2px;padding:2px;justify-content:center;align-items:center;background:#f8f9fc;height:25px}
.foto-card-actions .principal-badge{background:#4A90D9;color:#fff;font-size:0.5rem;padding:1px 4px;font-weight:600}
.foto-card-actions .marcar-principal{font-size:0.55rem;color:#4A90D9;text-decoration:none;cursor:pointer;font-weight:500}
.foto-card-actions .marcar-principal:hover{text-decoration:underline}
.producto-no-img{width:60px;height:60px;display:flex;align-items:center;justify-content:center;font-size:1.5rem;background:#eef1f5}


/* PRODUCTOS */
.productos-section{padding:0;margin-top:20px}
.productos-section > h3{
  font-size:0.75rem;color:#999;margin:0 0 10px 16px;
  text-transform:uppercase;letter-spacing:1px
}
.productos-grid{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:0;
}
.producto-card{
  background:#fff;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  position:relative;
  border-right:1px solid #e8ecf1;
  border-bottom:1px solid #e8ecf1;
}
.producto-card:nth-child(2n){border-right:none}
.producto-img{
  width:100%;
  height:190px;
  overflow:hidden;
  background:#f0f2f5;
  display:flex;
  align-items:center;
  justify-content:center;
}
.producto-img img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.producto-body{
  padding:12px 12px 14px;
  display:flex;
  flex-direction:column;
  gap:4px;
  min-height:70px;
}
.producto-body h4{
  font-size:0.9rem;
  font-weight:600;
  color:#1a1a2e;
  line-height:1.3;
  margin:0;
}
.producto-body p{
  font-size:0.8rem;
  color:#666;
  line-height:1.5;
  margin:0;
}
.producto-body .tag{
  font-size:0.6rem;
  padding:2px 8px;
  background:#eef3fa;
  color:#4A90D9;
  border-radius:20px;
  font-weight:500;
  display:inline-block;
}
@media(min-width:900px){
  .productos-grid{
    grid-template-columns:repeat(4,1fr);
    gap:16px;
    margin:0 16px;
  }
  .producto-card{
    border:1px solid #e8ecf1;
  }
  .producto-card:nth-child(2n){border-right:1px solid #e8ecf1}
  .producto-img{height:200px}
}
