/* Chambre Wine Menus — frontend styles */

/* The section is moved (via JS) to sit directly after the selected menu's
   <label> inside the menu grid. Visually it should read as a "child" of
   that menu: indented, with a vertical connector line on the left.
   We use negative margins to overcome the grid's gap (gap-8 = 2rem)
   so it visually attaches to the menu above. */
.cwm-wine-section {
  margin-top: -1.5rem;  /* pull up to close the grid gap */
  margin-bottom: 0.5rem; /* small breathing room before next menu/section */
  padding-left: 2.5rem;
  position: relative;
}

.cwm-wine-section .cwm-wine-inner {
  position: relative;
  padding-left: 1.25rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

/* Vertical connector line along the left edge.
   Extend slightly above the inner box (top: -1rem) so the line visually
   begins at the bottom of the selected menu above. */
.cwm-wine-section .cwm-wine-inner::before {
  content: "";
  position: absolute;
  left: 0;
  top: -1rem;
  bottom: 0;
  width: 2px;
  background: #1f2937; /* gray-800 to match form border palette */
  opacity: 0.25;
}

/* Small horizontal "branch" line meeting the heading,
   reinforcing the parent→child visual relationship */
.cwm-wine-section .cwm-wine-heading {
  position: relative;
  font-size: 1rem;
  letter-spacing: 0.05em;
  text-align: left;
  padding-left: 1rem;
}

.cwm-wine-section .cwm-wine-heading::before {
  content: "";
  position: absolute;
  left: -1.25rem;
  top: 50%;
  width: 1rem;
  height: 2px;
  background: #1f2937;
  opacity: 0.25;
}

/* On narrow screens, soften the indentation so options don't get squeezed */
@media (max-width: 640px) {
  .cwm-wine-section {
    padding-left: 1rem;
  }
  .cwm-wine-section .cwm-wine-inner {
    padding-left: 1rem;
  }
  .cwm-wine-section .cwm-wine-heading {
    padding-left: 0.75rem;
  }
  .cwm-wine-section .cwm-wine-heading::before {
    left: -1rem;
    width: 0.75rem;
  }
}

.cwm-wine-option {
  position: relative;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.cwm-wine-option.cwm-selected {
  background-color: #1f2937; /* gray-800, matching parent plugin's selected state */
  color: #fff;
}

.cwm-wine-option .cwm-radio {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid currentColor;
  border-radius: 50%;
  margin-right: 0.75rem;
  position: relative;
  flex-shrink: 0;
}

.cwm-wine-option.cwm-selected .cwm-radio::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0.5rem;
  height: 0.5rem;
  background: currentColor;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

/* Modal */
.cwm-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.cwm-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.5);
}

.cwm-modal-box {
  position: relative;
  z-index: 1;
  background: #fff;
  border: 1px solid #000;
  padding: 2rem;
  max-width: 40rem;
  max-height: 90vh;
  overflow: auto;
  margin: auto;
}

.cwm-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  line-height: 1;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

.cwm-modal-content {
  text-align: left;
}

/* Error visibility is managed via JS — no CSS needed. */
