/**
 * MJ Band Designer - Editor Styles
 * 
 * Frontend editor modal en canvas styling
 */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600&display=swap');

:root {
    --mj-font: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
    --mj-font-size: 1rem;
    --mj-font-weight: 400;
    --mj-font-weight-strong: 600;
    --mj-heading-size: 1.3rem;
}

/* Force Montserrat across the entire editor (including form controls) */
#mj-band-editor-modal,
#mj-band-editor-modal *,
.mj-band-editor,
.mj-band-editor * {
    font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif !important;
}

#mj-band-editor-modal input,
#mj-band-editor-modal select,
#mj-band-editor-modal button,
#mj-band-editor-modal textarea,
.mj-band-editor input,
.mj-band-editor select,
.mj-band-editor button,
.mj-band-editor textarea {
    font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif !important;
}

/* Base typography/colors for the designer surface (match desired body styles) */
#mj-band-editor-modal,
.mj-band-editor {
    background-color: #fff;
    color: #333;
    font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif !important;
    font-size: 1rem !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* High-specificity selectors to override theme styles */
body .mj-band-editor,
body .mj-band-editor *,
body #mj-band-editor-modal,
body #mj-band-editor-modal *,
.mj-band-editor,
.mj-band-editor *,
#mj-band-editor-modal,
#mj-band-editor-modal * {
    font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif !important;
    font-size: var(--mj-font-size);
    font-weight: var(--mj-font-weight);
}

body .mj-band-editor strong,
body .mj-band-editor b,
body #mj-band-editor-modal strong,
body #mj-band-editor-modal b,
.mj-band-editor strong,
.mj-band-editor b {
    font-weight: var(--mj-font-weight-strong) !important;
}

body .mj-band-editor h1,
body .mj-band-editor h2,
body .mj-band-editor h3,
body .mj-band-editor h4,
body #mj-band-editor-modal h1,
body #mj-band-editor-modal h2,
body #mj-band-editor-modal h3,
body #mj-band-editor-modal h4,
.mj-band-editor h1,
.mj-band-editor h2,
.mj-band-editor h3,
.mj-band-editor h4 {
    font-size: var(--mj-heading-size) !important;
    font-weight: var(--mj-font-weight-strong) !important;
    font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif !important;
}

/* Uitverkochte kleuren: gedesatureerd en niet-klikbaar */
.mj-band-editor .mj-swatch.uitverkocht-kleur {
    display: none; /* Verberg uitverkochte kleuren standaard */
}

.mj-band-editor .mj-field.has-outofstock .mj-swatch.uitverkocht-kleur {
    display: flex !important; /* Toon uitverkochte kleuren als er uitverkochte items zijn */
    opacity: 0.55;
    cursor: not-allowed;
    position: relative;
}

/* Out-of-stock swatches - simplified selector */
.mj-swatch.is-out {
    cursor: not-allowed !important;
    position: relative !important;
    z-index: 10000 !important;
}

/* Apply opacity only to visible content, not the swatch container */
.mj-swatch.is-out img,
.mj-swatch.is-out span {
    opacity: 0.55 !important;
    pointer-events: none !important;
}

/* Tooltip for out-of-stock swatches (single body-level element) */
.mj-oos-tooltip {
    position: fixed !important;
    z-index: 2147483647 !important;
    left: -9999px;
    top: -9999px;
    font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif !important;
    padding: 10px 14px;
    background: #FF7A41;
    color: #ffffff;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.3;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.08s ease;
}

.mj-oos-tooltip.is-visible {
    opacity: 1;
}

.mj-disclaimer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.mj-disclaimer-modal {
    background: #fff;
    border-radius: 10px;
    max-width: 640px;
    width: 100%;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    color: #1F2A44;
    font-family: 'Montserrat', sans-serif;
    max-height: 90vh;
    overflow-y: auto;
}

.mj-disclaimer-text {
    margin: 0 0 16px;
    line-height: 1.55;
    font-size: 1rem;
    font-weight: 400;
    color: #1F2A44;
    font-family: 'Montserrat', sans-serif;
}

.mj-disclaimer-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.mj-disclaimer-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    color: #FF7A41;
    font-weight: 600;
}

.mj-disclaimer-toggle input {
    width: 18px;
    height: 18px;
    accent-color: #FF7A41;
}

.mj-disclaimer-actions {
    display: flex;
    justify-content: flex-end;
    flex: 1;
}

