/* ============================================================
   RapiShop — Marketplace local · Tema café (#382417)
   Estilos compartidos (portar a resources/css en Laravel)
   ============================================================ */

:root {
  --brand-50:  #f7f3f0;
  --brand-100: #ebe3dc;
  --brand-200: #d4c4b5;
  --brand-500: #5c3d28;
  --brand-600: #382417;
  --brand-700: #2a1b11;
  --brand-800: #1a110a;

  --ink:       #1a110a;
  --muted:     #6b5a4d;
  --line:      #e8e0d8;
  --surface:   #ffffff;
  --canvas:    #f8f5f2;
  --amber:     #c9842a;

  --radius:    16px;
  --shadow-sm: 0 1px 2px rgba(56, 36, 23, .08);
  --shadow-md: 0 8px 24px rgba(56, 36, 23, .10);
  --shadow-lg: 0 20px 48px rgba(56, 36, 23, .14);
}

* { -webkit-font-smoothing: antialiased; }

html {
  height: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px; /* navbar sticky: anclas no quedan tapadas */
}

/* Layout de página: footer siempre al fondo del viewport
   (usar <footer class="site"> en módulos públicos) */
body {
  margin: 0;
  min-height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  line-height: 1.6;
}

h1, h2, h3, h4, .display-6, .navbar-brand {
  font-family: 'Sora', 'Inter', sans-serif;
  letter-spacing: -.02em;
}

a { text-decoration: none; }

/* ---------- Utility color helpers ---------- */
.text-brand   { color: var(--brand-600) !important; }
.bg-brand     { background: var(--brand-600) !important; }
.bg-brand-50  { background: var(--brand-50)  !important; }
.bg-canvas    { background: var(--canvas)    !important; }
.text-muted-2 { color: var(--muted) !important; }

/* ---------- Buttons ---------- */
.btn { border-radius: 12px; font-weight: 600; padding: .6rem 1.15rem; max-width: 100%; min-width: 0; height: auto; min-height: 42px; white-space: normal; overflow-wrap: break-word; line-height: 1.45; }
.btn-sm { min-height: 34px; }
.form-select { padding-inline-end: 2.75rem; }
.btn-brand {
  background: var(--brand-600); border-color: var(--brand-600); color: #fff;
}
.btn-brand:hover { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
.btn-outline-brand {
  border: 1.5px solid var(--brand-600); color: var(--brand-700); background: transparent;
}
.btn-outline-brand:hover { background: var(--brand-50); color: var(--brand-800); }
.btn-soft {
  background: var(--brand-50); color: var(--brand-700); border: none;
}
.btn-soft:hover { background: var(--brand-100); color: var(--brand-800); }

/* ---------- Navbar ---------- */
.navbar {
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.navbar-brand { font-weight: 800; font-size: 1.35rem; }
.site-logo { display: block; flex-shrink: 0; width: 160px; height: auto; object-fit: contain; object-position: center; border-radius: 8px; background: #fff; }
.brand-dot {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--brand-600); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1rem;
}

/* ---------- Cards ---------- */
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease;
}
.biz-card { overflow: hidden; height: 100%; }
.biz-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.biz-card .card-img-top { height: 180px; object-fit: cover; }

.badge-soft {
  background: var(--brand-50); color: var(--brand-700);
  border-radius: 999px; padding: .35rem .7rem; font-weight: 600; font-size: .78rem;
}
.badge-verified {
  background: var(--brand-600); color: #fff;
  border-radius: 999px; padding: .3rem .6rem; font-size: .72rem; font-weight: 600;
}
.chip {
  display: inline-flex; align-items: center; gap: .35rem;
  background: #fff; border: 1px solid var(--line); color: var(--ink);
  border-radius: 999px; padding: .45rem .9rem; font-weight: 600; font-size: .85rem;
  cursor: pointer; transition: all .15s ease; white-space: nowrap;
}
.chip:hover { border-color: var(--brand-500); color: var(--brand-700); }
.chip.active { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }

.rating { color: var(--amber); font-weight: 700; }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(1200px 400px at 80% -10%, var(--brand-50), transparent),
    var(--surface);
  border-bottom: 1px solid var(--line);
}
.hero-img { border-radius: 22px; box-shadow: var(--shadow-lg); }

.search-shell {
  background: #fff; border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow-md); padding: .5rem;
}
.search-shell .form-control,
.search-shell .form-select { border: none; box-shadow: none; }
.search-shell .form-control:focus,
.search-shell .form-select:focus { box-shadow: none; }

/* ---------- Map ---------- */
.map-wrap {
  position: relative; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  min-height: 420px; background:
    linear-gradient(rgba(255,255,255,.15), rgba(255,255,255,.15)),
    url('../img/map-placeholder.png') center/cover no-repeat;
}
.map-wrap-live {
  background: var(--brand-50);
}
#map { position: absolute; inset: 0; z-index: 1; }
.map-wrap iframe#map {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.rs-map-marker { background: transparent; border: 0; }
.rs-pin {
  width: 36px; height: 36px; border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: var(--brand-600); color: #fff;
  display: grid; place-items: center;
  box-shadow: var(--shadow-md);
}
.rs-pin i { transform: rotate(45deg); font-size: .95rem; }
.rs-popup { font-size: .85rem; line-height: 1.35; min-width: 140px; }
.rs-popup a { color: var(--brand-700); font-weight: 600; }
.map-overlay-note {
  position: absolute; left: 12px; bottom: 12px; z-index: 500;
  background: rgba(255,255,255,.92); border: 1px solid var(--line);
  border-radius: 10px; padding: .5rem .75rem; font-size: .78rem; color: var(--muted);
  box-shadow: var(--shadow-sm);
}

