/* Custom Art Canvas Configurator v1 */

.apc-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.apc-form {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

/* ── LEFT ── */
.apc-left { flex: 0 0 460px; max-width: 460px; }

.apc-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.apc-change-photo-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #d32f2f;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 9px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.apc-change-photo-btn:hover { background: #b71c1c; }

/* Frame wrap */
.apc-frame-wrap {
    background: #e8e8e8;
    border-radius: 12px 12px 0 0;
    border: 1px solid #e8e8e8;
    border-bottom: none;
    padding: 32px 28px 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 380px;
}

.apc-frame {
    background: #fff;
    border: none;
    border-radius: 3px;
    box-shadow:
        0 4px 6px rgba(0,0,0,0.08),
        0 10px 20px rgba(0,0,0,0.15),
        0 20px 40px rgba(0,0,0,0.18),
        0 30px 60px rgba(0,0,0,0.10);
    position: relative;
    overflow: hidden;
    transition: width 0.3s, height 0.3s, border 0.25s, box-shadow 0.25s, padding 0.25s;
    cursor: pointer;
    box-sizing: border-box;
}

/* ── FRAME STYLE VARIANTS ── */
/* Stretched Canvas (no frame) — keep default floating look, no border */
.apc-frame.apc-frame-none {
    border: none !important;
    border-image: none !important;
    padding: 0 !important;
}

/* Black Frame */
.apc-frame.apc-frame-black {
    border: 14px solid #111111 !important;
    box-shadow:
        0 4px 6px rgba(0,0,0,0.12),
        0 10px 24px rgba(0,0,0,0.22),
        0 20px 44px rgba(0,0,0,0.22) !important;
}

/* Gold Frame */
.apc-frame.apc-frame-gold {
    border: 14px solid #c9a227 !important;
    border-image: linear-gradient(135deg, #f4d873, #c9a227 40%, #8a6d12 70%, #f4d873) 1 !important;
    box-shadow:
        0 4px 6px rgba(0,0,0,0.1),
        0 10px 24px rgba(0,0,0,0.2),
        0 20px 44px rgba(201,162,39,0.18) !important;
}

/* White Frame */
.apc-frame.apc-frame-white {
    border: 14px solid #ffffff !important;
    border-image: none !important;
    outline: 1px solid #e2e2e2;
    outline-offset: -1px;
    box-shadow:
        0 4px 6px rgba(0,0,0,0.08),
        0 10px 22px rgba(0,0,0,0.14),
        0 20px 40px rgba(0,0,0,0.14) !important;
}

/* Walnut Wood Frame */
.apc-frame.apc-frame-wood {
    border: 14px solid #6b4226 !important;
    border-image: linear-gradient(135deg, #8a5a36, #5c3a20 45%, #3e2614 75%, #7a4f30) 1 !important;
    box-shadow:
        0 4px 6px rgba(0,0,0,0.12),
        0 10px 24px rgba(0,0,0,0.2),
        0 20px 44px rgba(62,38,20,0.2) !important;
}

.apc-frame-inner {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

/* Placeholder */
.apc-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px;
    text-align: center;
    transition: opacity 0.2s, transform 0.2s;
    cursor: pointer;
    user-select: none;
    pointer-events: all;
    z-index: 5;
    position: relative;
    width: 100%;
    height: 100%;
    justify-content: center;
}
.apc-placeholder:hover { opacity: 0.7; transform: scale(0.97); }
.apc-placeholder p {
    font-size: 13px;
    color: #aaa;
    line-height: 1.5;
    margin: 0;
}

/* Canvas */
.apc-frame canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    cursor: grab;
    display: block;
}
.apc-frame canvas:active { cursor: grabbing; }

/* Text overlay */
.apc-text-overlay {
    position: absolute;
    left: 0; right: 0;
    padding: 8px 12px;
    text-align: center;
    pointer-events: none;
    z-index: 4;
    word-break: break-word;
    line-height: 1.3;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
    transition: all 0.2s;
}
.apc-text-overlay.pos-top    { top: 10px; bottom: auto; }
.apc-text-overlay.pos-bottom { bottom: 10px; top: auto; }
.apc-text-overlay.pos-center { top: 50%; transform: translateY(-50%); }

/* Zoom */
.apc-zoom-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 0;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-top: none;
    border-radius: 0 0 12px 12px;
    color: #aaa;
}
.apc-zoom-bar svg { flex-shrink: 0; }
.apc-zoom-bar input[type="range"] {
    flex: 1;
    height: 4px;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background: #e0e0e0;
    border-radius: 2px;
    outline: none;
}
.apc-zoom-bar input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #1a1a1a;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.apc-zoom-bar input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #1a1a1a;
    cursor: pointer;
    border: none;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
#apc-zoom-pct {
    font-size: 13px;
    color: #555;
    min-width: 38px;
    text-align: right;
    font-weight: 500;
}

