/* ═══════════════════════════════════════════════════
 *  WallPrint Visualizer – Frontend Styles v2.0
 * ═══════════════════════════════════════════════════ */

/* ── Layout ── */
.wallprint-app {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #333;
    background: #fff;
}

.wallprint-layout {
    display: flex;
    gap: 0;
    min-height: 420px;
}

.wallprint-canvas-area {
    flex: 1;
    min-width: 0;
    background: #f5f5f5;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 12px;
    position: relative;
}

/* ── Preview toggle on canvas ── */
.wallprint-canvas-preview-toggle {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 4px 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    z-index: 10;
    font-size: 12px;
}
.wallprint-canvas-preview-toggle .wallprint-toggle {
    margin: 0;
}

/* ── Rotation presets floating bar ── */
.wallprint-rotation-presets {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 4px 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 10;
}
.wallprint-rot-btn {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #fff;
    font-size: 11px;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    min-width: 36px;
    text-align: center;
}
.wallprint-rot-btn:hover {
    background: #f7931e;
    border-color: #f7931e;
    color: #fff;
}

.wallprint-canvas-area canvas {
    display: block;
    max-width: 100%;
    height: 700px;
    object-fit: contain;
    cursor: grab;
    border-radius: 4px;
}

.wallprint-sidebar {
    width: 480px;
    min-width: 420px;
    max-width: 540px;
    padding: 0;
    background: #fff;
    border-left: 1px solid #e5e5e5;
    overflow-y: visible;
    display: flex;
    flex-direction: column;
}

.wallprint-sidebar__body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    flex: 1;
}

.wallprint-sidebar__body > .wallprint-control {
    border-bottom: 1px solid #f0f0f0;
    border-right: 1px solid #f0f0f0;
}

.wallprint-sidebar__body > .wallprint-control:nth-child(2n) {
    border-right: none;
}

.wallprint-control--full {
    grid-column: 1 / -1;
}

/* ── Sidebar title ── */
.wallprint-sidebar__title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: -0.3px;
    padding: 12px 14px;
    background: #f8f9fa;
    border-bottom: 1px solid #e5e5e5;
}

/* ── Controls ── */
.wallprint-control {
    margin: 0;
    padding: 10px 14px;
    border-bottom: 1px solid #f0f0f0;
}

.wallprint-control:last-of-type {
    border-bottom: none;
}

.wallprint-label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #999;
}

.wallprint-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 13px;
    background: #fafafa;
    color: #333;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.wallprint-select:focus {
    border-color: #f7931e;
    box-shadow: 0 0 0 2px rgba(247, 147, 30, 0.15);
    outline: none;
}

/* ── Pattern grid ── */
.wallprint-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 6px;
}

.wallprint-card {
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
    background: #f8f9fa;
}

.wallprint-card:hover {
    border-color: #d0d0d0;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.wallprint-card--active {
    border-color: #f7931e;
    box-shadow: 0 0 0 1px #f7931e, 0 2px 8px rgba(247, 147, 30, 0.2);
}

.wallprint-card__img {
    width: 100%;
    height: 56px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.wallprint-card__name {
    padding: 3px 4px;
    font-size: 9px;
    color: #777;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.wallprint-empty {
    font-size: 12px;
    color: #aaa;
    font-style: italic;
    margin: 4px 0;
}

/* ── Custom upload ── */
.wallprint-custom-upload {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wallprint-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border: 2px dashed #d5d5d5;
    border-radius: 8px;
    background: #f8f9fa;
    color: #777;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    text-align: center;
    justify-content: center;
}

.wallprint-upload-btn:hover {
    border-color: #f7931e;
    color: #f7931e;
    background: #fff8f0;
}

.wallprint-custom-preview {
    position: relative;
    width: 72px;
    height: 72px;
    border: 2px solid #f7931e;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(247, 147, 30, 0.15);
    cursor: pointer;
}

.wallprint-custom-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wallprint-custom-preview__remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 12px;
    line-height: 18px;
    text-align: center;
    cursor: pointer;
    padding: 0;
}

.wallprint-custom-preview__remove:hover {
    background: #c0392b;
}

/* ── Preview toggle ── */
.wallprint-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #555;
    font-weight: 500;
}

.wallprint-toggle input {
    accent-color: #f7931e;
    width: 15px;
    height: 15px;
}

