/**
 * Product Photo Studio - Upload & Crop
 *
 * @author    Webmaster Annecy IA <contact@benoit-constant.fr>
 * @copyright Since 2026 Webmaster Annecy IA
 * @license   https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0 (AFL-3.0)
 */
.wa-photostudio {
  margin: 24px 0;
}

[data-wps-hidden-native-customization="1"] {
  display: none !important;
}

[data-wps-hidden-native-action="1"] {
  display: none !important;
}

.wa-photostudio__card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 2px solid #263445;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(38, 52, 69, 0.08);
}

.wa-photostudio__card-copy {
  display: grid;
  gap: 6px;
  color: #253142;
}

.wa-photostudio__card-copy strong {
  font-size: 18px;
  line-height: 1.25;
}

.wa-photostudio__card-copy span:last-child {
  color: #5b6470;
  line-height: 1.35;
}

.wa-photostudio__badge {
  display: inline-flex;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 4px;
  background: #fff0f1;
  color: #b50018;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.wa-photostudio__open {
  min-height: 54px;
  padding: 0 24px;
  border: 0;
  border-radius: 6px;
  background: #d7193f;
  color: #fff;
  font-weight: 700;
  line-height: 1.15;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(215, 25, 63, 0.22);
}

.wa-photostudio__open:hover,
.wa-photostudio__open:focus {
  background: #b90025;
  color: #fff;
}

.wa-photostudio-cart-image__img {
  object-fit: cover;
  border: 2px solid #d7193f;
  border-radius: 6px;
}

.wa-photostudio-cart-image__label {
  display: block;
  width: fit-content;
  margin-top: 6px;
  padding: 3px 7px;
  border-radius: 4px;
  background: #fff0f1;
  color: #b50018;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.wa-photostudio-cart-image__edit {
  display: block;
  width: fit-content;
  margin-top: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #263445;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: underline;
  cursor: pointer;
}

.wa-photostudio-cart-image__edit:hover,
.wa-photostudio-cart-image__edit:focus {
  color: #d7193f;
}

.wa-photostudio__modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(20, 20, 20, 0.58);
}

.wa-photostudio__modal[aria-hidden="false"] {
  display: flex;
}

.wa-photostudio-open {
  overflow: hidden;
}

.wa-photostudio__dialog {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(1120px, 100%);
  max-height: calc(100vh - 48px);
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
}

.wa-photostudio__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: #f2f2f2;
  color: #333;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.wa-photostudio__header,
.wa-photostudio__body,
.wa-photostudio__footer {
  padding: 24px 32px;
}

.wa-photostudio__header {
  border-bottom: 1px solid #e7e7e7;
}

.wa-photostudio__body {
  min-height: 0;
  overflow: auto;
}

.wa-photostudio__header h3 {
  margin: 0;
  padding-right: 56px;
  font-size: 28px;
  line-height: 1.2;
}

.wa-photostudio__hint {
  margin: 0 0 18px;
  color: #555;
}

.wa-photostudio__drop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 20px;
  border: 2px dashed #b8b8b8;
  border-radius: 8px;
  background: #fafafa;
  color: #333;
  cursor: pointer;
}

.wa-photostudio__drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.wa-photostudio__workspace {
  margin-top: 22px;
  display: grid;
  justify-items: start;
}

.wa-photostudio__canvas {
  display: block;
  width: min(100%, 900px);
  height: auto;
  max-height: min(58vh, 700px);
  aspect-ratio: 9 / 7;
  border: 1px solid #d8d8d8;
  border-radius: 8px;
  background: #f6f6f6;
  cursor: move;
}

.wa-photostudio__controls {
  width: min(420px, 100%);
  margin-top: 16px;
}

.wa-photostudio__controls label {
  display: grid;
  gap: 8px;
  margin: 0;
  font-weight: 600;
}

.wa-photostudio__zoom {
  width: 100%;
}

.wa-photostudio__warning,
.wa-photostudio__error {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 8px;
}

.wa-photostudio__warning {
  background: #fff4d8;
  color: #674900;
}

.wa-photostudio__error {
  background: #ffe5e8;
  color: #8f0012;
}

.wa-photostudio__footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  border-top: 1px solid #e7e7e7;
  background: #fff;
  box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.04);
}

.wa-photostudio__save--loading {
  opacity: 0.72;
  cursor: wait;
}

@media (max-width: 720px) {
  .wa-photostudio__modal {
    align-items: stretch;
    padding: 0;
  }

  .wa-photostudio__dialog {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .wa-photostudio__header,
  .wa-photostudio__body,
  .wa-photostudio__footer {
    padding: 20px;
  }

  .wa-photostudio__header h3 {
    font-size: 22px;
  }

  .wa-photostudio__footer {
    flex-direction: column-reverse;
  }

  .wa-photostudio__footer .btn {
    width: 100%;
  }

  .wa-photostudio__card {
    grid-template-columns: 1fr;
  }

  .wa-photostudio__open {
    width: 100%;
  }
}
