/* ═══════════════════════════════════════════════════
   AI Virtual Try-On Styles
   ═══════════════════════════════════════════════════ */

/* ── Modal ─────────────────────────────────────────── */
.tryon-modal {
  border: none;
  border-radius: 12px;
  overflow: hidden;
}

.tryon-header {
  background: #49943c;
  color: #fff;
  border-bottom: none;
  padding: 12px 20px;
}

/* Explicit override - bez tohoto h5.modal-title dedi global blue/navy z site theme */
.tryon-header .modal-title,
.tryon-header h5,
.tryon-header h5.modal-title {
  color: #fff !important;
}

.tryon-header .close {
  color: #fff;
  opacity: 0.8;
  text-shadow: none;
}

.tryon-header .close:hover {
  opacity: 1;
}

/* Bootstrap 5 btn-close: nativni cerny X invertovat na bily */
.tryon-header .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
  opacity: 0.85;
}
.tryon-header .btn-close:hover { opacity: 1; }

.tryon-icon {
  width: 20px;
  height: 20px;
  margin-right: 6px;
  vertical-align: text-bottom;
}

.tryon-body {
  padding: 20px;
  background: #fafbfc;
}

.tryon-footer {
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
}

.tryon-powered {
  font-size: 11px;
  color: #adb5bd;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ── Step indicator ────────────────────────────────── */
.tryon-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  gap: 0;
}

.tryon-step {
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0.4;
  transition: opacity 0.3s;
}

.tryon-step.active,
.tryon-step.done {
  opacity: 1;
}

.tryon-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #dee2e6;
  color: #495057;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.3s;
}

.tryon-step.active .tryon-step-num {
  background: #2d6a4f;
  color: #fff;
}

.tryon-step.done .tryon-step-num {
  background: #40916c;
  color: #fff;
}

.tryon-step-label {
  font-size: 13px;
  font-weight: 500;
  color: #6c757d;
}

.tryon-step.active .tryon-step-label {
  color: #2d6a4f;
  font-weight: 600;
}

.tryon-step-line {
  width: 40px;
  height: 2px;
  background: #dee2e6;
  margin: 0 8px;
}

/* ── Dropzone ──────────────────────────────────────── */
.tryon-dropzone {
  border: 2px dashed #ced4da;
  border-radius: 12px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #fff;
}

.tryon-dropzone:hover,
.tryon-dropzone--active {
  border-color: #2d6a4f;
  background: #f0faf4;
}

.tryon-upload-icon {
  width: 48px;
  height: 48px;
  color: #adb5bd;
  margin-bottom: 12px;
}

.tryon-dropzone:hover .tryon-upload-icon {
  color: #2d6a4f;
}

.tryon-dropzone-title {
  font-size: 16px;
  font-weight: 600;
  color: #343a40;
  margin-bottom: 4px;
}

.tryon-dropzone-subtitle {
  font-size: 14px;
  color: #6c757d;
  margin-bottom: 4px;
}

.tryon-dropzone-hint {
  font-size: 12px;
  color: #adb5bd;
  margin-bottom: 0;
}

/* ── Photo previews ────────────────────────────────── */
.tryon-preview-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tryon-preview-item {
  position: relative;
  width: 100px;
  height: 100px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #dee2e6;
}

.tryon-preview-item:first-child {
  border-color: #2d6a4f;
  width: 120px;
  height: 120px;
}

.tryon-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tryon-preview-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 10px;
  text-align: center;
  padding: 2px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Tips ──────────────────────────────────────────── */
.tryon-tips {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
}

.tryon-tips ul {
  padding-left: 18px;
  font-size: 12px;
  color: #6c757d;
}

/* ── Product preview (right side) ──────────────────── */
.tryon-product-preview {
  text-align: center;
  padding: 16px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.tryon-product-img-wrap {
  width: 140px;
  height: 140px;
  margin: 0 auto 10px;
}

.tryon-product-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.tryon-product-name {
  font-weight: 600;
  font-size: 14px;
  color: #343a40;
}

.tryon-product-brand {
  font-size: 12px;
  color: #6c757d;
}

/* ── Body info form ────────────────────────────────── */
.tryon-body-info {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 10px 14px;
}

/* ── Loading / generating ──────────────────────────── */
.tryon-generating {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.tryon-loader {
  position: relative;
  width: 80px;
  height: 80px;
}

.tryon-loader-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid transparent;
  animation: tryon-spin 1.5s linear infinite;
}

.tryon-loader-ring:nth-child(1) {
  border-top-color: #2d6a4f;
  animation-duration: 1.5s;
}

.tryon-loader-ring:nth-child(2) {
  inset: 8px;
  border-right-color: #40916c;
  animation-duration: 2s;
  animation-direction: reverse;
}

.tryon-loader-ring:nth-child(3) {
  inset: 16px;
  border-bottom-color: #52b788;
  animation-duration: 2.5s;
}

.tryon-loader-golf {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  color: #2d6a4f;
  animation: tryon-pulse 1s ease-in-out infinite;
}

@keyframes tryon-spin {
  to { transform: rotate(360deg); }
}

@keyframes tryon-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.3); }
}

.tryon-progress {
  width: 100%;
  max-width: 300px;
  height: 4px;
  background: #e9ecef;
  border-radius: 2px;
  overflow: hidden;
}

.tryon-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #2d6a4f, #52b788);
  border-radius: 2px;
  transition: width 0.2s ease-out;
  width: 0%;
}

/* ── Result ────────────────────────────────────────── */
.tryon-result-image-wrap {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.tryon-result-image {
  width: 100%;
  display: block;
}

.tryon-result-info {
  padding: 16px 0;
}

.tryon-result-product {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 8px;
}

.tryon-result-product-thumb {
  width: 50px;
  height: 50px;
  object-fit: contain;
  border-radius: 4px;
}

/* ── Try-on button on product detail ───────────────── */
.tryon-detail-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: #49943c;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  justify-content: center;
}

.tryon-detail-btn:hover {
  background: #419a68;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(73, 148, 60, 0.3);
}

.tryon-detail-btn:active {
  transform: translateY(0);
}

.tryon-detail-btn svg {
  width: 18px;
  height: 18px;
}

.tryon-beta-badge {
  background: rgba(255, 255, 255, 0.2);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
}

/* ── Mobile ────────────────────────────────────────── */
@media (max-width: 767px) {
  .tryon-modal .modal-body {
    padding: 12px;
  }

  .tryon-steps {
    margin-bottom: 16px;
  }

  .tryon-step-label {
    display: none;
  }

  .tryon-dropzone {
    padding: 24px 16px;
  }

  .tryon-product-preview {
    margin-top: 16px;
  }

  .tryon-result-info {
    padding: 12px 0;
  }
}

/* Spinner centering uvnitr buttonu — bez tohoto sedi spinner-border na text
   baseline a vypada vychyleny vuci textu vedle nej (viditelne v "Nahravam..."
   pri tryon uploadu i v "Zpracovavam..." pri checkout-confirm).
   Aplikujeme jen na buttony, ktere obsahuji spinner (typicky loading state). */
.btn:has(> .spinner-border),
.btn:has(> .spinner-grow) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
}
.btn:has(> .spinner-border) .me-1,
.btn:has(> .spinner-grow) .me-1 {
  /* gap uz to resi, me-1 by pridalo dalsi mezeru */
  margin-right: 0 !important;
}