/* ── Scale ── */
.wallprint-scale {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wallprint-scale-btn {
    width: 34px;
    height: 34px;
    border: 1px solid #e0e0e0;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: #555;
    transition: background 0.1s, border-color 0.1s, transform 0.1s;
}

.wallprint-scale-btn:hover {
    background: #fff;
    border-color: #999;
    transform: scale(1.05);
}

.wallprint-scale-btn:active {
    transform: scale(0.95);
}

.wallprint-scale-val {
    min-width: 50px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

/* ── Price ── */
.wallprint-price-display {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 0;
    padding: 10px 14px;
    background: linear-gradient(135deg, #fff8f0, #fff5e6);
    border-bottom: 1px solid #f0f0f0;
    grid-column: 1 / -1;
}

.wallprint-price-label {
    font-size: 13px;
    color: #666;
}

.wallprint-price-value {
    font-size: 20px;
    font-weight: 700;
    color: #222;
}

/* ── Buttons ── */
.wallprint-btn-cart {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50%;
    min-width: 160px;
    height: 60px;
    box-sizing: border-box;
    margin: 10px auto;
    padding: 9px 12px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #f7931e, #e07e0a);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    transition: transform 0.1s, box-shadow 0.15s;
    letter-spacing: 0.3px;
    grid-column: 1 / -1;
}

.wallprint-variation-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}

.wallprint-variation-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wallprint-btn-cart:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(247, 147, 30, 0.35);
}

.wallprint-btn-cart:active {
    transform: translateY(0);
}

.wallprint-btn-cart:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ── Messages ── */
.wallprint-message {
    margin: 0;
    padding: 0 14px 10px;
    font-size: 13px;
    grid-column: 1 / -1;
}

.wallprint-msg--ok {
    color: #27ae60;
}

.wallprint-msg--ok a {
    color: #27ae60;
    font-weight: 600;
    text-decoration: underline;
}

.wallprint-msg--err {
    color: #c0392b;
}

/* ═══════════════════════════════════════════════════
 *  Popup styles (product page)
 * ═══════════════════════════════════════════════════ */

.wallprint-popup {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wallprint-popup__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
}

.wallprint-popup__content {
    position: relative;
    width: 95vw;
    max-width: 1400px;
    max-height: 92vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.wallprint-popup__close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    color: #999;
    z-index: 1;
    transition: color 0.15s;
}

.wallprint-popup__close:hover {
    color: #333;
}

/* WC "Wizualizator" button */
.wallprint-open-popup.button.alt {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 15px;
    background: #f7931e;
    border-color: #f7931e;
    color: #fff;
    font-weight: 600;
    padding: 7px 16px;
    border-radius: 5px;
    font-size: 14px;
    line-height: 1.2;
    min-height: 34px;
    height: auto;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s;
}

.wallprint-open-popup.button.alt:hover {
    background: #e07e0a;
    border-color: #e07e0a;
    color: #fff;
}

.wallprint-open-popup.button.alt:disabled,
.wallprint-open-popup.button.alt[aria-disabled="true"],
.wallprint-open-popup.button.alt.wallprint-open-popup--disabled {
    background: #d6d6d6;
    border-color: #d6d6d6;
    color: #777;
    cursor: not-allowed;
    opacity: 0.75;
}

.wallprint-open-popup.button.alt:disabled:hover,
.wallprint-open-popup.button.alt[aria-disabled="true"]:hover,
.wallprint-open-popup.button.alt.wallprint-open-popup--disabled:hover {
    background: #d6d6d6;
    border-color: #d6d6d6;
    color: #777;
}

.wallprint-open-popup-info {
    display: block;
    clear: both;
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.35;
    color: #777;
}

.wallprint-btn-icon {
    flex-shrink: 0;
    vertical-align: middle;
    width: 16px;
    height: 16px;
}

/* ═══════════════════════════════════════════════════
 *  Responsive
 * ═══════════════════════════════════════════════════ */

.wallprint-text-input-row {
    display: flex;
    gap: 6px;
    align-items: stretch;
    margin-bottom: 6px;
}

.wallprint-text-input-row .wallprint-text-input {
    flex: 1;
    margin-bottom: 0;
}

.wallprint-text-input-row .wallprint-btn-add-text {
    margin-bottom: 0;
    white-space: nowrap;
}

/* ── Text controls ── */
.wallprint-text-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 13px;
    background: #fafafa;
    color: #333;
    margin-bottom: 6px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.wallprint-text-input:focus {
    border-color: #f7931e;
    box-shadow: 0 0 0 2px rgba(247, 147, 30, 0.15);
    outline: none;
    background: #fff;
}

.wallprint-btn-add-text {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border: 1px solid #f7931e;
    border-radius: 6px;
    background: #f7931e;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 6px;
    transition: background 0.15s;
}
.wallprint-btn-add-text:hover {
    background: #e5841a;
}
.wallprint-btn-add-text svg {
    flex-shrink: 0;
}

.wallprint-text-options {
    padding: 8px 0 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wallprint-text-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wallprint-label-sm {
    font-size: 11px;
    font-weight: 600;
    color: #888;
    min-width: 55px;
    flex-shrink: 0;
}

.wallprint-select-sm {
    flex: 1;
    padding: 5px 8px;
    font-size: 12px;
}

.wallprint-text-toggles {
    gap: 6px;
}

.wallprint-toggle-btn {
    width: 34px;
    height: 34px;
    border: 1px solid #e0e0e0;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    color: #555;
    transition: background 0.1s, border-color 0.1s, transform 0.1s;
}

.wallprint-toggle-btn:hover {
    background: #fff;
    border-color: #999;
    transform: scale(1.05);
}

.wallprint-toggle-btn.active {
    background: #f7931e;
    color: #fff;
    border-color: #f7931e;
}

.wallprint-toggle-italic {
    font-style: italic;
}

.wallprint-color-input {
    width: 28px;
    height: 28px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 1px;
    cursor: pointer;
    background: #f8f9fa;
    vertical-align: middle;
}

/* ── Color button (icon + hidden input) ── */
.wallprint-color-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: auto;
    min-width: 74px;
    padding: 0 9px;
    cursor: pointer;
}

.wallprint-color-btn svg {
    display: block;
    flex-shrink: 0;
}

.wallprint-color-label {
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.wallprint-color-dot {
    position: absolute;
    bottom: 3px;
    right: 3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #000;
    border: 1px solid #e0e0e0;
    pointer-events: none;
}

.wallprint-color-hidden {
    position: absolute;
    width: 0;
    height: 0;
    padding: 0;
    border: none;
    opacity: 0;
    pointer-events: none;
}

/* ── Hint text ── */
.wallprint-hint {
    font-size: 11px;
    color: #aaa;
    margin: 0 0 6px;
    font-style: italic;
    line-height: 1.4;
}

/* ═══════════════════════════════════════════════════
 *  Layers panel (elementy na podglądzie)
 * ═══════════════════════════════════════════════════ */

.wallprint-layers-panel {
    width: 90px;
    min-width: 90px;
    background: #fafafa;
    border-left: 1px solid #e5e5e5;
    border-right: 1px solid #e5e5e5;
    overflow-y: auto;
    max-height: 80vh;
}

.wallprint-layers-panel__title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #999;
    padding: 10px 8px 6px;
    text-align: center;
    border-bottom: 1px solid #e5e5e5;
    position: sticky;
    top: 0;
    background: #fafafa;
    z-index: 2;
}

.wallprint-layers {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.wallprint-layer {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 6px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    border-left: 3px solid transparent;
    position: relative;
    transition: background 0.12s, border-color 0.12s;
}

.wallprint-layer:hover {
    background: #f0f0f0;
}

.wallprint-layer--active {
    background: #fff8f0;
    border-left-color: #f7931e;
}

.wallprint-layer__thumb {
    width: 52px;
    height: 52px;
    border-radius: 6px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #eee;
    border: 1px solid #ddd;
    flex-shrink: 0;
}

.wallprint-layer__thumb--text {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: #555;
    background: #fff;
}

.wallprint-layer__name {
    font-size: 9px;
    color: #666;
    margin-top: 4px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    font-weight: 500;
}

.wallprint-layer__remove {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 16px;
    height: 16px;
    border: none;
    border-radius: 50%;
    background: #e74c3c;
    color: #fff;
    font-size: 11px;
    line-height: 16px;
    text-align: center;
    cursor: pointer;
    padding: 0;
    opacity: 1;
}

.wallprint-layer__remove:hover {
    background: #c0392b;
}

/* ═══════════════════════════════════════════════════
 *  Responsive
 * ═══════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .wallprint-layout {
        flex-direction: column;
    }

    .wallprint-sidebar {
        width: 100%;
        max-width: none;
        min-width: 0;
        border-left: none;
        border-top: 1px solid #eee;
    }

    .wallprint-sidebar__body {
        grid-template-columns: 1fr;
    }

    .wallprint-control--full {
        grid-column: 1;
    }

    .wallprint-layers-panel {
        width: 100%;
        min-width: 0;
        max-height: none;
        border-left: none;
        border-right: none;
        border-top: 1px solid #e5e5e5;
        border-bottom: 1px solid #e5e5e5;
    }

    .wallprint-layers {
        flex-direction: row;
        overflow-x: auto;
        gap: 0;
    }

    .wallprint-layer {
        min-width: 70px;
        border-left: none;
        border-right: 1px solid #eee;
        border-bottom: 3px solid transparent;
    }

    .wallprint-layer--active {
        border-left: none;
        border-bottom-color: #f7931e;
    }

    .wallprint-popup__content {
        width: 98vw;
        padding: 12px;
        border-radius: 6px;
    }

    .wallprint-card__img {
        height: 50px;
    }

    .wallprint-grid {
        grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
    }
}

/* Mobile visualizer layout */
@media (max-width: 768px) {
    .wallprint-app,
    .wallprint-app * {
        box-sizing: border-box;
    }

    .wallprint-layout {
        display: flex;
        flex-direction: column;
        min-height: 0;
        width: 100%;
    }

    .wallprint-canvas-area {
        width: 100%;
        min-height: 260px;
        padding: 10px;
        align-items: center;
        background: #f3f4f5;
        border-bottom: 1px solid #e6e6e6;
    }

    .wallprint-canvas-area canvas {
        width: auto;
        max-width: 100%;
        height: auto;
        max-height: 44vh;
        border-radius: 6px;
    }

    .wallprint-canvas-preview-toggle {
        top: 10px;
        right: 10px;
        padding: 6px 9px;
        max-width: calc(100% - 20px);
    }

    .wallprint-canvas-preview-toggle .wallprint-toggle {
        gap: 6px;
        font-size: 12px;
        white-space: nowrap;
    }

    .wallprint-rotation-presets {
        left: 10px;
        right: 10px;
        bottom: 10px;
        transform: none;
        overflow-x: auto;
        justify-content: flex-start;
        padding: 6px;
        scrollbar-width: thin;
    }

    .wallprint-rot-btn {
        min-width: 42px;
        min-height: 34px;
        padding: 6px 8px;
        flex: 0 0 auto;
    }

    .wallprint-layers-panel {
        order: 2;
        width: 100%;
        min-width: 0;
        max-height: none;
        border-left: 0;
        border-right: 0;
        border-top: 0;
        border-bottom: 1px solid #e6e6e6;
    }

    .wallprint-layers-panel__title {
        display: none;
    }

    .wallprint-layers {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        padding: 6px 8px;
        gap: 8px;
        scrollbar-width: thin;
    }

    .wallprint-layer {
        flex: 0 0 72px;
        min-width: 72px;
        min-height: 74px;
        padding: 6px;
        border: 1px solid #ececec;
        border-radius: 8px;
        background: #fff;
    }

    .wallprint-layer--active {
        border-color: #f7931e;
        background: #fff8f0;
    }

    .wallprint-layer__thumb {
        width: 42px;
        height: 42px;
    }

    .wallprint-layer__name {
        width: 100%;
        font-size: 10px;
    }

    .wallprint-layer__remove {
        top: -5px;
        right: -5px;
        width: 22px;
        height: 22px;
        line-height: 22px;
        font-size: 13px;
    }

    .wallprint-sidebar {
        order: 3;
        width: 100%;
        min-width: 0;
        max-width: none;
        border-left: 0;
        border-top: 0;
    }

    .wallprint-sidebar__title {
        padding: 11px 14px;
        font-size: 14px;
        position: sticky;
        top: 0;
        z-index: 3;
    }

    .wallprint-sidebar__body {
        display: grid;
        grid-template-columns: 1fr;
    }

    .wallprint-sidebar__body > .wallprint-control,
    .wallprint-sidebar__body > .wallprint-control:nth-child(2n) {
        border-right: 0;
    }

    .wallprint-control,
    .wallprint-price-display,
    .wallprint-message {
        padding-left: 12px;
        padding-right: 12px;
    }

    .wallprint-control {
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .wallprint-label {
        margin-bottom: 9px;
        font-size: 11px;
        letter-spacing: 0.5px;
    }

    .wallprint-grid {
        display: flex;
        grid-template-columns: none;
        gap: 8px;
        overflow-x: auto;
        padding: 1px 2px 6px;
        scroll-snap-type: x proximity;
        scrollbar-width: thin;
    }

    .wallprint-card {
        flex: 0 0 82px;
        scroll-snap-align: start;
        border-radius: 8px;
    }

    .wallprint-card__img {
        height: 64px;
    }

    .wallprint-card__name {
        min-height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 4px;
        font-size: 10px;
        white-space: normal;
        line-height: 1.15;
    }

    .wallprint-upload-btn,
    .wallprint-select,
    .wallprint-text-input,
    .wallprint-btn-add-text,
    .wallprint-scale-btn,
    .wallprint-toggle-btn {
        min-height: 42px;
    }

    .wallprint-custom-preview {
        width: 82px;
        height: 82px;
    }

    .wallprint-text-input-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
    }

    .wallprint-btn-add-text {
        padding-left: 12px;
        padding-right: 12px;
    }

    .wallprint-text-options {
        gap: 10px;
    }

    .wallprint-text-row {
        flex-wrap: wrap;
    }

    .wallprint-label-sm {
        min-width: 64px;
    }

    .wallprint-scale {
        gap: 10px;
    }

    .wallprint-scale-btn,
    .wallprint-toggle-btn {
        width: 42px;
        height: 42px;
    }

    .wallprint-scale-val {
        min-width: 58px;
    }

    .wallprint-price-display {
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .wallprint-price-value {
        font-size: 18px;
        text-align: right;
    }

    .wallprint-btn-cart {
        width: 50%;
        min-width: 160px;
        height: 60px;
        min-height: 60px;
        margin: 12px auto;
        padding: 10px 12px;
        font-size: 13px;
        border-radius: 8px;
    }

    .wallprint-message {
        padding-bottom: 12px;
        line-height: 1.45;
    }
}

@media (max-width: 768px) {
    .wallprint-popup {
        align-items: stretch;
        justify-content: stretch;
    }

    .wallprint-popup__content {
        width: 100vw;
        max-width: none;
        height: 100dvh;
        max-height: none;
        margin: 0;
        padding: 0;
        border-radius: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .wallprint-popup__close {
        position: fixed;
        top: 8px;
        right: 8px;
        width: 38px;
        height: 38px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.95);
        box-shadow: 0 2px 8px rgba(0,0,0,0.14);
        color: #333;
        font-size: 28px;
        line-height: 36px;
        z-index: 20;
    }

    .wallprint-popup .wallprint-canvas-area {
        position: sticky;
        top: 0;
        z-index: 5;
        padding-top: 48px;
        min-height: 300px;
        box-shadow: 0 1px 8px rgba(0,0,0,0.08);
    }

    .wallprint-popup .wallprint-canvas-area canvas {
        max-height: 40vh;
    }
}

@media (max-width: 420px) {
    .wallprint-canvas-area {
        min-height: 230px;
        padding-left: 8px;
        padding-right: 8px;
    }

    .wallprint-canvas-area canvas {
        max-height: 38vh;
    }

    .wallprint-popup .wallprint-canvas-area {
        min-height: 270px;
    }

    .wallprint-popup .wallprint-canvas-area canvas {
        max-height: 36vh;
    }

    .wallprint-card {
        flex-basis: 76px;
    }

    .wallprint-card__img {
        height: 58px;
    }

    .wallprint-text-input-row {
        grid-template-columns: 1fr;
    }

    .wallprint-btn-add-text {
        width: 100%;
        justify-content: center;
    }

    .wallprint-price-display {
        align-items: flex-start;
        flex-direction: column;
    }

    .wallprint-price-value {
        text-align: left;
    }
}
