/* =========================================================
   EGSB – CSS DEFINITIVO (NO DUPLICATI / NO CONFLITTI)
   ========================================================= */

/* Base reset interno */
.egsb,
.egsb * {
  box-sizing: border-box;
}

.egsb {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.egsb img {
  max-width: 100%;
  display: block;
}

.egsb p { margin: 0; }
.egsb h2 { margin: 0; }
egsb h3 { margin-bottom: 10px; }
/* =========================
   ALERTS
   ========================= */
.egsb-alert {
  padding: 12px 14px;
  border-radius: 12px;
  margin: 12px 0;
}
.egsb-alert-error{
  background: rgba(176,0,32,.08);
  border: 1px solid rgba(176,0,32,.25);
}

/* =========================
   LABELS + INPUTS
   ========================= */
.egsb-label {
  display: block;
  font-size: 12px;
  opacity: .75;
}

.egsb-input,
.egsb-select{
  width: 100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,.14);
  outline: none;
  background: #fff;
}

.egsb-input:focus,
.egsb-select:focus{
  border-color: rgba(0,0,0,.35);
  box-shadow: 0 0 0 4px rgba(0,0,0,.06);
}

/* =========================
   BUTTONS
   ========================= */
.egsb-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  cursor: pointer;
  border-radius: 14px;
  padding: 0 16px;
  font-weight: 800;
  white-space: nowrap;
  height: 44px;
}

.egsb-btn-primary{ background:#111; color:#fff; }
.egsb-btn-primary svg{ fill:currentColor; }

.egsb-btn-lg{ height: 48px; padding: 0 18px; border-radius: 16px; }

/* =========================
   SEARCH BAR
   ========================= */
.egsb.egsb-search{
  display:flex;
  justify-content:center;
}

.egsb-search .egsb-search-form{
  width:100%;
  max-width:400px;
}

.egsb-search-bar{
  width:100%;
  padding:14px;
  border:1px solid rgba(0,0,0,.10);
  border-radius:16px;
  box-shadow:0 10px 30px rgba(0,0,0,.06);
  background:#fff;
  gap:12px;
}

.egsb-search-bar[data-egsb-layout="single"]{
  display:grid;
  grid-template-columns: 1fr auto;
  align-items:end;
}

.egsb-field-date-single,
.egsb-field-submit{ min-width:0; }

.egsb-search-bar input[type="date"].egsb-input{
  padding-right:44px;
  text-align:center;
  height:44px;
}

@media (max-width: 520px){
  .egsb-search-bar[data-egsb-layout="single"]{
    grid-template-columns: 1fr;
  }
  .egsb-search-bar[data-egsb-layout="single"] .egsb-btn{
    width:100%;
  }
}

@media (max-width: 900px){
  .egsb.egsb-search{ display:block; }
  .egsb-search .egsb-search-form{ max-width:none; }
}

/* =========================
   WRAPPER LISTING
   ========================= */
.egsb.egsb-listing,
.egsb.egsb-booking{
  max-width: 1180px;
  margin: 0 auto;
}

/* =========================
   LIST VERTICALE + DIVIDER
   ========================= */
.egsb-list{
  display:flex;
  flex-direction: column;
  gap: 16px;
}

.egsb-level-divider{
  display:flex;
  align-items:center;
  gap:12px;
  margin: 12px 0;
  color: rgba(0,0,0,.55);
  font-weight: 900;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.egsb-level-divider::before,
.egsb-level-divider::after{
  content:"";
  height: 1px;
  background: rgba(0,0,0,.12);
  flex: 1;
}
.egsb-level-divider span{
  white-space: nowrap;
}

/* =========================
   CARD RIGA (LISTING + BOOKING)
   FOTO | TESTO | QTY
   ========================= */
.egsb-item{
  display: grid;
  grid-template-columns: 200px 1fr 240px;
  gap: 18px;
  align-items: center;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(0,0,0,.10);
  background: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,.05);
}

/* MEDIA */
.egsb-item-media{
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(0,0,0,.05);
  aspect-ratio: 4 / 3;
}

.egsb-item-media img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.egsb-item-media-placeholder{
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,.06);
}

/* TESTO */
.egsb-item-main{
  min-width: 0;
}

.egsb-item-title{
  font-size: 18px;
  line-height: 1.2;
  font-weight: 900;
  margin-bottom: 6px;
}

.egsb-item-desc{
  opacity: .80;
  line-height: 1.5;
}

/* WARNING */
.egsb-item-warning{
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(176,0,32,.06);
  border: 1px solid rgba(176,0,32,.16);
  font-weight: 800;
  font-size: 13px;
  opacity: .9;
}

/* =========================
   QTY BOX (DESTRA)
   ========================= */
