.wcrw-modal { 
  display:none; 
}

.wcrw-modal.is-open { 
  display:block; 
  position:fixed; 
  inset:0; 
  z-index:99999; 
}

/* Backdrop fade */
.wcrw-modal__backdrop{
  position:absolute; inset:0;
  background: rgba(0,0,0,.55);
  opacity:0;
  transition: opacity .22s ease;
}

.wcrw-modal.is-open .wcrw-modal__backdrop{
  opacity:1;
}

/* Panel pop + slide */
.wcrw-modal__panel{
  position:relative;
  width:min(560px, calc(100% - 24px));
  margin: 6vh auto;
  background:#fff;
  border-radius:16px;
  box-shadow: 0 25px 60px rgba(0,0,0,.35);
  overflow:hidden;

  opacity:0;
  transform: translateY(12px) scale(.98);
  transition: opacity .22s ease, transform .22s ease;
}

.wcrw-modal.is-open .wcrw-modal__panel{
  opacity:1;
  transform: translateY(0) scale(1);
}

.wcrw-modal__header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:16px 18px;
  border-bottom:1px solid #eee;
  background:#fafafa;
}

.wcrw-x{
  width:36px;
  height:36px;
  border-radius:50%;
  border:0;
  background:#f1f1f1;
  font-size:20px;
  font-weight:700;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  transition:all .2s ease;
}

.wcrw-x:hover{
  background:#e53935;
  color:#fff;
}

.wcrw-modal__body{ padding:18px; }

.wcrw-product__name{
  font-weight:800;
  font-size:17px;
  margin-bottom:8px;
}

#wcrw-form label{
  display:block;
  font-weight:700;
  margin:12px 0 6px;
}

.wcrw-req{ color:#b00; }

#wcrw-form input, 
#wcrw-form textarea, 
#wcrw-form select{
  width:100%;
  border:1px solid #ddd;
  border-radius:10px;
  padding:10px 12px;
  font-weight:500;
  background:#fff;
}

#wcrw-form input:focus,
#wcrw-form textarea:focus,
#wcrw-form select:focus{
  outline:none;
  border-color:#0073aa;
  box-shadow:0 0 0 2px rgba(0,115,170,.15);
}

.wcrw-actions{
  margin-top:16px;
  display:flex;
  gap:10px;
  justify-content:flex-end;
}

.wcrw-status{
  margin-top:10px;
  font-size:13px;
  opacity:.85;
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce){
  .wcrw-modal__backdrop,
  .wcrw-modal__panel{
    transition:none !important;
  }
}

/* Precio doble ARS + USD */
.wcrw-dual-price{display:inline-block;line-height:1.2}
.wcrw-dual-price .wcrw-price-ars{font-size:16px}
.wcrw-dual-price .wcrw-price-usd{opacity:.85}


/* ===== Modal Layout Improvements v1.6.0 ===== */

/* Prevent excessive height */
.wcrw-modal__panel,
.wcrw-box{
  max-height: 90vh;
  overflow-y: auto;
}

/* Grid layout for form */
#wcrw-form{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

/* Full width elements */
#wcrw-form textarea,
#wcrw-form button,
#wcrw-form .wcrw-full{
  grid-column: 1 / -1;
}

/* Labels spacing */
#wcrw-form label{
  margin-top: 8px;
}

/* Responsive: single column on mobile */
@media (max-width: 640px){
  #wcrw-form{
    grid-template-columns: 1fr;
  }
}



/* ===== UI Premium v1.7.0 (bloques + compacto + bottom sheet + footer fijo) ===== */

/* Modal visibility without display:none to allow exit animation */
.wcrw-modal{
  position:fixed;
  inset:0;
  z-index:99999;
  opacity:0;
  pointer-events:none;
  transition: opacity .22s ease;
}
.wcrw-modal.is-open{
  opacity:1;
  pointer-events:auto;
}

.wcrw-modal__backdrop{
  opacity:0;
  transition: opacity .22s ease;
}
.wcrw-modal.is-open .wcrw-modal__backdrop{ opacity:1; }

/* Panel: desktop */
.wcrw-modal__panel{
  max-height: 90vh;
  display:flex;
  flex-direction:column;
  opacity:0;
  transform: translateY(12px) scale(.98);
  transition: opacity .22s ease, transform .22s ease;
}
.wcrw-modal.is-open .wcrw-modal__panel{
  opacity:1;
  transform: translateY(0) scale(1);
}

/* Scroll only body; footer stays visible */
.wcrw-modal__body{
  overflow:auto;
  padding:14px 16px 14px;
}
.wcrw-modal__footer{
  border-top:1px solid #eee;
  background:#fff;
  padding:12px 16px;
  position:sticky;
  bottom:0;
}

