/* ALK Variant Choice - theme picker modal
   Everything is scoped under #alk-vc-modal so it cannot leak into the theme.
   Buttons keep the theme's own .btn classes so they stay on brand. */

#alk-vc-modal .modal-dialog {
  max-width: 780px;
}

#alk-vc-modal .modal-content {
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .18);
}

#alk-vc-modal .modal-header {
  align-items: flex-start;
  padding: 20px 24px 14px;
  border-bottom: 1px solid rgba(0, 0, 0, .07);
}

#alk-vc-modal .modal-title {
  display: block;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
}

#alk-vc-modal .alk-vc-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: #6b7280;
}

#alk-vc-modal .modal-body {
  padding: 20px 24px;
}

#alk-vc-modal .modal-footer {
  padding: 14px 24px 18px;
  border-top: 1px solid rgba(0, 0, 0, .07);
}

/* --- choice grid --- */

.alk-vc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 14px;
}

.alk-vc-choice {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 10px 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  color: inherit;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.alk-vc-choice:hover {
  border-color: #c7ccd3;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .08);
  transform: translateY(-2px);
}

.alk-vc-choice:focus-visible {
  outline: 2px solid #1f2937;
  outline-offset: 2px;
}

.alk-vc-choice img,
.alk-vc-no-image {
  width: 100%;
  height: 152px;
  margin-bottom: 10px;
  padding: 4px;
  border-radius: 8px;
  background: #f6f7f9;
  object-fit: contain;
}

.alk-vc-no-image {
  display: block;
}

/* --- "no preference" card: blurred cover + dice badge --- */

.alk-vc-choice .alk-vc-any-media {
  position: relative;
  display: block;
  width: 100%;
  height: 152px;
  margin-bottom: 10px;
  border-radius: 8px;
  background: #f6f7f9;
  overflow: hidden;
}

.alk-vc-choice .alk-vc-any-media img {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 4px;
  border-radius: 0;
  background: none;
  object-fit: contain;
  filter: blur(5px) saturate(.7);
  transform: scale(1.08);
}

.alk-vc-any-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
  color: #1f2937;
  transform: translate(-50%, -50%);
}

.alk-vc-any-badge svg {
  width: 24px;
  height: 24px;
}

/* label is optional: with no <strong> after it, the image is the last child and
   centres itself instead of leaving dead space at the bottom of the card */
.alk-vc-choice > img:last-child,
.alk-vc-choice > .alk-vc-no-image:last-child,
.alk-vc-choice > .alk-vc-any-media:last-child {
  margin-top: auto;
  margin-bottom: auto;
}

/* reserve two lines so tiles with short and long labels stay aligned */
.alk-vc-choice strong {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 2.5em;
  margin-top: auto;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

/* selected state: brand-neutral so it works on any theme colour */
.alk-vc-choice.is-selected {
  border-color: #1f2937;
  box-shadow: 0 0 0 2px #1f2937 inset, 0 6px 16px rgba(0, 0, 0, .1);
  transform: translateY(-2px);
}

.alk-vc-choice .alk-vc-tick {
  position: absolute;
  z-index: 2; /* the "any" media wrapper is positioned and would paint over it */
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #1f2937;
  color: #fff;
  font-size: 12px;
  line-height: 1;
  opacity: 0;
  transform: scale(.6);
  transition: opacity .15s ease, transform .15s ease;
}

.alk-vc-choice.is-selected .alk-vc-tick {
  opacity: 1;
  transform: scale(1);
}

/* --- footer --- */

/* neutral disabled look: the theme paints disabled primaries in a brand colour,
   which would read as "clickable" here */
#alk-vc-modal .alk-vc-continue:disabled {
  background: #e5e7eb;
  border-color: #e5e7eb;
  color: #9ca3af;
  cursor: not-allowed;
  box-shadow: none;
}

@media (max-width: 575px) {
  #alk-vc-modal .modal-header,
  #alk-vc-modal .modal-body,
  #alk-vc-modal .modal-footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .alk-vc-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .alk-vc-choice img,
  .alk-vc-no-image,
  .alk-vc-choice .alk-vc-any-media {
    height: 132px;
  }

  .alk-vc-choice .alk-vc-any-media img {
    height: 100%;
  }

  .alk-vc-any-badge {
    width: 40px;
    height: 40px;
  }

  .alk-vc-any-badge svg {
    width: 21px;
    height: 21px;
  }

  #alk-vc-modal .alk-vc-continue {
    min-width: 120px;
  }
}
