/* Product Wizard Styles Isolated */

.product-wizard {
    padding: var(--spacing-md) var(--spacing-sm) var(--spacing-xl);
}

.wizard-title {
    margin-bottom: var(--spacing-sm);
    color: var(--color-accent);
}

/* Progress Bar & Wizard Steps */
.wizard-steps {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    padding: 15px;
    border-radius: var(--radius-md);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    position: relative;
    overflow-x: auto;
}

.wizard-steps::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 20px;
    right: 20px;
    height: 2px;
    background: var(--color-border);
    z-index: 1;
    transform: translateY(-50%);
}

.wizard-steps .step {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-muted);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    z-index: 2;
}

.wizard-steps .step.completed {
    background: var(--color-card);
    color: var(--color-text);
    border-color: rgba(227,109,93,0.4);   
}

.wizard-steps .step.active {
    background: var(--color-accent);
    color: #000;
    border-color: var(--color-accent);
    box-shadow: 0 0 10px rgba(227,109,93,0.35);
}

.wizard-steps .step:hover:not(.active) {
    background: var(--color-border);
    color: var(--color-text);
}

.wizard-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
    margin-bottom: 50px;
}

@media (max-width: 899px) {
    .wizard-image-panel {
        order: 2;
    }
}

.wizard-type-image {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    border-radius: 12px;
    display: block;
}

@media (min-width: 900px) {
    .wizard-layout {
        grid-template-columns: 1fr 380px;
        align-items: start;
    }
    .wizard-image-panel {
        display: block;
        order: 1;
        position: sticky;
        top: 90px;
    }
    .wizard-type-image {
        max-height: 480px;
        object-fit: cover;
        box-shadow: 0 8px 32px rgba(0,0,0,0.13);
    }
}


.wizard-step {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.wizard-step.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.step-title {
    font-size: 1.8rem;
    margin-bottom: var(--spacing-md);
    color: var(--color-text);
    position: relative;
    padding-bottom: 15px;
}

.step-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 1px;
    background: var(--color-accent);
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.option-card {
  background: var(--color-card);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.option-card:hover {
  border-color: var(--color-accent);
  transform: translateY(-2px);
}
.option-card.selected {
  border-color: var(--color-accent);
  background: rgba(227,109,93,0.08);
  box-shadow: 0 0 0 2px rgba(227,109,93,.2);
}
.option-card-icon {
  font-size: 32px;
  margin-bottom: 12px;
}
.option-card-label {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--color-text);
  font-weight: 500;
}

.upload-area {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-md);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    background: var(--color-surface);
    transition: all var(--transition-fast);
}

.upload-area:hover, .upload-area.drag-over {
    border-color: var(--color-accent);
    background: rgba(201,168,76,0.02);
}

.upload-icon {
    font-size: 3rem;
}

/* Early Upload Zone */
.early-upload-section {
    margin-bottom: 30px;
}

.early-upload-label {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: var(--spacing-sm);
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--color-accent);
}

.early-upload-zone > div {
    cursor: pointer;
    background: var(--color-surface);
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    transition: border-color var(--transition-fast);
}

.early-upload-zone > div:hover {
    border-color: var(--color-accent);
}

.early-upload-zone .upload-hint {
    display: block;
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--color-muted);
}

#earlyUploadStatus {
    text-align: center;
    margin-top: var(--spacing-sm);
    font-weight: 500;
}

/* Preview Column */
.preview-sticky {
    position: sticky;
    top: 100px;
}

.canvas-wrapper {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 15px;
    margin-bottom: var(--spacing-md);
    overflow: hidden; /* Added to prevent horizontal overflow */
    box-shadow: inset 0 0 10px rgba(0,0,0,0.06);
}

.wall-bg {
    width: 100%;
    aspect-ratio: 4/3;
    background-size: cover;
    background-position: center;
    border-radius: var(--radius-sm);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.5);
    transition: background-image var(--transition-fast);
}

.mat-frame-wrapper {
    position: relative;
    box-shadow: 0 5px 20px rgba(0,0,0,0.4); /* Reduced for small multi-matrices */
    /* Dimensions will be dynamic via JS */
    min-width: 30px;
    min-height: 30px;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    padding: 5%; /* simulate matboard */
    transition: all var(--transition-slow);
}

.mat-frame-wrapper img.userArtPreview {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.wall-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

.wall-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--color-border);
    cursor: pointer;
    transition: border-color var(--transition-fast);
}

.wall-btn:hover {
    border-color: var(--color-accent);
}

.price-box {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 20px;
}

.price-box h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 10px;
}