/* Compact inputs (booking-like) */
#wcrw-form label{
  margin:6px 0 6px !important;
  font-size:13px;
}
#wcrw-form input, #wcrw-form textarea, #wcrw-form select{
  padding:9px 10px !important;
  border-radius:10px !important;
  font-size:14px;
}
#wcrw-form textarea{ min-height:84px; }

/* Sections */
.wcrw-section{
  background:#fafafa;
  border:1px solid #eee;
  border-radius:14px;
  padding:12px;
  margin:10px 0;
}
.wcrw-section__title{
  font-weight:800;
  font-size:13px;
  margin-bottom:10px;
  opacity:.9;
}

/* Grid 2 columns */
.wcrw-grid{
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap:10px 12px;
}
.wcrw-field{ min-width:0; }
.wcrw-full{ grid-column: 1 / -1; }

/* Footer actions */
.wcrw-actions{
  margin:0 !important;
  justify-content:space-between;
}
.wcrw-actions .button{
  min-height:40px;
}
#wcrw-submit{
  min-width: 200px;
}

/* Mobile: bottom sheet */
@media (max-width: 640px){
  .wcrw-modal__panel{
    width: 100% !important;
    margin: 0 !important;
    border-radius: 16px 16px 0 0 !important;
    position:absolute;
    left:0; right:0; bottom:0;
    transform: translateY(100%);
    opacity:1; /* handled by modal */
  }
  .wcrw-modal.is-open .wcrw-modal__panel{
    transform: translateY(0);
  }
  .wcrw-modal__header{
    border-radius: 16px 16px 0 0;
  }
  .wcrw-grid{
    grid-template-columns: 1fr;
  }
  #wcrw-submit{ min-width: 160px; }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce){
  .wcrw-modal,
  .wcrw-modal__backdrop,
  .wcrw-modal__panel{
    transition:none !important;
  }
}


/* Lock background scroll when modal is open */
.wcrw-no-scroll{ overflow:hidden !important; }


/* ===== Desktop/Tablet polish v1.7.3 ===== */

/* Larger, better-proportioned panel on desktop/tablet */
@media (min-width: 641px){
  .wcrw-modal__panel{
    width: clamp(560px, 72vw, 880px);
    margin: 5vh auto !important;
    border-radius: 18px !important;
  }
  .wcrw-modal__header{
    padding: 18px 20px !important;
  }
  .wcrw-modal__header h3{
    font-size: 18px;
    margin: 0;
    line-height: 1.2;
  }
  .wcrw-modal__body{
    padding: 16px 20px 14px !important;
  }
  .wcrw-modal__footer{
    padding: 12px 20px !important;
  }
  .wcrw-section{
    padding: 14px !important;
    border-radius: 16px !important;
  }
}

/* On large screens, show the two sections side-by-side (more compact height) */
@media (min-width: 980px){
  .wcrw-modal__body .wcrw-section-wrap{
    display:grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
  .wcrw-section{ margin: 0 !important; }
}

/* Small improvement: bigger close button hit area */
@media (min-width: 641px){
  .wcrw-x{
    width: 40px !important;
    height: 40px !important;
    font-size: 22px !important;
  }
}


/* ===== Fix espacio en blanco (desktop/tablet) v1.7.4 =====
   Antes: el panel era flex y el body crecía para empujar el footer abajo, dejando "aire" cuando había pocos campos.
   Ahora: el panel queda con altura natural (hasta 90vh) y solo el BODY scrollea si hace falta.
*/
@media (min-width: 641px){
  .wcrw-modal__panel{
    display:block !important;
    overflow:hidden; /* asegura que el scroll sea solo del body */
  }
  .wcrw-modal__body{
    overflow:auto !important;
    /* header + footer aprox 140px */
    max-height: calc(90vh - 140px) !important;
  }
  .wcrw-modal__footer{
    position:relative !important;
    bottom:auto !important;
  }
}

/* Mantener footer fijo solo en mobile (bottom sheet) */
@media (max-width: 640px){
  .wcrw-modal__panel{
    display:flex !important;
  }
  .wcrw-modal__body{
    flex:1 1 auto;
    overflow:auto;
  }
  .wcrw-modal__footer{
    position:sticky;
    bottom:0;
  }
}


/* ===== Fix ancho y espacio vacío (causado por CSS legacy de #wcrw-form grid) v1.7.5 =====
   En v1.6 se había dejado #wcrw-form como grid 2 columnas.
   En v1.7 el form ahora contiene secciones; ese grid hacía que el contenido ocupe solo media pantalla.
*/
#wcrw-form{
  display:block !important;
  grid-template-columns: none !important;
  gap: 0 !important;
}