.mj-disclaimer-btn {
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: #FF7A41;
    border: 1px solid #FF7A41;
    border-radius: 10px;
    padding: 10px 16px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.mj-disclaimer-btn:hover {
    color: #FF7A41;
    background: #fff;
    border-color: #FF7A41;
}

@media (max-width: 640px) {
    .mj-disclaimer-modal {
        max-width: 520px;
        padding: 18px;
    }
}

/* Modal overlay */
#mj-band-editor-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Editor container */
.mj-band-editor {
    background: #fff;
    width: 95%;
    max-width: 1400px;
    height: 90vh;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    overflow: visible;
}

/* Product title sizing (desktop & mobile) */
h1, .product_title, .entry-title,
h1.product_title, h2.product_title, h3.product_title,
.single-product .product .product_title {
    font-size: 1.3rem !important;
    line-height: 1.2 !important;
}

/* Extra specificity to override theme product title (desktop & mobile) */
body.single-product h1.product_title,
body.single-product h2.product_title,
body.single-product h3.product_title,
body.single-product .product_title {
    font-size: 1.3rem !important;
    line-height: 1.2 !important;
}

/* Editor sidebar product name override */
#mj-editor-options h3,
.mj-editor-sidebar h3,
.mj-editor-options h3 {
    font-size: 1.3rem !important;
    line-height: 1.2 !important;
}

/* Header */
.mj-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #ddd;
}

#mj-header-price {
    display: none !important;
}

.mj-editor-logo {
    max-height: 50px;
}

.mj-lang-switcher {
    display: flex;
    gap: 10px;
}

.mj-lang-btn {
    padding: 8px 16px;
    border: 1px solid #ccc;
    background: #fff;
    cursor: pointer;
    border-radius: 4px;
}

.mj-lang-btn.active {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.mj-editor-close {
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: #999;
}

.mj-editor-close:hover {
    color: #333;
}

/* Body */
.mj-editor-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Options panel (left) */
.mj-editor-options {
    width: 30%;
    padding: 20px;
    border-right: 1px solid #ddd;
    overflow-y: visible;
    overflow-x: visible;
}

.mj-editor-options h3 {
    margin-top: 0;
}

.mj-field {
    margin-bottom: 20px;
    overflow: visible;
    position: relative;
}

.mj-field label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-weight: bold;
}

.mj-scroll-hint {
    display: none;
    font-size: 14px;
    color: #FF7A41;
    margin-left: auto;
    padding-right: 10px;
}

@media (max-width: 768px) {
    .mj-scroll-hint {
        display: inline-block;
    }
}

.mj-field input[type="text"],
.mj-field select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* Font preview in dropdown */
.mj-font-preview {
    font-size: 16px;
}

.mj-font-preview option {
    padding: 8px;
    font-size: 16px;
}

/* Font list */
.mj-font-list {
    max-height: 300px;
    overflow-y: auto;
}