/* Mobile Responsiveness for Task 8.3 */
@media (max-width: 480px) {
    .wizard-title {
        font-size: 1.5rem;
    }
    .step-title {
        font-size: 1.3rem;
    }
    
    .progress-labels {
        font-size: 0.65rem;
        flex-wrap: wrap; /* Ensure no overflow */
    }
    .progress-labels .step-label {
        display: none;
    }
    .progress-labels .step-label.active {
        display: block;
        width: 100%;
        text-align: center;
    }
    
    .options-grid {
        grid-template-columns: 1fr 1fr; /* Force 2 columns on mobile if possible, or 1 */
        gap: 10px;
    }
    @media (max-width: 380px) {
        .options-grid {
            grid-template-columns: 1fr; /* 1 column on extremely small screens like 375px */
        }
    }
    
    .option-card {
        padding: 15px 10px;
    }
    
    /* Wizard Nav adjustments */
    .wizard-nav {
        flex-direction: column;
        gap: 10px;
    }
    .wizard-nav .btn {
        width: 100%;
        margin: 0 !important; /* Override inline styles mapped previously */
    }
    
    /* 4 Wall Matrix Base Layer Context Scope Map Map Visual Array Node Execution Framework Structure Vector Limit Map */
    .canvas-wrapper {
        grid-template-columns: 1fr !important; /* Stack walls logically natively globally on mobile */
    }
}

.resolution-warning {
  background: #FFF3CD;
  border-left: 4px solid #D4A843;
  color: #856404;
  padding: 12px 16px;
  border-radius: 8px;
  margin-top: 12px;
  font-size: 14px;
  display: none;
}
.resolution-warning.show {
  display: block;
}

.wall-previews-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}
.wall-preview-card {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--color-border);
}
.wall-surface {
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 20px;
}
.photo-mount {
  position: relative;
  width: 120px;
  height: 150px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.preview-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.frame-overlay {
  position: absolute;
  top: -8px;
  left: -8px;
  width: calc(100% + 16px);
  height: calc(100% + 16px);
  object-fit: fill;
  pointer-events: none;
}
.wall-label {
  text-align: center;
  padding: 8px;
  font-size: 12px;
  color: var(--color-muted);
  background: var(--color-card);
  margin: 0;
}

.product-options-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: 24px;
}
.options-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.preview-column {
  position: sticky;
  top: 20px;
}
.option-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px;
}
.option-title {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 12px 0;
}
.price-box {
  background: var(--color-card);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 18px;
  color: var(--color-accent);
  font-family: var(--font-display);
}
.quantity-selector {
  display: flex;
  align-items: center;
  gap: 8px;
}
.quantity-selector button {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-card);
  color: var(--color-text);
  font-size: 18px;
  cursor: pointer;
}
.quantity-selector input {
  width: 60px;
  height: 36px;
  text-align: center;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 15px;
}
.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
@media (max-width: 768px) {
  .product-options-layout {
    grid-template-columns: 1fr;
  }
  .preview-column {
    position: static;
    order: -1;
  }
}

/* ============================================ */
/* Button Styles                                */
/* ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
  padding: 12px 24px;
  transition: background 0.2s ease, border-color 0.2s ease,
              color 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}

/* Primary - PROCEED, ADD TO CART, CONFIRM CROP */
.btn.btn-primary {
  background: linear-gradient(135deg,#E36D5D,#F0956C);
  color: #fff;
  border: none;
  box-shadow:0 6px 16px rgba(227,109,93,.25);
}
.btn.btn-primary:hover {
  background: var(--color-accent-2, var(--color-accent));
  box-shadow: 0 0 10px rgba(201, 168, 76, 0.4);
}

/* Secondary - BACK, SAVE TO WISHLIST, CHANGE PHOTO, CANCEL */
.btn.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn.btn-secondary:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* ============================================ */
/* Top Price Display                             */
/* ============================================ */
.top-price-box {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
  padding: 16px 24px;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 1px solid var(--color-accent);
  font-family: var(--font-display, inherit);
}
.top-price-box .price-label {
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-muted);
}
.top-price-box .price-amount {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-accent);
}

/* ============================================ */
/* Upload Step - Premium Styled                  */
/* ============================================ */

/* Upload Zone Card */
.upload-zone-card {
  margin-bottom: 20px;
}