.egsb-item-qty{
  justify-self: end;
  display:flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.egsb-qty-head{
  display:flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

/* label compatta (non va a capo) */
.egsb-qty-head .egsb-label{
  margin: 0;
  white-space: nowrap;
}

/* badge MAX: sempre in riga */
.egsb-max-badge{
  display:inline-flex;
  align-items:center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0,0,0,.06);
  border: 1px solid rgba(0,0,0,.08);
  font-weight: 900;
  font-size: 11px;
  white-space: nowrap;
}

.egsb-max-ico svg{ display:block; }

.egsb-qty-input{
  width: 140px;
  height: 44px;
  margin-left: auto;     /* resta allineato a destra */
  text-align: center;
  font-weight: 900;
  border-radius: 14px;
}

/* prezzo sotto input, pulito */
.egsb-qty-meta{
  text-align: right;
  display:flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  opacity: .88;
}

.egsb-qty-unit{ opacity: .72; }
.egsb-qty-total{ opacity: .92; font-size: 13px; }
.egsb-total-value{ font-weight: 950; }

/* Locked */
.egsb-item.is-locked .egsb-qty-input{
  opacity: .55;
  cursor: not-allowed;
}
.egsb-item.is-locked .egsb-qty-meta{
  opacity: .70;
}

/* =========================
   STICKY ACTIONS
   ========================= */
.egsb-sticky-actions{
  position: sticky;
  bottom: 12px;
  margin-top: 16px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(0,0,0,.10);
  backdrop-filter: blur(8px);
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:space-between;
}

/* =========================
   BOOKING SUMMARY + FORM
   ========================= */
.egsb-summary{
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,.10);
  background:#fff;
  box-shadow: 0 10px 30px rgba(0,0,0,.06);
}

.egsb-form-wrap{ margin-top: 16px; }
.egsb-form label{ display:block; margin:10px 0 6px; font-size:12px; opacity:.75; }

.egsb-row{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 640px){
  .egsb-row{ grid-template-columns: 1fr; }
}

/* =========================
   MOBILE
   ========================= */
@media (max-width: 900px){
  .egsb-item{
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .egsb-item-media{
    aspect-ratio: 16 / 9;
  }

  .egsb-item-qty{
    justify-self: stretch;
  }

  .egsb-qty-input{
    width: 100%;
    margin-left: 0;
  }

  .egsb-qty-meta{
    text-align: left;
  }
}


.egsb-sticky-actions--summary{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 14px;
}

.egsb-sticky-summary{
  display:flex;
  align-items:baseline;
  gap: 18px;
}

.egsb-sticky-label{
  display:block;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .65;
  margin-bottom: 2px;
}

.egsb-sticky-value{
  font-size: 18px;
  font-weight: 950;
  white-space: nowrap;
}

.egsb-submit-btn.is-disabled{
  opacity: .55;
  cursor: not-allowed;
}

@media (max-width: 640px){
  .egsb-sticky-actions--summary{
    flex-direction: column;
    align-items: stretch;
  }
  .egsb-sticky-summary{
    justify-content: space-between;
  }
  .egsb-submit-btn{
    width: 100%;
  }
  
  .egsb h3 { margin-bottom: 10px; }
}

/* Box dati utente: bianco come la card sopra, ma ben percepibile */
.egsb-user-card{
  background: #fff;                       /* torna BIANCO */
  border: 1px solid rgba(0,0,0,.12);      /* bordo più leggibile */
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,.08); /* ombra più evidente */
  margin-top: 14px;
}

/* Spaziatura interna */
.egsb-user-card .egsb-row + .egsb-row{
  margin-top: 14px;
}

/* Input bianchi (se qualche regola li “sporca”) */
.egsb-user-card .egsb-input{
  background: #fff;
}


.egsb.egsb-search[tabindex="-1"]:focus,
.egsb.egsb-search[tabindex="-1"]:focus-visible{
  outline: none !important;
  box-shadow: none !important;
}

.egsb.egsb-search[tabindex="-1"]:focus,
.egsb.egsb-search[tabindex="-1"]:focus-visible,
.wp-block-post-title[tabindex="-1"]:focus,
.wp-block-post-title[tabindex="-1"]:focus-visible{
  outline: none !important;
  box-shadow: none !important;
}


.egsb-legal-card{ padding:16px; }

.egsb-legal-card .egsb-checkline{
  display:flex;
  align-items:flex-start;
  gap:14px;
  padding:12px 0;
  margin:0;
  cursor:pointer;
}

.egsb-legal-card .egsb-checkline + .egsb-checkline{
  border-top:1px solid rgba(0,0,0,.08);
}

.egsb-legal-card .egsb-checkline input{
  width:24px;
  height:24px;
  margin-top:2px;
  flex:0 0 auto;
}

.egsb-legal-card .egsb-checkline span{
  font-size:1.15rem;
  line-height:1.5;
}

/* QUI: link blu + sottolineato, senza scegliere “un colore custom” */
.egsb-legal-card a.egsb-legal-link{
  color: LinkText !important;              /* colore link di sistema */
  text-decoration: underline !important;
}

/* se il tema aggiunge icone a target=_blank */
.egsb-legal-card a[target="_blank"]::after{
  content:none !important;
  display:none !important;
}

@media (max-width:600px){
  .egsb-legal-card .egsb-checkline span{ font-size:1.05rem; line-height:1.55; }
  .egsb-legal-card .egsb-checkline input{ width:26px; height:26px; }
}