.mj-font-item {
    padding: 8px;
    cursor: pointer;
    border: 1px solid #ddd;
    margin-bottom: 4px;
    font-size: 1.1rem;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

/* Font item colors now controlled via inline settings in template */

.mj-char-counter {
    margin-top: 5px;
    font-size: 14px;
    color: #666;
    display: block !important;
}

/* Price display */
.mj-price-display {
    background: #f8f8f8;
    border: 2px solid #0073aa;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
}

.mj-price-display label {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.mj-price {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

#mj-total-price {
    font-size: 24px;
    font-weight: bold;
    color: #0073aa;
}

#mj-price-breakdown {
    font-size: 12px;
    color: #666;
    display: block;
}

/* Collapsible accordeon (desktop & mobile) */
.mj-field:not(.mj-field-always-open) label {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.mj-field:not(.mj-field-always-open) label:after {
    content: '▼';
    font-size: 12px;
    margin-left: 8px;
    transition: transform 0.3s;
}

.mj-field.collapsed label:after {
    transform: rotate(-90deg);
}

.mj-field-content {
    max-height: 1000px;
    overflow: visible;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.mj-field.collapsed .mj-field-content {
    max-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    overflow: hidden !important;
}

/* Always visible fields */
.mj-field-always-open label {
    cursor: default;
}

/* Color swatches */
.mj-color-swatches {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    overflow: visible; /* Allow tooltips to show outside */
    position: relative;
    z-index: 100;
}

/* Desktop: max 6 garens visible with scroll */
.thread-swatches {
    max-height: calc((60px + 5px + 12px + 5px + 10px) * 2 + 10px); /* 2 rows of swatches */
    overflow-y: auto;
    padding-right: 5px;
    position: relative;
    z-index: 1;
}

.thread-swatches::-webkit-scrollbar {
    width: 8px;
}

.thread-swatches::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.thread-swatches::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.thread-swatches::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.mj-swatch {
    border: 2px solid #ddd;
    border-radius: 4px;
    padding: 5px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.mj-swatch:hover {
    border-color: #0073aa;
    transform: scale(1.05);
}

.mj-swatch.selected {
    border-color: #0073aa;
    box-shadow: 0 0 10px rgba(0,115,170,0.3);
}

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

.mj-swatch span {
    display: block;
    margin-top: 5px;
    font-size: 12px;
}

.premium-badge {
    display: inline-block;
    background: #FFD700;
    color: #000;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: normal;
    margin-top: 3px;
}

.premium-badge .premium-label {
    display: inline-block;
    font-weight: bold;
}

.premium-badge .premium-price {
    display: inline-block;
    margin-left: 4px;
    font-weight: normal;
}

@media (max-width: 768px) {
    .premium-badge {
        display: inline-flex;
        flex-direction: column;
        align-items: center;
    }

    .premium-badge .premium-price {
        display: block;
        margin-left: 0;
        margin-top: 2px;
    }
}

/* Thread swatch closeup hover */
.thread-swatch {
    position: relative;
}

/* Removed broken hover zoom effect */

/* Preview panel (right) */
.mj-editor-preview {
    width: 70%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    overflow: auto;
}

.mj-zoom-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    column-gap: 8px;
    row-gap: 6px;
    width: 100%;
    text-align: right;
    margin-bottom: 15px;
}

.mj-zoom-controls button {
    padding: 10px 16px;
    margin: 0 6px 0 0;
    border: 1px solid #FF7A41;
    background: #fff;
    color: #FF7A41;
    cursor: pointer;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    font-weight: 700;
}

.mj-zoom-controls button:hover {
    background: #f0f0f0;
}

.mj-zoom-controls span {
    display: block;
    flex-basis: 100%;
    margin-top: 4px;
    margin-left: 0;
    text-align: right;
    color: #666;
}

#mj-canvas {
    border: 2px solid #ccc;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-width: 100%;
    height: auto;
}

/* Footer */
.mj-editor-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-top: 1px solid #ddd;
    background: #fafafa;
}

.mj-price-display {
    font-size: 18px;
}

.mj-price-display strong {
    font-size: 24px;
    color: #0073aa;
}

.mj-editor-footer .button {
    padding: 10px 20px;
    margin-left: 10px;
}

/* Disabled personalize button styling */
.mj-band-personalize-btn-disabled,
button.mj-band-personalize-btn-disabled:disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    background-color: #cccccc !important;
    border-color: #cccccc !important;
    color: #666666 !important;
}

.mj-band-personalize-btn-disabled:hover,
button.mj-band-personalize-btn-disabled:disabled:hover {
    background-color: #cccccc !important;
    border-color: #cccccc !important;
}

/* Responsive */
@media (max-width: 1024px) {
    .mj-editor-body {
        flex-direction: column;
    }
    
    .mj-editor-options,
    .mj-editor-preview {
        width: 100% !important;
    }
    
    .mj-editor-options {
        border-right: none;
        border-bottom: 1px solid #ddd;
        order: 2;
    }
    
    .mj-editor-preview {
        order: 1;
        border-bottom: 2px solid #ddd;
    }
}