.upload-zone-inner {
  cursor: pointer;
  background: var(--color-surface);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: 32px 20px;
  text-align: center;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.upload-zone-inner:hover {
  border-color: var(--color-accent);
  background: rgba(227,109,93,0.03);
}

.upload-zone-text {
  display: block;
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 6px;
}
.upload-zone-hint {
  display: block;
  font-size: 0.85rem;
  color: var(--color-muted);
}

/* Upload Success */
.upload-success-card {
  background: var(--color-surface);
  border: 1px solid rgba(76, 175, 80, 0.3);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  text-align: center;
}
.upload-success-text {
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-success, #4CAF50);
  margin: 0 0 12px 0;
}

/* Upload Progress Bar */
.upload-progress-wrap {
  margin: 18px 0 10px;
  text-align: center;
}
.upload-progress-label {
  font-size: 0.82rem;
  color: var(--color-muted, #888);
  margin-bottom: 8px;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.upload-progress-pct {
  font-weight: 700;
  color: var(--color-accent, #e94b3c);
}
.progress-bar-wrap {
  background: var(--color-border, #e0e0e0);
  border-radius: 8px;
  height: 10px;
  overflow: hidden;
}
.progress-bar {
  background: linear-gradient(90deg,
    var(--color-accent, #e94b3c) 0%,
    #f5a080 50%,
    var(--color-accent, #e94b3c) 100%);
  background-size: 200% 100%;
  height: 100%;
  width: 0%;
  border-radius: 8px;
  transition: width 0.35s ease;
  animation: uploadShimmer 1.6s linear infinite;
}
@keyframes uploadShimmer {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}
.btn--proceed-disabled {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

/* Cropper Card */
.cropper-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
}
.cropper-card img {
  max-width: 100%;
  display: block;
  border-radius: var(--radius-sm, 4px);
}
.crop-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 16px;
}

/* Wizard Nav */
.wizard-nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

/* ============================================ */
/* Review Step (Step 8)                          */
/* ============================================ */

.review-summary-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 20px;
}

.review-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.review-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--c-border, #EBE6DC);
}

.review-row:last-child {
  border-bottom: none;
}

.review-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.review-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
}

.review-row.review-price {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--color-accent);
  border-bottom: none;
}

.review-row.review-price .review-value {
  font-size: 1.2rem;
  color: var(--color-accent);
  font-family: var(--font-display, inherit);
}

.review-photo-preview {
  margin-top: 20px;
  text-align: center;
}

.review-thumb {
  max-width: 200px;
  max-height: 200px;
  border-radius: var(--radius-sm, 4px);
  border: 2px solid var(--color-border);
  object-fit: contain;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* ── Light-mode additions ── */
.step-heading { font-family:var(--font-display); font-size:1.6rem; font-weight:600; color:var(--c-text,#2D2A26); margin-bottom:1.2rem; }
.preview-title { font-family:var(--font-display); font-size:1.2rem; font-weight:600; color:var(--c-text,#2D2A26); margin-bottom:.8rem; }
.page-title { font-family:var(--font-display); font-size:clamp(1.8rem,3vw,2.8rem); font-weight:600; color:var(--c-text,#2D2A26); }
.main-content { padding:2.5rem 0 5rem; }
.btn-primary:hover { background:linear-gradient(135deg,#C85242,#E36D5D) !important; }

/* ============================================ */
/* Bulk Upload - Thumbnail Grid (Phase 1)        */
/* ============================================ */

.bulk-upload-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.bulk-thumbnails-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
}

.bulk-thumb-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 8px;
  position: relative;
}

.bulk-thumb-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--radius-sm, 4px);
  background: var(--color-border);
}

.bulk-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bulk-status-badge {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 4px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bulk-status-needs-review {
  background: rgba(211, 47, 47, 0.85);
  color: #fff;
}

.bulk-status-ready {
  background: rgba(56, 142, 60, 0.88);
  color: #fff;
}

.bulk-remove-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-accent, #E36D5D);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  padding: 0;
}

.bulk-remove-btn:hover {
  background: #c85242;
}

.bulk-thumb-label {
  font-size: 0.72rem;
  color: var(--color-muted);
  text-align: center;
  line-height: 1.2;
}

.bulk-crop-btn {
  width: 100%;
  padding: 5px 0;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm, 4px);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.bulk-crop-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* Make the thumbnail image-wrap show a pointer + dim on hover to signal it's clickable */
.bulk-thumb-img-wrap {
  cursor: pointer;
}
.bulk-thumb-img-wrap:hover .bulk-thumb-img {
  opacity: 0.82;
}

@media (max-width: 480px) {
  .bulk-thumbnails-grid {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 8px;
  }
}

/* ============================================ */
/* Review Step - Bulk Thumbnail Strip (Phase 3)  */
/* ============================================ */

.review-bulk-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  padding: 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  align-items: center;
}

.review-bulk-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: var(--radius-sm, 4px);
  border: 1px solid var(--color-border);
  flex-shrink: 0;
}

.review-bulk-more {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm, 4px);
  border: 1px dashed var(--color-border);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-muted);
  flex-shrink: 0;
}
