/* SolidCos Cape POD — Configurator */

/* Force full-width layout — hide sidebar, expand content */
.scp-standalone-page .site-content .col-full,
.scp-standalone-page .site-main,
.scp-standalone-page .content-area {
    float: none !important;
    flex: 1 1 100% !important;
}

.scp-standalone-page #secondary,
.scp-standalone-page .widget-area,
.scp-standalone-page aside.sidebar {
    display: none !important;
}

/* ── Main Layout ── */
#scp-configurator {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px;
}

.scp-product-title {
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 8px;
    color: #000000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.3;
}

.scp-layout {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 40px;
    align-items: start;
}

/* Mobile-only title (shown above the layout); hidden on desktop. */
.scp-product-title-mobile { display: none; }

/* ── Left: Preview ── */
.scp-preview-panel {
    position: sticky;
    top: 24px;
}

.scp-mockup-wrapper {
    position: relative;
    background: #f8f8f8;
    border-radius: 8px;
    overflow: hidden;
}

.scp-mockup-wrapper .scp-mockup-image {
    width: 100%;
    display: block;
}

/* Circular logo placement zone */
.scp-logo-zone {
    position: absolute;
    transform: translate(-50%, -50%);
    aspect-ratio: 1;
    border-radius: 50%;
    border: 2px dashed rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    pointer-events: auto;
    cursor: grab;
}

.scp-logo-zone-text {
    font-size: 16px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    letter-spacing: 2px;
}

/* Hide the "LOGO" text when an actual logo is shown */
.scp-logo-zone.has-logo .scp-logo-zone-text {
    display: none;
}

.scp-logo-zone .scp-logo-overlay {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: auto;
    cursor: grab;
}

.scp-logo-zone .scp-logo-overlay:active {
    cursor: grabbing;
}

.scp-preview-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.scp-preview-controls.scp-controls-disabled {
    display: none;
}

.scp-mockup-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.scp-mockup-thumbs .scp-mockup-thumb {
    padding: 0;
    border: 2px solid transparent;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    overflow: hidden;
    line-height: 0;
}

.scp-mockup-thumbs .scp-mockup-thumb img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    display: block;
}

.scp-mockup-thumbs .scp-mockup-thumb.is-active {
    border-color: #111;
}

.scp-mockup-thumbs.scp-disabled {
    display: none;
}

.scp-zoom-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.scp-zoom-control label {
    font-size: 13px;
    color: #555;
    white-space: nowrap;
}

.scp-zoom-control input[type="range"] {
    width: 120px;
    cursor: pointer;
}

.scp-mirror-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
}

/* Icon-only labels (tooltip exposes the wording) */
.scp-icon-label {
    font-size: 16px;
    line-height: 1;
    color: #555;
}
.scp-mirror-toggle.scp-icon-label > span { font-size: 18px; }

/* ── Right: Options ── */
.scp-options-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.scp-option-group h4 {
    margin: 10px 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.scp-option-group h4 .scp-group-fee {
    margin-left: 6px;
    font-size: 11px;
    font-weight: 500;
    color: #888;
    text-transform: none;
    letter-spacing: 0;
}

/* Color Swatches */
.scp-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.scp-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #ddd;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.15s;
    position: relative;
}

.scp-swatch:hover {
    transform: scale(1.15);
}

.scp-swatch.selected {
    border-color: #34495e;
    box-shadow: 0 0 0 2px rgba(52, 73, 94, 0.3);
}