/* Mobile optimization */
@media (max-width: 768px) {
    .mj-band-editor {
        height: 100vh;
        width: 100%;
        max-width: 100%;
        border-radius: 0;
    }
    
    /* Fullscreen editor adjustments */
    .mj-band-editor-fullscreen {
        height: 100vh;
    }
    
    .mj-editor-body {
        flex-direction: column;
    }
    
    /* FULLSCREEN EDITOR MOBILE LAYOUT */
    .mj-editor-body-fullscreen {
        flex-direction: column !important;
        display: flex !important;
    }
    
    /* Canvas area - give a bit more height on mobile */
    .mj-editor-canvas-area {
        order: 1 !important;
        width: 100% !important;
        min-height: auto !important;
        max-height: 50vh !important;
        border-right: none !important;
        border-bottom: 1px solid #ddd;
        flex: 0 0 auto !important;
        position: relative;
        z-index: 1 !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column;
        align-items: center !important;
        justify-content: flex-start !important;
        padding: 0 0 8px;
        background: #e8e8e8;
    }
    
    /* Canvas itself - contain scaling on mobile */
    #mj-canvas {
        max-width: 100% !important;
        height: auto !important;
        z-index: 1 !important;
        display: block !important;
        cursor: pointer !important;
        touch-action: manipulation !important;
    }
    
    /* Hide footer on mobile */
    .mj-editor-footer-fullscreen {
        display: none !important;
    }
    
    /* Sidebar with options - less space but still scrollable */
    .mj-editor-sidebar {
        order: 2 !important;
        width: 100% !important;
        border-right: none !important;
        border-top: none !important;
        flex: 1 1 auto !important;
        overflow-y: auto !important;
        padding: 15px;
        z-index: 100 !important;
        position: relative;
        background: #f7f7f7;
        max-height: none !important;
    }
    
    /* Dropdowns in sidebar - HIGHEST z-index */
    .mj-editor-sidebar select,
    .mj-editor-sidebar .mj-field select,
    .mj-field select {
        z-index: 999 !important;
        position: relative;
    }
    
    /* When dropdown is open */
    select:focus {
        z-index: 9999 !important;
    }
    
    /* Header on mobile - grid for clear alignment */
    .mj-editor-header {
        padding: 8px 10px !important;
        z-index: 1000 !important;
        position: relative;
        gap: 8px;
        display: grid !important;
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        grid-template-areas:
            "logo lang"
            "controls price";
        align-items: center;
    }

    /* Show price on mobile header */
    #mj-header-price {
        display: block !important;
    }

    .mj-editor-header > div:first-child {
        grid-area: controls;
        display: flex !important;
        align-items: center;
        gap: 8px;
        flex-wrap: nowrap;
        justify-content: flex-start;
    }

    .mj-editor-header > div:last-child {
        display: contents !important;
    }

    /* Logo and language row */
    .mj-editor-logo, .mj-editor-header > h2 {
        grid-area: logo;
        position: static !important;
        max-height: 32px !important;
    }

    .mj-lang-switcher {
        grid-area: lang;
        position: static !important;
        justify-self: end;
        display: flex;
        gap: 4px;
    }
    
    .mj-lang-btn {
        padding: 4px 10px;
        font-size: 13px;
    }
    
    /* Controls row: back, save, print, cart on the left */
    #mj-header-add-to-cart {
        order: 4;
        font-size: 22px !important;
        width: 44px;
        height: 44px;
        padding: 8px !important;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
    }
    
    /* Compact header buttons */
    #mj-save-design,
    #mj-print-design {
        padding: 8px !important;
        width: 44px;
        height: 44px;
        font-size: 22px !important;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: #c51652;
    }

    /* Hide save buttons on mobile */
    #mj-save-design,
    #mj-save-design-mobile {
        display: none !important;
    }

    #mj-save-design { order: 2; }
    #mj-print-design { order: 3; }
    
    .mj-back-btn {
        padding: 8px 6px !important;
        font-size: 15px !important;
        width: auto;
        order: 1;
        text-align: left;
    }
    

    /* Icon color inside buttons */
    #mj-save-design i,
    #mj-print-design i,
    #mj-header-add-to-cart i {
        color: #c51652;
        font-size: 22px;
        line-height: 1;
    }
    
    .mj-zoom-controls {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        margin: 14px 0 14px;
        z-index: 2 !important;
        justify-content: center;
        gap: 10px;
    }
    
    .mj-zoom-controls span {
        display: none; /* Hide tip on mobile */
    }
    
    /* Mobile controls in footer */
    .mj-mobile-controls {
        display: block !important;
        width: 100%;
    }
    
    /* Make canvas full width on mobile - SHOW FIRST */
    .mj-editor-preview {
        order: 1 !important;
        width: 100%;
        padding: 0;
        min-height: 40vh;
        max-height: 40vh;
        border-right: none;
        border-bottom: 1px solid #ddd;
        z-index: 1 !important;
        overflow: hidden;
    }
    
    /* Options below canvas - SHOW SECOND */
    .mj-editor-options {
        order: 2 !important;
        width: 100%;
        padding: 10px;
        max-height: none;
        overflow-y: auto;
        border-right: none;
        z-index: 100 !important;
        position: relative;
    }
    
    /* Accordeon style for mobile */
    .mj-field {
        border: 1px solid #ddd;
        border-radius: 4px;
        margin-bottom: 10px;
        overflow: hidden;
    }
    
    .mj-field label {
        background: #f5f5f5;
        padding: 12px;
        margin-bottom: 0;
        font-weight: bold;
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .mj-field:not(.mj-field-always-open) label:after {
        content: '▼';
        font-size: 12px;
        transition: transform 0.3s;
    }
    
    .mj-field.collapsed label:after {
        transform: rotate(-90deg);
    }
    
    .mj-field-content {
        padding: 12px;
        max-height: 500px;
        overflow-y: auto;
        transition: max-height 0.3s ease, padding 0.3s ease;
    }
    
    .mj-field.collapsed .mj-field-content {
        max-height: 0 !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        overflow: hidden !important;
    }
    
    /* Horizontal scroll for swatches on mobile */
    .mj-color-swatches {
        display: flex;
        overflow-x: auto;
        overflow-y: visible;
        gap: 10px;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
    }
    
    .mj-swatch {
        flex-shrink: 0;
        min-width: 80px;
    }
    
    /* Font list horizontal scroll on mobile */
    .mj-font-list {
        display: flex !important;
        flex-direction: row !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        gap: 10px;
        padding-bottom: 10px;
        max-height: none !important;
        -webkit-overflow-scrolling: touch;
    }
    
    .mj-font-item {
        flex: 0 0 auto !important;
        min-width: 120px !important;
        font-size: 0.9rem !important;
        padding: 12px 10px !important;
        white-space: nowrap !important;
    }
    
    /* Larger touch targets */
    button, .mj-swatch, .mj-font-item {
        min-height: 44px;
    }
    
    /* Sticky header on mobile */
    .mj-editor-header {
        position: sticky;
        top: 0;
        z-index: 10;
        background: #fff;
    }
    
    /* Canvas controls larger on mobile */
    .mj-zoom-controls button {
        padding: 8px 12px;
        font-size: 15px;
        border: 1px solid #FF7A41;
        color: #FF7A41;
        background: #fff;
        border-radius: 6px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.08);
        font-weight: 700;
    }

    /* Font size slider usability on mobile */
    #mj-font-size {
        width: 100%;
        touch-action: pan-x;
    }

    /* Reset button font style on mobile */
    #mj-zoom-reset {
        font-family: 'Montserrat', sans-serif;
        font-weight: 600;
        font-size: 14px;
    }

    /* Mobile product title smaller */
    .mj-editor-options h3 {
        font-size: 16px !important;
        text-align: center;
    }

    /* Product title smaller on mobile to fit one line */
    h1, .product_title {
        font-size: 1.3rem !important;
        line-height: 1.2 !important;
    }
}

