/* Eskimo Designer Studio Modal */
@font-face {
    font-family: "Montserrat";
    src: url("../vendor/Montserrat.ttf") format("truetype");
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
}

@font-face {
    font-family: "Pacifico";
    src: url("../vendor/Pacifico-Regular.ttf") format("truetype");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Bebas Neue";
    src: url("../vendor/BebasNeue-Regular.ttf") format("truetype");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Oswald";
    src: url("../vendor/Oswald.ttf") format("truetype");
    font-style: normal;
    font-weight: 200 700;
    font-display: swap;
}

@font-face {
    font-family: "Lobster";
    src: url("../vendor/Lobster-Regular.ttf") format("truetype");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Playfair Display";
    src: url("../vendor/PlayfairDisplay.ttf") format("truetype");
    font-style: normal;
    font-weight: 400 900;
    font-display: swap;
}

.eskimo-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.eskimo-modal.hidden {
    display: none;
}

body .swal2-container {
    z-index: 100100;
}

/* Prevent third-party floating widgets (e.g. chat buttons) from intercepting clicks on the designer modal. */
body.ed-designer-open #eskimo-chat-widget {
    display: none !important;
}

.ed-custom-btn .ed-button-icon {
    margin-right: 0.4em;
}

.eskimo-modal-content {
    position: relative;
    background: #ffffff;
    width: min(1000px, 95vw);
    max-width: 95vw;
    height: 90vh;
    max-height: 90vh;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.ed-loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(2px);
}

.ed-loading-overlay.hidden {
    display: none;
}

.ed-loading-dialog {
    display: grid;
    justify-items: center;
    gap: 10px;
    width: min(300px, 100%);
    padding: 22px;
    text-align: center;
    color: #1d2327;
    background: #fff;
    border: 1px solid #ccd0d4;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.ed-loading-spinner {
    width: 34px;
    height: 34px;
    border: 4px solid #dcdcde;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: ed-loading-spin 0.8s linear infinite;
}

@keyframes ed-loading-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .ed-loading-spinner {
        animation-duration: 1.6s;
    }
}

.eskimo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #1e1e1e;
    color: #ffffff;
}

.eskimo-header h2 {
    margin: 0;
    color: #fff;
    font-size: 18px;
}

#eskimo-close-designer {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
}

.eskimo-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 20px;
    background: #ececec;
    overflow: auto;
}

.eskimo-sidebar {
    flex: 0 0 220px;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.eskimo-toolbar {
    padding-right: 6px;
}

.eskimo-right-panel {
    padding-left: 6px;
}

.eskimo-sidebar > * {
    flex-shrink: 0;
}

.eskimo-sidebar button {
    width: 100%;
    padding: 10px;
    text-align: center;
}

#eskimo-view-switcher {
    display: grid;
    gap: 5px;
}

.ed-command-row,
.ed-zoom-controls {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
}

.ed-zoom-controls {
    align-items: center;
}

.ed-zoom-controls output {
    text-align: center;
    font-size: 12px;
}

.eskimo-canvas-wrapper {
    position: relative;
    flex: 0 0 auto;
    align-self: center;
    max-width: 100%;
    overflow: visible;
    min-width: 0;
    background: #ffffff;
    border: 1px solid #ddd;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
}

.ed-product-mockup {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    pointer-events: none;
    z-index: 0;
}

.ed-product-mockup.is-empty {
    display: none;
}

.eskimo-canvas-wrapper .canvas-container,
.eskimo-canvas-wrapper canvas {
    max-width: 100%;
}

.eskimo-canvas-wrapper .canvas-container {
    position: relative !important;
    z-index: 1;
    display: block;
    margin: 0 auto;
}

