:root{
  --green: #2e8b57;
  --light: #f7f9fa;
  --text: #1b2630;
  --box-radius: 10px;
}

*{box-sizing:border-box}
html,body,#app{height:100%;margin:0;font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,"Helvetica Neue",Arial;}
body{background:#fff;color:var(--text);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}

/* IMPORTANTE: deja espacio para el bottom nav fijo */
#app{
  position: relative;
  padding-bottom: 78px; /* evita que tape contenido */
}

/* Sections base */
.section{display:flex;align-items:center;justify-content:center}

/* Header */
.header{
  background:var(--green);
  color:#fff;
  padding:10px;
  height:12.5vh;
  min-height:58px;
  width:100%;
  display:flex;
  align-items:center;
  gap:8px;
}
.header .title{font-size:14px;text-align:center;line-height:1.1;display:flex;flex-direction:column;align-items:center}
.header .title strong{font-weight:700}
.header .title .main-title{line-height:1.05}
.header .title .address{font-size:11px;opacity:0.92;margin-top:4px}
.header-left{width:44px;display:flex;align-items:center;justify-content:flex-start;padding-left:8px}
.header-right{width:44px;display:flex;align-items:center;justify-content:flex-end;padding-right:8px}
.pj-logo{height:44px;width:auto;display:block;filter:drop-shadow(0 1px 2px rgba(0,0,0,0.2))}
.icon-btn{width:44px;height:44px;border-radius:8px;border:0;background:rgba(255,255,255,0.12);display:flex;align-items:center;justify-content:center;color:#fff}

/* Main grid */
.main{padding:8px; height:42.5vh; width:100%}
.light-bg{background:var(--light)}
.grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  grid-template-rows:repeat(3,1fr);
  gap:8px;
  width:100%;
  height:100%;
}
.box{
  position:relative;
  border-radius:var(--box-radius);
  overflow:hidden;
  border:0;
  min-height:0;
  height:100%;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  background-size:cover;
  background-position:center;
  padding:10px;
  box-shadow:0 1px 3px rgba(0,0,0,0.08);
}
.box-overlay{
  width:100%;
  text-align:center;
  background:linear-gradient(0deg, rgba(0,0,0,0.45), rgba(0,0,0,0.18));
  color:white;
  padding:8px 6px;
  font-weight:600;
  border-radius:6px;
  font-size:12px;
}

/* Carousel */
.carousel{
  width:100%;
  height:30vh;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  gap:8px;
}
.green-bg{background:var(--green);padding:8px}
.slides{width:100%;height:calc(100% - 42px);border-radius:10px;overflow:hidden;position:relative;box-shadow:0 2px 6px rgba(0,0,0,0.12)}
.slide{position:absolute;inset:0;background-size:cover;background-position:center;opacity:0;transition:opacity .6s ease;}
.slide.active{opacity:1}
.carousel-controls{display:flex;align-items:center;justify-content:center;gap:8px}
.small-btn{width:36px;height:36px;border-radius:8px;border:0;background:rgba(255,255,255,0.18);color:#fff;font-size:18px}

/* Dots */
.dots{display:flex;gap:6px}
.dots button{width:8px;height:8px;border-radius:50%;border:0;background:rgba(255,255,255,0.5)}
.dots button.active{background:#fff}

/* Bottom nav */
.bottom-nav{
  position:fixed;
  left:8px;
  right:8px;
  bottom:10px;
  height:54px;
  background:#fff;
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:space-around;
  box-shadow:0 6px 18px rgba(0,0,0,0.12);
  z-index:50;
}
.nav-btn{
  background:transparent;border:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;color:var(--text);font-size:11px;
}
.nav-btn svg{color:var(--text)}

/* ========= NUEVO: VISTAS COMO PANTALLAS OVERLAY ========= */
.view-panel{
  display:none;                 /* showView lo pone en block */
  position: fixed;
  left: 0;
  right: 0;
  top: calc(12.5vh + 0px);      /* debajo del header */
  bottom: 78px;                 /* arriba del bottom nav */
  background: var(--light);
  padding: 12px;
  overflow: auto;
  z-index: 200;                 /* por arriba del contenido */
  -webkit-overflow-scrolling: touch;
}

.view-panel h2{margin:0 0 10px 0}
.view-panel h3{margin:14px 0 8px 0}

.view-panel input,
.view-panel select,
.view-panel textarea{
  width: 100%;
  max-width: 820px;
  padding: 10px;
  border: 1px solid #cfd8dc;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
}

.view-panel button{
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-weight: 600;
}

.view-panel button.secondary{
  background: #6c7a89;
}

/* ========= NUEVO: MODAL SIEMPRE ARRIBA ========= */
#modalObra{
  display:none;
  position:fixed !important;
  inset:0 !important;
  background:rgba(0,0,0,.55) !important;
  align-items:center !important;
  justify-content:center !important;
  padding:16px !important;
  z-index: 999999 !important;
}

#modalObra > div{
  background:#fff;
  width:100%;
  max-width:520px;
  border-radius:10px;
  padding:16px;
}

#modalObra input{
  width:100%;
  padding:10px;
  border:1px solid #cfd8dc;
  border-radius:8px;
}

/* Responsive */
button{touch-action:manipulation}
@media (min-width:760px){
  .header .title{font-size:16px}
  .box-overlay{font-size:13px}
}