/*
 * A bound product's page (includes/class-vizfurniture-page.php): the full-screen
 * dialog, the gallery picture's 3D badge, the live gallery item. The buttons are
 * the theme's own (`single_add_to_cart_button button alt`); nothing here restyles
 * them. Logical properties throughout, so a right-to-left site mirrors.
 */

html.vizfurniture-locked,
html.vizfurniture-locked body {
  overflow: hidden !important;
}

.vizfurniture-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom)
    env(safe-area-inset-left);
  background: var(--wp--preset--color--base, #fff);
  color: var(--wp--preset--color--contrast, #1e1e1e);
}

.vizfurniture-modal[hidden] {
  display: none;
}

.vizfurniture-modal__head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
  padding: 8px 8px 8px 20px;
  padding-inline: 20px 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.vizfurniture-modal__title {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 1.1rem;
  line-height: 1.3;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.vizfurniture-modal__close {
  flex: none;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 30px;
  line-height: 44px;
  cursor: pointer;
}

.vizfurniture-modal__close:hover,
.vizfurniture-modal__close:focus-visible {
  background: rgba(0, 0, 0, 0.08);
}

.vizfurniture-modal__stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}

.vizfurniture-modal__stage vf-configurator {
  height: 100% !important;
}

.vizfurniture-modal__foot {
  flex: none;
  max-height: 55vh;
  overflow: auto;
  padding: 12px 20px;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
}

.vizfurniture-modal__foot form.cart,
.vizfurniture-live form.cart {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin: 0;
}

.vizfurniture-modal__foot form.cart .quantity,
.vizfurniture-live form.cart .quantity {
  float: none;
  margin: 0;
}

.vizfurniture-modal__foot form.cart .single_add_to_cart_button,
.vizfurniture-live form.cart .single_add_to_cart_button {
  float: none;
  margin: 0;
}

.vizfurniture-modal__foot .vizfurniture-quote {
  margin-bottom: 12px;
}

/* The quote request form: one field under another. */
.vizfurniture-quote .form-row {
  margin: 0 0 8px;
}

.vizfurniture-quote label {
  display: block;
}

.vizfurniture-quote input,
.vizfurniture-quote textarea {
  display: block;
  box-sizing: border-box;
  width: 100%;
  max-width: 32rem;
  margin-top: 4px;
}

.vizfurniture-quote textarea {
  min-height: 4.5em;
}

.vizfurniture-modal__foot [role='status']:not([hidden]) {
  margin: 0 0 12px;
}

@media (max-width: 600px) {
  .vizfurniture-modal__head {
    padding-inline: 14px 4px;
  }
  .vizfurniture-modal__foot {
    padding: 10px 14px;
  }
  .vizfurniture-modal__foot form.cart .single_add_to_cart_button {
    flex: 1;
  }
}

/* The Customize button above the theme's own Add to cart. */
.vizfurniture-customize {
  margin-bottom: 1em;
}

.vizfurniture-customize .single_add_to_cart_button {
  float: none;
}

/* The gallery picture of the standard design: a 3D badge on it. */
.vizfurniture-gallery-open {
  position: relative;
}

.vizfurniture-gallery-open a {
  cursor: pointer;
}

/* It opens the configurator: the gallery's hover zoom would only get in the way. */
.vizfurniture-gallery-open .zoomImg {
  display: none !important;
}

.vizfurniture-badge {
  position: absolute;
  inset-block-end: 12px;
  inset-inline-start: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 6px;
  padding-inline: 6px 12px;
  border-radius: 999px;
  background: rgba(20, 20, 20, 0.82);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  pointer-events: none;
}

.vizfurniture-badge__3d {
  padding: 4px 6px;
  border-radius: 999px;
  background: #fff;
  color: #141414;
  font-size: 11px;
  letter-spacing: 0.04em;
}

/* The live configurator as one more gallery item. */
.vizfurniture-live vf-configurator {
  display: block;
  width: 100%;
}

.vizfurniture-live form.cart {
  padding-top: 12px;
}

/* The edit screen's "Make the gallery picture": the configurator over the screen, a square. */
.vizfurniture-poster-stage {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.7);
}

.vizfurniture-poster-stage__square {
  background: #fff;
}