.scp-swatch.selected::after {
    content: '\2713';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Image-based color swatches */
.scp-swatch-img {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    overflow: hidden;
    padding: 2px;
}

.scp-swatch-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.scp-swatch-img.selected::after {
    border-radius: 4px;
}

.scp-color-name {
    font-size: 12px;
    color: #666;
    margin-top: 6px;
}

/* Option Buttons (closure, method) */
.scp-option-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.scp-option-btn {
    padding: 8px 18px;
    border: 2px solid #ddd;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.scp-option-btn:hover {
    border-color: #34495e;
}

.scp-option-btn.selected {
    border-color: #34495e;
    background: #34495e;
    color: #fff;
}

/* ── Logo Upload Section ── */
.scp-logo-section {
    border-top: 1px solid #eee;
}

.scp-upload-zone {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.scp-upload-zone:hover,
.scp-upload-zone.drag-over {
    border-color: #34495e;
    background: #f8f9fa;
}

.scp-upload-zone p {
    color: #888;
    margin: 0;
    font-size: 13px;
}

.scp-upload-progress {
    margin-top: 12px;
}

.scp-progress-bar {
    width: 100%;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
}

.scp-progress-fill {
    height: 100%;
    background: #34495e;
    width: 0;
    transition: width 0.2s;
}

/* Existing Logos */
.scp-existing-logos h4 {
    font-size: 12px;
    color: #888;
    margin: 12px 0 8px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}

.scp-logo-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.scp-user-logo {
    width: 64px;
    height: 64px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    padding: 4px;
    cursor: pointer;
    transition: border-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.scp-user-logo:hover {
    border-color: #34495e;
}

.scp-user-logo.selected {
    border-color: #34495e;
    box-shadow: 0 0 0 2px rgba(52, 73, 94, 0.2);
}

.scp-user-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.scp-logo-name {
    display: none; /* hide name in compact grid */
}

.scp-file-icon {
    font-size: 10px;
    color: #999;
}

.scp-logo-delete {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    background: #e74c3c;
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    line-height: 18px;
    text-align: center;
    cursor: pointer;
    display: none;
    z-index: 1;
}

.scp-user-logo:hover .scp-logo-delete {
    display: block;
}

.scp-setup-badge {
    position: absolute;
    top: 2px;
    left: 2px;
    font-size: 10px;
}

.scp-setup-badge.paid {
    color: #27ae60;
}

/* ── Price & Cart Section ── */
.scp-cart-section {
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.scp-summary {
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

.scp-summary-title {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.scp-price-breakdown {
    font-size: 15px;
    color: #555;
    line-height: 1.55;
}

.scp-bd-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 12px;
    align-items: baseline;
    padding: 2px 0;
}

.scp-bd-label {
    color: #333;
}

.scp-bd-calc {
    color: #888;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.scp-bd-total {
    color: #333;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.scp-summary-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
}

.scp-summary-total-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.scp-price-display {
    font-size: 22px;
    font-weight: 700;
    color: #34495e;
    font-variant-numeric: tabular-nums;
}

.scp-price-display .scp-total-original {
    font-size: 16px;
    font-weight: 500;
    color: #999;
    margin-right: 6px;
    text-decoration: line-through;
}

.scp-price-display .scp-total-discounted {
    color: #c0392b;
    text-decoration: none;
}

.scp-quantity-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.scp-quantity-row label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.scp-quantity-row input {
    width: 80px;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
}

.scp-btn-add-to-cart {
    width: 100%;
    padding: 14px 24px;
    background: #34495e;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.scp-btn-add-to-cart:hover {
    background: #2c3e50;
}

.scp-btn-add-to-cart:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.scp-cart-success {
    text-align: center;
    padding: 16px;
    background: #e8f5e9;
    border-radius: 8px;
    margin-top: 12px;
}

/* ── Past Orders tab ── */
.scp-past-orders {
    padding: 8px 0 16px;
}

.scp-past-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-top: 12px;
}

.scp-past-card {
    display: flex;
    gap: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    background: #fff;
}

.scp-past-thumb {
    flex: 0 0 88px;
    width: 88px;
    height: 88px;
    background: #f8f8f8;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scp-past-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.scp-past-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.scp-past-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 13px;
    margin-bottom: 6px;
}

.scp-past-date {
    color: #888;
    font-size: 12px;
}

.scp-past-line {
    font-size: 12px;
    color: #555;
    margin-bottom: 2px;
    word-break: break-word;
}

.scp-past-reorder {
    align-self: flex-start;
    margin-top: auto !important;
    padding: 6px 14px !important;
    font-size: 13px !important;
}

.scp-cart-success p {
    font-size: 16px;
    color: #27ae60;
    margin-bottom: 8px;
}

.scp-cart-success a {
    color: #34495e;
    font-weight: 600;
}

.scp-setup-note {
    font-size: 11px;
    color: #27ae60;
    margin-top: 4px;
}

/* Login required */
.scp-login-required {
    text-align: center;
    padding: 60px 20px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .scp-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .scp-preview-panel {
        position: static;
    }
    .scp-product-title-mobile { display: block; margin: 0 0 16px; }
    .scp-product-title-desktop { display: none; }
    /* Keep zoom slider + mirror toggle on one line; let the slider shrink. */
    .scp-preview-controls {
        flex-wrap: nowrap;
        gap: 12px;
    }
    .scp-zoom-control {
        flex: 1 1 auto;
        min-width: 0;
    }
    .scp-zoom-control input[type="range"] {
        width: 100%;
        min-width: 0;
    }
    .scp-mirror-toggle {
        flex: 0 0 auto;
    }
}

/* Image editor — Cropper.js modal */
.scp-logo-actions { margin: 8px 0 12px; }
.scp-btn-edit-logo {
    appearance: none; cursor: pointer;
    padding: 8px 14px; border-radius: 6px;
    border: 1px solid #d0d0d4; background: #fff; color: #1a1a1a;
    font: inherit; font-weight: 600;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.scp-btn-edit-logo:hover:not(:disabled) { background: #f3f5f9; border-color: #b6b6bc; }
.scp-btn-edit-logo:disabled { opacity: .5; cursor: not-allowed; }

.scp-image-editor {
    position: fixed; inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,.78);
    display: none;
    align-items: center; justify-content: center;
    padding: 20px;
}
.scp-image-editor.is-open { display: flex; }
.scp-image-editor-panel {
    background: #fff;
    border-radius: 10px;
    width: min(900px, 100%);
    max-height: calc(100vh - 40px);
    display: flex; flex-direction: column;
    overflow: hidden;
}
.scp-image-editor-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; padding: 10px 14px;
    background: #f7f8fa;
    border-bottom: 1px solid #e6e6ea;
    flex-wrap: wrap;
}
.scp-image-editor-tools, .scp-image-editor-actions {
    display: flex; gap: 6px; flex-wrap: wrap;
}
.scp-img-btn {
    appearance: none; cursor: pointer;
    padding: 6px 12px; border-radius: 6px;
    border: 1px solid #d0d0d4; background: #fff; color: #1a1a1a;
    font: inherit; font-size: 14px;
    transition: background .15s ease, border-color .15s ease;
}
.scp-img-btn:hover { background: #f0f3f8; border-color: #b6b6bc; }
.scp-img-btn.is-active { background: #2c5fb3; color: #fff; border-color: #2c5fb3; }
.scp-img-btn-primary { background: #2c5fb3; color: #fff; border-color: #2c5fb3; }
.scp-img-btn-primary:hover { background: #244e94; border-color: #244e94; color: #fff; }
.scp-img-btn-secondary { background: #fff; }
/* Visual preview of color invert; the saved canvas is inverted in JS. */
.scp-image-editor.is-inverted .cropper-canvas img,
.scp-image-editor.is-inverted .cropper-view-box img { filter: invert(1); }
.scp-image-editor-stage {
    flex: 1;
    min-height: 320px;
    background: #1a1a1a;
    overflow: hidden;
    display: flex; align-items: stretch; justify-content: stretch;
}
.scp-image-editor-stage img {
    /* Cropper replaces the visible img with its own UI on init; this only
       affects the brief moment before getCroppedCanvas runs. */
    max-width: 100%;
    max-height: 70vh;
}