.apc-status { font-size: 12px; color: #777; margin: 10px 0 0; min-height: 18px; text-align: center; }

/* ── RIGHT ── */
.apc-right { flex: 1; min-width: 0; }

.apc-product-title { font-size: 22px; font-weight: 700; color: #1a1a1a; margin: 0 0 10px; line-height: 1.3; }

.apc-price-row { margin-bottom: 16px; }
.apc-price { font-size: 28px; font-weight: 700; color: #1a1a1a; }

/* ── TABS ── */
.apc-tabs {
    display: flex;
    gap: 0;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
}
.apc-tab {
    flex: 1;
    padding: 10px;
    background: #fff;
    border: none;
    font-size: 13px;
    font-weight: 600;
    color: #777;
    cursor: pointer;
    transition: all 0.15s;
    border-right: 1.5px solid #e0e0e0;
}
.apc-tab:last-child { border-right: none; }
.apc-tab:hover { background: #f5f5f5; color: #1a1a1a; }
.apc-tab.active { background: #1a1a1a; color: #fff; }

/* ── SECTIONS ── */
.apc-section { margin-bottom: 20px; }
.apc-section-label { font-size: 13px; font-weight: 600; color: #1a1a1a; margin: 0 0 10px; }

/* Pills */
.apc-pill-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.apc-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 16px;
    border: 1.5px solid #e0e0e0;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #1a1a1a;
    cursor: pointer;
    background: #fff;
    transition: all 0.15s;
    user-select: none;
}
.apc-pill input { position: absolute; opacity: 0; width: 0; height: 0; }
.apc-pill:hover { border-color: #d32f2f; color: #d32f2f; }
.apc-pill.apc-active { background: #d32f2f; border-color: #d32f2f; color: #fff; font-weight: 600; }

/* ── TEXT TAB ── */
.apc-text-input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    color: #1a1a1a;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}
.apc-text-input:focus { border-color: #1a1a1a; }

/* Font grid */
.apc-font-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.apc-font-btn {
    padding: 10px 8px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    background: #fff;
    color: #1a1a1a;
    transition: all 0.15s;
    text-align: center;
}
.apc-font-btn:hover { border-color: #1a1a1a; }
.apc-font-btn.active { border-color: #d32f2f; background: #fff5f5; color: #d32f2f; }

/* Color grid — square swatches */
.apc-color-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.apc-color-btn {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    min-height: 30px !important;
    border-radius: 50% !important;
    border: 2px solid transparent !important;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
    outline: none !important;
    position: relative;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    flex-shrink: 0;
    padding: 0 !important;
    display: inline-block !important;
}
.apc-color-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.apc-color-btn.active {
    border-color: #1a1a1a !important;
    transform: scale(1.2);
    box-shadow: 0 4px 14px rgba(0,0,0,0.3);
}

/* end color grid */

/* Mount badge */
.apc-mount-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 18px;
}
.apc-mount-badge div { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.apc-mount-badge strong { font-size: 12px; font-weight: 700; color: #15803d; letter-spacing: 0.04em; text-transform: uppercase; }
.apc-mount-badge span { font-size: 12px; color: #555; }

/* Cart button */
.apc-cart-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px;
    background: #d32f2f;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    margin-bottom: 20px;
}
.apc-cart-btn:hover { background: #b71c1c; transform: scale(1.01); }

/* Trust */
.apc-trust { display: flex; border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden; }
.apc-trust-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 8px;
    font-size: 12px;
    color: #555;
    text-align: center;
    border-right: 1px solid #e5e7eb;
}
.apc-trust-item:last-child { border-right: none; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .apc-form { flex-direction: column; gap: 24px; }
    .apc-left { flex: none; max-width: 100%; width: 100%; }
    .apc-frame-wrap { min-height: 300px; }
    .apc-font-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Zoom bar disabled state */
#apc-zoom-row { opacity: 0.4; transition: opacity 0.3s; }
#apc-zoom-row.enabled { opacity: 1; }
#apc-zoom:disabled { cursor: not-allowed; }

/* Cart message */
.apc-cart-msg {
    display: none;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    margin-top: 10px;
    text-align: center;
}
.apc-cart-msg a { font-weight: 700; text-decoration: underline; }
.apc-cart-success { background: #f0fdf4; color: #15803d; border: 1px solid #86efac; }
.apc-cart-error   { background: #fef2f2; color: #dc2626; border: 1px solid #fca5a5; }
.apc-cart-btn:disabled { opacity: 0.7; cursor: not-allowed; transform: none !important; }

/* ── PROCESSING OVERLAY ── */
.apc-processing-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.apc-processing-box {
    background: #fff;
    border-radius: 16px;
    padding: 40px 48px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    max-width: 320px;
    width: 90%;
}

.apc-spinner {
    width: 52px;
    height: 52px;
    border: 4px solid #f0f0f0;
    border-top: 4px solid #d32f2f;
    border-radius: 50%;
    animation: apc-spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

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

.apc-processing-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px;
}

.apc-processing-sub {
    font-size: 13px;
    color: #888;
    margin: 0;
}