/* ---------- Módulo Mapa (vista completa) ---------- */
.map-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
}
.map-page-toolbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.map-page-canvas {
  position: relative;
  flex: 1;
  min-height: 55vh;
  background: var(--brand-50);
}
#mapFull {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* ---------- Sections ---------- */
.section { padding: 4rem 0; }
.eyebrow {
  color: var(--brand-700); font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; font-size: .78rem;
}
.cat-tile {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 1.1rem; text-align: center; color: var(--ink);
  transition: all .16s ease; height: 100%;
}
.cat-tile:hover { border-color: var(--brand-500); transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.cat-tile i { font-size: 1.6rem; color: var(--brand-600); }

/* ---------- Business detail ---------- */
.biz-cover { height: 320px; object-fit: cover; width: 100%; border-radius: 0 0 24px 24px; }
.biz-logo {
  width: 96px; height: 96px; border-radius: 20px; object-fit: cover;
  border: 4px solid #fff; box-shadow: var(--shadow-md); background: #fff;
}
.stat-pill {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: .75rem 1rem; text-align: center;
}
.stat-pill .n { font-family: 'Sora', sans-serif; font-weight: 800; font-size: 1.15rem; }
.prod-card { overflow: hidden; height: 100%; }
.prod-card .card-img-top { height: 160px; object-fit: cover; }
.prod-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.sticky-side { position: sticky; top: 90px; }

.hours-row { display: flex; justify-content: space-between; padding: .35rem 0; border-bottom: 1px dashed var(--line); }
.hours-row:last-child { border-bottom: none; }

/* ---------- Footer ---------- */
/* ---------- Footer (sticky al fondo) ---------- */
footer.site {
  margin-top: auto;
  background: var(--brand-800);
  color: #ebe3dc;
  width: 100%;
  flex-shrink: 0;
}
footer.site a { color: #ebe3dc; opacity: .85; }
footer.site a:hover { opacity: 1; color: #fff; }

/* ---------- Misc ---------- */
.divider { height: 1px; background: var(--line); border: 0; }
.locked-blur { filter: blur(4px); user-select: none; pointer-events: none; }

/* Public discovery and account actions remain usable with touch and keyboard. */
.publication-price { font-size:1.4rem; font-weight:800; color:var(--brand-600); margin-bottom:.7rem; }
.publication-card:hover, .publication-card:focus-within { transform:translateY(-4px); box-shadow:var(--shadow-md); }
.publication-image { overflow:hidden; display:block; }
.publication-image img { transition:transform .2s ease; }
.publication-card:hover .publication-image img { transform:scale(1.035); }
.publication-detail-image { text-align:center; background:var(--brand-50); padding:1rem; border-radius:12px; }
.purpose-section { border-bottom:1px solid var(--line); }
.purpose-story summary { color:var(--brand-600); font-weight:700; cursor:pointer; padding:.65rem 0; min-height:44px; }
:where(a, button, summary, input, select, textarea):focus-visible { outline:3px solid #c9842a; outline-offset:4px; }
@media (max-width:991.98px) {
  .public-account-actions .btn { min-height:44px; font-size:.85rem; padding:.55rem .7rem; }
  .navbar .navbar-brand { margin-right:.5rem; }
  .navbar .site-logo { width:130px; }
}
@media (max-width:399.98px) {
  .navbar .container > .navbar-brand { flex:1; }
  .public-account-actions { order:3; width:100%; margin-top:.5rem; }
  .public-account-actions .btn { flex:1; }
  .navbar .navbar-toggler { order:2; }
  #publicNav { order:4; }
}
@media (prefers-reduced-motion:reduce) {
  .publication-card, .publication-image img { transition:none; transform:none !important; }
}

.access-screen{min-height:calc(100dvh - 190px);display:grid;place-items:center;padding:2rem 1rem}
@media(max-width:991.98px){.navbar .navbar-collapse .nav-link{padding:.6rem}.navbar .navbar-collapse .btn{max-width:100%}}
@media(max-width:575.98px){.prod-card .card-img-top{height:210px;object-fit:cover}.prod-card .card-body{overflow-wrap:anywhere}.btn-group{max-width:100%;flex-wrap:wrap}}

.publication-detail-grid{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);gap:clamp(1.5rem,4vw,4rem);align-items:start}
.publication-gallery{min-width:0;background:#fff;border:1px solid var(--line);border-radius:22px;overflow:hidden}
.publication-zoom{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1rem;width:100%;border:0;background:#fff;padding:clamp(1rem,3vw,2rem);cursor:zoom-in;color:var(--muted)}
.publication-zoom img{width:100%;height:clamp(300px,40vw,510px);object-fit:contain;transition:transform .2s}
.publication-zoom:hover img{transform:scale(1.025)}
.publication-zoom span{font-size:.8rem}
.publication-info{min-width:0;padding-block:1rem;overflow-wrap:anywhere}
.publication-title{font-size:clamp(1.6rem,3vw,2.5rem);line-height:1.2;font-weight:800}
.publication-main-price{font-size:2rem;margin-top:1.5rem}
.publication-description{white-space:pre-line;line-height:1.85;color:var(--muted)}
.publication-contact{border-top:1px solid var(--line);padding-top:1rem}
.publication-contact summary{cursor:pointer;min-height:44px}
.publication-full-image{max-width:100%;max-height:78dvh;object-fit:contain}
@media(max-width:767.98px){.publication-detail-grid{grid-template-columns:minmax(0,1fr);gap:1rem}.publication-info{padding:.5rem}.publication-zoom img{height:300px}.publication-page .btn{min-height:44px}.publication-info>.d-flex .btn{flex:1 1 12rem}}
@media(prefers-reduced-motion:reduce){.publication-zoom img{transition:none;transform:none!important}}
