/*
 * Journal3 product-options popup
 *
 * A compact purchase sheet shared by every storefront. Neutral surfaces and
 * ink are intentional: the tenant's existing cart button remains the one brand
 * accent, while the surrounding UI stays legible across light and dark skins.
 */

.popup-wrapper.popup-options,
html.popup-options {
  --options-popup-ink: #171a1f;
  --options-popup-muted: #687181;
  --options-popup-line: #e5e8ed;
  --options-popup-soft: #f6f7f9;
  --options-popup-focus: #252a32;
}

.popup-wrapper.popup-options {
  box-sizing: border-box;
  padding: 24px;
}

.popup-wrapper.popup-options .popup-bg {
  background: rgba(15, 18, 23, .66);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.popup-wrapper.popup-options .popup-container {
  width: min(800px, calc(100vw - 48px)) !important;
  max-width: 800px !important;
  max-height: calc(100dvh - 48px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 20px !important;
  background: #fff;
  box-shadow: 0 30px 90px rgba(7, 12, 20, .28);
  transform: translateY(16px) scale(.985);
  transition:
    opacity .2s ease,
    transform .24s cubic-bezier(.22, 1, .36, 1),
    visibility .2s ease,
    margin 0s;
}

.popup-open .popup-wrapper.popup-options .popup-container {
  transform: translateY(0) scale(1);
}

.popup-wrapper.popup-options .popup-body,
.popup-wrapper.popup-options .popup-inner-body {
  max-height: calc(100dvh - 48px);
  overflow: hidden;
  border-radius: inherit;
  background: #fff;
}

.popup-wrapper.popup-options iframe {
  display: block;
  width: 100%;
  max-height: calc(100dvh - 48px);
  border: 0;
  background: #fff;
}

.popup-wrapper.popup-options .popup-close {
  top: 14px;
  width: 40px;
  height: 40px;
  padding: 0 !important;
  transform: none;
  border: 1px solid var(--options-popup-line);
  border-radius: 50% !important;
  background: rgba(255, 255, 255, .96) !important;
  color: var(--options-popup-ink) !important;
  box-shadow: 0 3px 12px rgba(20, 27, 38, .1);
  opacity: 1;
}

html[dir="rtl"] .popup-wrapper.popup-options .popup-close {
  right: auto;
  left: 14px;
}

html[dir="ltr"] .popup-wrapper.popup-options .popup-close {
  right: 14px;
  left: auto;
}

.popup-wrapper.popup-options .popup-close::before {
  color: currentColor;
  font-size: 23px;
}

.popup-wrapper.popup-options .popup-close:hover,
.popup-wrapper.popup-options .popup-close:focus {
  border-color: #cbd1da;
  background: var(--options-popup-soft) !important;
  color: #000 !important;
}

.popup-wrapper.popup-options .popup-close:focus-visible {
  outline: 3px solid rgba(37, 42, 50, .18);
  outline-offset: 2px;
}

html.popup-options {
  min-height: 0 !important;
  overflow-x: hidden;
  background: #fff !important;
}

html.popup-options body {
  min-height: 0 !important;
  padding: 0 !important;
  background: #fff !important;
  color: #171a1f;
}

html.popup-options .site-wrapper,
html.popup-options .site-wrapper > .container,
html.popup-options .site-wrapper > .container > .row,
html.popup-options #content {
  min-height: 0 !important;
  background: #fff !important;
}

html.popup-options .product-info {
  display: block !important;
  width: 100%;
  min-height: 0;
  box-sizing: border-box;
  padding: 28px 30px 0 !important;
}

html.popup-options .product-info .product-right {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
}

html.popup-options .product-info .product-details {
  width: 100%;
  min-height: 0;
  padding-bottom: 0 !important;
}

html.popup-options .product-options-popup-summary {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  min-height: 72px;
  margin: 0 0 16px;
  padding-inline-end: 54px;
  align-items: center;
  gap: 14px;
}

html[dir="rtl"].popup-options .product-options-popup-summary {
  grid-template-columns: minmax(0, 1fr) 72px;
}

html[dir="rtl"].popup-options .product-options-popup-image {
  grid-column: 2;
}

html[dir="rtl"].popup-options .product-options-popup-title {
  grid-column: 1;
  grid-row: 1;
}

html.popup-options .product-options-popup-image {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: contain;
  border: 1px solid var(--options-popup-line);
  border-radius: 12px;
  background: #fff;
}

html.popup-options .product-options-popup-title {
  display: -webkit-box;
  max-height: 3.1em;
  margin: 0;
  overflow: hidden;
  color: var(--options-popup-ink);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.55;
  text-align: start;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

html.popup-options .product-stats {
  margin: 0 0 12px !important;
}

html.popup-options .product-stats ul {
  display: flex;
  margin: 0;
  padding: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

html.popup-options .product-stats li:not(.product-stock),
html.popup-options .product-stats .brand-image,
html.popup-options .product-stats .custom-stats {
  display: none !important;
}

html.popup-options .product-stats .product-stock {
  display: inline-flex;
  min-height: 28px;
  margin: 0;
  padding: 4px 10px;
  align-items: center;
  border: 1px solid #d5e7dc;
  border-radius: 999px;
  background: #f1f8f4;
  color: #256a45;
  font-size: 12px;
  font-weight: 700;
}

html.popup-options .product-price-group {
  display: flex !important;
  min-height: 36px;
  margin: 0 0 22px !important;
  padding: 0 !important;
  align-items: center;
  justify-content: flex-start;
}

html.popup-options .product-price-group .price-wrapper,
html.popup-options .product-price-group .price-group {
  display: flex;
  width: auto !important;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 10px;
}

html.popup-options .product-price,
html.popup-options .product-price-new {
  color: var(--options-popup-ink) !important;
  font-size: 23px !important;
  font-weight: 800 !important;
  line-height: 1.3;
}

html.popup-options .product-price-old {
  color: #9299a5 !important;
  font-size: 15px !important;
}

html.popup-options .product-options {
  width: 100%;
  margin: 0 !important;
  padding: 20px 0 0 !important;
  border-top: 1px solid var(--options-popup-line);
}

html.popup-options .product-options > .options-title {
  display: block !important;
  margin: 0 0 20px !important;
  padding: 0 !important;
  color: var(--options-popup-ink) !important;
  font-size: 20px !important;
  font-weight: 800 !important;
  line-height: 1.45;
}

html.popup-options .product-options > .options-title + .form-group {
  margin-top: 0 !important;
}

html.popup-options .product-options > .form-group,
html.popup-options .product-options .product-upload-option {
  display: block !important;
  width: 100% !important;
  margin: 0 0 18px !important;
  padding: 0 !important;
}

html.popup-options .product-options .control-label {
  display: flex !important;
  width: 100% !important;
  min-height: 0;
  margin: 0 0 8px !important;
  padding: 0 !important;
  border: 0 !important;
  color: #454c59 !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1.5;
  text-align: start;
}

html.popup-options .product-options .form-control,
html.popup-options .product-options select.form-control,
html.popup-options .product-options textarea.form-control,
html.popup-options .product-options input.form-control {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 48px !important;
  box-sizing: border-box;
  margin: 0 !important;
  padding: 10px 13px !important;
  border: 1px solid #d7dce4 !important;
  border-radius: 10px !important;
  background-color: #fff !important;
  color: var(--options-popup-ink) !important;
  font-size: 15px !important;
  line-height: 1.5;
  box-shadow: none !important;
}

html.popup-options .product-options textarea.form-control {
  min-height: 92px !important;
  resize: vertical;
}

html.popup-options .product-options .form-control:hover {
  border-color: #b9c0cb !important;
}

html.popup-options .product-options .form-control:focus {
  border-color: var(--options-popup-focus) !important;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(37, 42, 50, .1) !important;
}

html.popup-options .product-options .form-group > div:not(.input-group):not(.product-upload-card) {
  width: 100%;
}

html.popup-options .product-options .product-option-radio > div,
html.popup-options .product-options .product-option-image > div,
html.popup-options .product-options .product-option-checkbox > div {
  display: flex !important;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 9px;
}

html.popup-options .product-options .radio,
html.popup-options .product-options .checkbox {
  display: inline-flex !important;
  margin: 0 !important;
  padding: 0 !important;
}

html.popup-options .product-options .radio label,
html.popup-options .product-options .checkbox label {
  display: inline-flex;
  min-height: 44px;
  margin: 0;
  padding: 0;
  align-items: center;
  cursor: pointer;
}

html.popup-options .product-options .option-value {
  display: inline-flex;
  min-height: 44px;
  box-sizing: border-box;
  padding: 8px 13px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid #d7dce4;
  border-radius: 10px;
  background: #fff;
  color: #343a45;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  transition:
    border-color .16s ease,
    background-color .16s ease,
    box-shadow .16s ease;
}

html.popup-options .product-options .radio:hover .option-value,
html.popup-options .product-options .checkbox:hover .option-value {
  border-color: #aeb6c2;
  background: var(--options-popup-soft);
}

html.popup-options .product-options input:checked + .option-value,
html.popup-options .product-options input:checked + img + .option-value {
  border-color: var(--options-popup-focus);
  background: #f1f3f6;
  color: #111318;
  box-shadow: inset 0 0 0 1px var(--options-popup-focus);
}

html.popup-options .product-options input:focus-visible + .option-value,
html.popup-options .product-options input:focus-visible + img + .option-value {
  outline: 3px solid rgba(37, 42, 50, .13);
  outline-offset: 2px;
}

html.popup-options .product-options .radio label > img,
html.popup-options .product-options .checkbox label > img {
  width: 44px;
  height: 44px;
  margin-inline-end: 7px;
  object-fit: contain;
  border: 1px solid var(--options-popup-line);
  border-radius: 9px;
  background: #fff;
}

html.popup-options .product-options .text-danger,
html.popup-options #alert-stock .alert {
  margin-top: 7px;
  color: #b42334;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

html.popup-options .product-info .button-group-page {
  position: sticky !important;
  right: auto !important;
  bottom: 0 !important;
  left: auto !important;
  z-index: 99;
  width: calc(100% + 60px) !important;
  box-sizing: border-box;
  margin: 24px -30px 0 !important;
  padding: 14px 30px !important;
  border-top: 1px solid var(--options-popup-line);
  background: rgba(255, 255, 255, .97) !important;
  box-shadow: 0 -8px 24px rgba(20, 27, 38, .07) !important;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

html.popup-options .product-info .button-group-page .buttons-wrapper,
html.popup-options .product-info .button-group-page .stepper-group {
  width: 100% !important;
  margin: 0 !important;
}

html.popup-options .product-info .button-group-page .stepper-group {
  display: flex !important;
  align-items: flex-end;
  flex-wrap: nowrap;
  gap: 12px;
}

html.popup-options .product-info .button-group-page .stepper {
  display: grid !important;
  grid-template-columns: minmax(54px, 1fr) 38px;
  grid-template-rows: auto 48px;
  width: 104px !important;
  height: auto !important;
  max-height: none !important;
  flex: 0 0 104px;
  overflow: visible;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}

html.popup-options .product-info .button-group-page .stepper > .control-label {
  grid-column: 1 / -1;
  grid-row: 1;
  width: 100%;
  margin: 0 0 6px !important;
  color: #555e6c;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  text-align: start;
}

html.popup-options .product-info .button-group-page .stepper > input.form-control {
  grid-column: 1;
  grid-row: 2;
  width: 100% !important;
  min-width: 0 !important;
  height: 48px !important;
  padding: 0 8px !important;
  border: 1px solid #d7dce4 !important;
  border-inline-end: 0 !important;
  border-radius: 10px 0 0 10px !important;
  background: #fff !important;
  color: var(--options-popup-ink) !important;
  font-size: 16px !important;
  font-weight: 800 !important;
  text-align: center !important;
  box-shadow: none !important;
}

html[dir="rtl"].popup-options .product-info .button-group-page .stepper > input.form-control {
  border-radius: 0 10px 10px 0 !important;
}

html.popup-options .product-info .button-group-page .stepper > span {
  display: grid !important;
  grid-column: 2;
  grid-row: 2;
  grid-template-rows: 1fr 1fr;
  width: 38px !important;
  height: 48px !important;
  overflow: hidden;
  border: 1px solid #d7dce4 !important;
  border-radius: 0 10px 10px 0 !important;
  background: var(--options-popup-soft);
}

html[dir="rtl"].popup-options .product-info .button-group-page .stepper > span {
  border-radius: 10px 0 0 10px !important;
}

html.popup-options .product-info .button-group-page .stepper > span i {
  display: grid !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  place-items: center;
  background: transparent !important;
  color: #5e6775 !important;
  font-size: 12px !important;
  cursor: pointer;
}

html.popup-options .product-info .button-group-page .stepper > span i + i {
  border-top: 1px solid #d7dce4;
}

html.popup-options .product-info .button-group-page .stepper > span i:hover {
  background: #e9ecf1 !important;
  color: #111 !important;
}

html.popup-options .product-info .button-group-page #button-cart,
html.popup-options .product-info .button-group-page #btn-notify-trigger {
  display: inline-flex !important;
  min-width: 0;
  height: 52px !important;
  max-height: none !important;
  flex: 1 1 auto;
  padding: 0 22px !important;
  align-items: center;
  justify-content: center;
  border-radius: 12px !important;
  color: #fff !important;
  font-size: 16px !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  box-shadow: 0 7px 16px rgba(18, 24, 33, .14) !important;
  cursor: pointer;
  transition:
    filter .16s ease,
    transform .16s ease,
    box-shadow .16s ease;
}

html.popup-options .product-info .button-group-page #button-cart .btn-text,
html.popup-options .product-info .button-group-page #button-cart::before {
  color: #fff !important;
}

html.popup-options .product-info .button-group-page #button-cart:hover,
html.popup-options .product-info .button-group-page #button-cart:focus,
html.popup-options .product-info .button-group-page #btn-notify-trigger:hover,
html.popup-options .product-info .button-group-page #btn-notify-trigger:focus {
  filter: brightness(.93);
  transform: translateY(-1px);
  box-shadow: 0 9px 20px rgba(18, 24, 33, .18) !important;
}

html.popup-options .product-info .button-group-page #button-cart:active,
html.popup-options .product-info .button-group-page #btn-notify-trigger:active {
  transform: translateY(0);
}