.ed-safe-area {
    position: absolute;
    inset: 5%;
    border: 2px solid transparent;
    background:
        repeating-linear-gradient(90deg, #ffffff 0 8px, #111111 8px 16px) top / 100% 2px no-repeat,
        repeating-linear-gradient(90deg, #111111 0 8px, #ffffff 8px 16px) bottom / 100% 2px no-repeat,
        repeating-linear-gradient(0deg, #ffffff 0 8px, #111111 8px 16px) left / 2px 100% no-repeat,
        repeating-linear-gradient(0deg, #111111 0 8px, #ffffff 8px 16px) right / 2px 100% no-repeat;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.8), inset 0 0 0 1px rgba(0, 0, 0, 0.75);
    pointer-events: none;
    z-index: 2;
}

.ed-ruler {
    position: absolute;
    pointer-events: none;
    z-index: 3;
    opacity: 0.55;
}

.ed-ruler-horizontal {
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: repeating-linear-gradient(90deg, #1d2327 0 1px, transparent 1px 10px);
}

.ed-ruler-vertical {
    top: 0;
    bottom: 0;
    left: 0;
    width: 8px;
    background: repeating-linear-gradient(180deg, #1d2327 0 1px, transparent 1px 10px);
}

#ed-upload-image {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.ed-print-dimensions,
.ed-image-status {
    margin: 0;
    font-size: 12px;
    line-height: 1.4;
}

.ed-image-status {
    color: #8a2424;
}

.ed-section-title {
    margin: 4px 0 0;
    font-size: 13px;
    line-height: 1.4;
    letter-spacing: 0;
}

.ed-technique-control {
    display: grid;
    gap: 5px;
}

.ed-technique-control select {
    width: 100%;
}

.ed-design-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 10px;
    min-width: 220px;
    background: #fff;
    border: 1px solid #ccd0d4;
}

.ed-text-controls {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px;
    align-items: center;
}

.ed-text-controls select {
    min-width: 0;
}

.ed-text-controls input[type="range"] {
    min-width: 0;
    width: 100%;
}

.ed-format-buttons {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-column: 1 / -1;
    gap: 4px;
}

.ed-format-buttons button[aria-pressed="true"] {
    color: #fff;
    background: #1d2327;
}

.ed-clipart-gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: min-content;
    align-items: start;
    gap: 6px;
    height: 180px;
    min-height: 180px;
    max-height: 180px;
    overflow-y: auto;
}

.ed-clipart-gallery button {
    aspect-ratio: 1;
    width: 100%;
    padding: 4px;
    background: #fff;
    overflow: hidden;
    border-radius: 0;
}

.ed-clipart-rounded .ed-clipart-gallery button,
.ed-clipart-rounded .ed-clipart-gallery img {
    border-radius: 8px;
}

.ed-clipart-gallery img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ed-empty-clipart {
    grid-column: 1 / -1;
    margin: 0;
    font-size: 12px;
}

.ed-layer-panel {
    display: grid;
    gap: 4px;
    min-height: 44px;
    max-height: 190px;
    overflow-y: auto;
}

.ed-layer-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) repeat(4, 28px);
    gap: 3px;
    align-items: center;
    padding: 4px;
    background: #fff;
    border: 1px solid #ccd0d4;
}

.ed-layer-row.is-active {
    border-color: #2271b1;
}

.ed-layer-row input {
    min-width: 0;
    width: 100%;
}

.ed-layer-row button {
    width: 28px;
    min-height: 28px;
    padding: 0;
}

.eskimo-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    background: #f8f8f8;
    border-top: 1px solid #ddd;
}

@media (max-width: 720px) {
    .eskimo-modal {
        align-items: stretch;
    }

    .eskimo-modal-content {
        width: 100%;
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .eskimo-body {
        flex-direction: column;
        gap: 12px;
        padding: 12px;
        overflow-y: auto;
    }

    .eskimo-sidebar {
        flex: 0 0 auto;
        width: 100%;
        overflow: visible;
        padding: 0;
    }

    .eskimo-toolbar {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .eskimo-toolbar hr,
    #eskimo-view-switcher,
    .ed-print-dimensions,
    .ed-image-status,
    .ed-section-title,
    .ed-technique-control,
    .ed-text-controls,
    .ed-clipart-gallery,
    .ed-command-row,
    .ed-zoom-controls,
    .ed-layer-panel,
    .ed-design-subtotal {
        grid-column: 1 / -1;
    }

    #eskimo-view-switcher {
        display: flex;
        gap: 6px;
        overflow-x: auto;
    }

    #eskimo-view-switcher button {
        flex: 0 0 auto;
    }

    .eskimo-canvas-wrapper {
        align-self: center;
    }

    .eskimo-footer {
        flex-wrap: wrap;
    }

    .ed-design-subtotal {
        flex: 1 1 180px;
        min-width: 0;
    }
}