/* iPad portrait: force desktop layout instead of mobile stacking */
@media (orientation: portrait) and (min-device-width: 768px) and (max-device-width: 1024px) {
    .mj-band-editor {
        padding-left: 20px;
        padding-right: 20px;
    }

    .mj-editor-body,
    .mj-editor-body-fullscreen {
        flex-direction: column !important;
    }

    .mj-editor-preview {
        order: 1 !important;
        width: 100% !important;
        max-height: none !important;
        min-height: auto !important;
        padding: 0 20px 0 !important; /* Remove bottom padding to tighten gap above product name */
        border-right: none !important;
        border-bottom: 1px solid #ddd !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .mj-editor-options,
    .mj-editor-sidebar {
        order: 2 !important;
        width: 100% !important;
        padding: 8px !important; /* Tablet portrait: match inspected padding */
        border-right: none !important;
        border-bottom: none !important;
        border-top: 1px solid #ddd !important;
        max-height: 100% !important;
    }

    .mj-editor-canvas-area {
        max-height: none !important;
        border-bottom: none !important;
        padding-bottom: 5px !important;
    }

    /* Keep header padded in from screen edges */
    .mj-editor-header {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }

    /* Swatches in one horizontal row with swipe, like mobile */
    .mj-color-swatches,
    .thread-swatches {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        gap: 10px;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
    }

    .thread-swatches {
        max-height: none !important;
        padding-right: 0 !important;
    }

    .mj-swatch {
        flex-shrink: 0;
        min-width: 80px;
    }

    #mj-save-design,
    #mj-save-design-mobile {
        display: none !important;
    }

    .mj-zoom-controls {
        justify-content: center !important;
        margin: 12px 0 8px !important;
    }

    .mj-zoom-controls span {
        display: none !important;
    }

}