@media (max-width: 640px) {
  .popup-wrapper.popup-options {
    padding: 0;
    align-items: flex-end;
  }

  .popup-wrapper.popup-options .popup-container {
    width: 100vw !important;
    max-width: none !important;
    max-height: 92dvh;
    border-width: 1px 0 0;
    border-radius: 20px 20px 0 0 !important;
  }

  .popup-wrapper.popup-options .popup-body,
  .popup-wrapper.popup-options .popup-inner-body,
  .popup-wrapper.popup-options iframe {
    max-height: 92dvh;
  }

  .popup-wrapper.popup-options .popup-close {
    top: 12px;
  }

  html[dir="rtl"] .popup-wrapper.popup-options .popup-close {
    left: 12px;
  }

  html[dir="ltr"] .popup-wrapper.popup-options .popup-close {
    right: 12px;
  }

  html.popup-options .product-info {
    padding: 22px 18px 0 !important;
  }

  html.popup-options .product-options-popup-summary {
    grid-template-columns: 60px minmax(0, 1fr);
    min-height: 60px;
    padding-inline-end: 48px;
    gap: 11px;
  }

  html[dir="rtl"].popup-options .product-options-popup-summary {
    grid-template-columns: minmax(0, 1fr) 60px;
  }

  html.popup-options .product-options-popup-image {
    width: 60px;
    height: 60px;
    border-radius: 10px;
  }

  html.popup-options .product-options-popup-title {
    font-size: 16px;
  }

  html.popup-options .product-price,
  html.popup-options .product-price-new {
    font-size: 21px !important;
  }

  html.popup-options .product-options {
    padding-top: 17px !important;
  }

  html.popup-options .product-options > .options-title {
    margin-bottom: 17px !important;
    font-size: 18px !important;
  }

  html.popup-options .product-info .button-group-page {
    width: calc(100% + 36px) !important;
    margin: 20px -18px 0 !important;
    padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px)) !important;
  }

  html.popup-options .product-info .button-group-page .stepper-group {
    gap: 10px;
  }

  html.popup-options .product-info .button-group-page .stepper {
    width: 96px !important;
    flex-basis: 96px;
    grid-template-columns: minmax(50px, 1fr) 36px;
  }

  html.popup-options .product-info .button-group-page #button-cart,
  html.popup-options .product-info .button-group-page #btn-notify-trigger {
    height: 50px !important;
    padding-inline: 14px !important;
    font-size: 15px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .popup-wrapper.popup-options .popup-container,
  html.popup-options .product-options .option-value,
  html.popup-options .product-info .button-group-page #button-cart,
  html.popup-options .product-info .button-group-page #btn-notify-trigger {
    transition: none !important;
  }
}
