/* ----------------------------------------------------
   WRAPPER
---------------------------------------------------- */

.ltd-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: inherit;
}

.ltd-title {
    margin-bottom: 10px;
}

.ltd-intro,
.ltd-small-note {
    max-width: 700px;
    line-height: 1.5;
}


/* ----------------------------------------------------
   MAIN GRID LAYOUT
---------------------------------------------------- */

.ltd-grid {
    display: grid;
    grid-template-columns: 320px 1fr 260px;
    gap: 40px;
    align-items: start;
    margin-top: 40px;
}


/* ----------------------------------------------------
   CONTROLS COLUMN
---------------------------------------------------- */

.ltd-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-height: calc(100vh - 20px);
    overflow-y: auto;
    padding-right: 12px;
    scrollbar-width: thin;
}

.ltd-controls::-webkit-scrollbar {
    width: 6px;
}

.ltd-controls::-webkit-scrollbar-thumb {
    background: #8aff00;
    border-radius: 4px;
    opacity: 0.4;
}

.ltd-controls::-webkit-scrollbar-thumb:hover {
    opacity: 0.7;
}


/* ----------------------------------------------------
   MOBILE STEP NAV
---------------------------------------------------- */

.ltd-mobile-nav {
    display: none;
}


/* ----------------------------------------------------
   ACCORDION
---------------------------------------------------- */

.ltd-accordion {
    border-bottom: 1px solid #e5e5e5;
    padding-bottom: 4px;
    margin-bottom: 4px;
}

.ltd-accordion-header {
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    padding: 6px 0;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.3px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 3px solid transparent;
    transition: border-color 0.25s ease, color 0.25s ease;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

.ltd-accordion-header::after {
    content: "+";
    font-size: 18px;
    transition: transform 0.2s ease, color 0.2s ease;
    pointer-events: none;
}

.ltd-accordion-header:hover {
    border-left-color: #8aff00;
    color: #333;
}

.ltd-accordion-header.active {
    border-left-color: #8aff00;
    color: #222;
}

.ltd-accordion-header.active::after {
    transform: rotate(45deg);
    color: #8aff00;
}

.ltd-accordion-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: max-height 0.25s ease, opacity 0.25s ease;
    padding: 0 0 0 12px;
    box-sizing: border-box;
}

.ltd-accordion-content.open {
    max-height: 2000px;
    opacity: 1;
    pointer-events: auto;
    overflow: hidden;
    padding: 0 0 12px 12px;
    background: rgba(138, 255, 0, 0.05);
    border-left: 3px solid #8aff00;
    border-radius: 4px;
}

.ltd-helper {
    font-size: 13px;
    opacity: 0.8;
    margin-top: 8px;
    line-height: 1.5;
}

.ltd-label {
    font-size: 13px;
    opacity: 0.8;
}


/* ----------------------------------------------------
   FORM FIELDS
---------------------------------------------------- */

.ltd-accordion-content input[type="text"],
.ltd-accordion-content input[type="email"],
.ltd-accordion-content textarea,
.ltd-accordion-content select,
.ltd-text-controls input,
.ltd-text-controls select,
.ltd-mobile-layer-editor input[type="range"] {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    background: #fff;
}

.ltd-accordion-content textarea {
    resize: vertical;
    min-height: 110px;
}

.ltd-accordion-content input:focus,
.ltd-accordion-content textarea:focus,
.ltd-accordion-content select:focus {
    outline: none;
    border-color: #8aff00;
    box-shadow: 0 0 0 3px rgba(138, 255, 0, 0.12);
}


/* ----------------------------------------------------
   BUTTONS
---------------------------------------------------- */

.ltd-add-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.ltd-btn {
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #ddd;
    background: #fff;
    font-size: 14px;
    cursor: pointer;
    flex: 1;
    text-align: center;
    pointer-events: auto;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.08s ease;
}

.ltd-btn:hover {
    border-color: #8aff00;
    background: #f7ffe8;
}

.ltd-btn:active {
    transform: translateY(1px);
}

.ltd-tool-btn {
    padding: 9px 10px;
    border-radius: 6px;
    border: 1px solid #ddd;
    background: #fff;
    font-size: 13px;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.ltd-tool-btn:hover {
    border-color: #8aff00;
    background: #f7ffe8;
}

.ltd-danger-btn:hover {
    border-color: #d92d20;
    background: #fff5f4;
}

.ltd-tool-btn:disabled,
.ltd-btn:disabled,
.ltd-mobile-icon-btn:disabled,
input[type="range"]:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}


/* ----------------------------------------------------
   TEXT CONTROLS
---------------------------------------------------- */

.ltd-text-controls {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}


/* ----------------------------------------------------
   SUBMIT SECTION
---------------------------------------------------- */

#ltd-submit {
    margin-top: 12px;
    width: 100%;
}

#ltd-submit[disabled] {
    opacity: 0.7;
    cursor: not-allowed;
}

#ltd-submit-status {
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    background: #fff;
    border: 1px solid #e8e8e8;
}


/* ----------------------------------------------------
   PREVIEW COLUMN
---------------------------------------------------- */

.ltd-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ltd-shirt {
    width: 100%;
    max-width: 420px;
    position: relative;
}

#ltd-base {
    width: 100%;
    display: block;
}

#ltd-layers {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.ltd-note {
    margin-top: 12px;
    font-size: 13px;
    opacity: 0.7;
    text-align: center;
}


/* ----------------------------------------------------
   MOBILE SELECTED LAYER EDITOR
---------------------------------------------------- */

.ltd-mobile-layer-editor {
    display: none;
    width: 100%;
    max-width: 420px;
    margin-top: 14px;
}

.ltd-mobile-layer-card {
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 14px;
    box-sizing: border-box;
}

.ltd-mobile-layer-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.ltd-mobile-layer-kicker {
    font-size: 12px;
    opacity: 0.7;
    margin-bottom: 2px;
}

.ltd-mobile-layer-name {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
}

.ltd-mobile-icon-btn {
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}

.ltd-mobile-layer-main {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ltd-mobile-layer-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.ltd-mobile-more-options {
    display: none;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e8e8e8;
}

.ltd-mobile-more-options.open {
    display: block;
}


/* ----------------------------------------------------
   LAYER ELEMENTS
---------------------------------------------------- */

.ltd-layer {
    position: absolute;
    cursor: move;
    user-select: none;
    -webkit-user-select: none;
    text-align: center;
    font-size: 28px;
    line-height: 1.2;
    transform-origin: center center;
    will-change: transform;
    touch-action: none;
}

.ltd-art-layer {
    width: 180px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    touch-action: none;
}

.ltd-art-layer img {
    display: block;
    width: 100%;
    height: auto;
    pointer-events: none;
    background: transparent;
}

.ltd-text-layer {
    white-space: pre-line;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    box-sizing: border-box;
}

.ltd-text-content {
    display: inline-block;
    pointer-events: none;
    white-space: pre-line;
    line-height: 1.2;
}

.ltd-layer.dragging {
    opacity: 0.85;
}

.ltd-layer-active {
    outline: 2px solid #8aff00;
    outline-offset: 4px;
}

.ltd-delete-layer {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #ffffff;
    border: 1px solid #ccc;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 14px;
    cursor: pointer;
    line-height: 18px;
    text-align: center;
    padding: 0;
}

.ltd-delete-layer:hover {
    background: #f3f3f3;
}


/* ----------------------------------------------------
   DRAG / TOUCH FIXES
---------------------------------------------------- */

#ltd-shirt-wrapper,
#ltd-layers {
    touch-action: none;
}


/* ----------------------------------------------------
   ROTATE HANDLE
---------------------------------------------------- */

.ltd-rotate-handle {
    position: absolute;
    top: -28px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    background: #8aff00;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 0 6px rgba(138, 255, 0, 0.6);
    cursor: grab;
    z-index: 10;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ltd-rotate-handle:hover {
    transform: translateX(-50%) scale(1.15);
    box-shadow: 0 0 10px rgba(138, 255, 0, 0.9);
}

.ltd-rotate-handle::before {
    content: "";
    position: absolute;
    top: 16px;
    left: 50%;
    width: 2px;
    height: 14px;
    background: rgba(0, 0, 0, 0.15);
    transform: translateX(-50%);
}


/* ----------------------------------------------------
   LAYER PANEL
---------------------------------------------------- */

#ltd-layer-panel {
    background: #fafafa;
    border: 1px solid #e5e5e5;
    padding: 16px;
    border-radius: 8px;
    max-width: 260px;
    font-family: inherit;
    position: sticky;
    top: 20px;
}

#ltd-layer-panel h3 {
    margin-top: 0;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

#ltd-layer-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ltd-layer-item {
    background: #fff;
    border: 1px solid #ddd;
    padding: 8px 10px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.ltd-layer-item:hover {
    background: #f3f3f3;
}

.ltd-layer-item.active {
    border-color: #8aff00;
    background: #fafff3;
}

.ltd-layer-name {
    font-size: 14px;
}

.ltd-layer-controls {
    display: flex;
    gap: 6px;
}

.ltd-layer-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    color: #444;
}

.ltd-layer-btn:hover {
    color: #000;
}


/* ----------------------------------------------------
   RIGHT COLUMN TOOLS
---------------------------------------------------- */

.ltd-layer-tools-divider {
    height: 1px;
    background: #8aff00;
    opacity: 0.7;
    margin: 14px 10px;
    border-radius: 2px;
}

.ltd-layer-tools {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}


/* ----------------------------------------------------
   LINKS / EXTRA LAYOUT
---------------------------------------------------- */

.ltd-small-note a {
    color: #000;
    text-decoration: underline;
    text-decoration-color: #8aff00;
    text-underline-offset: 3px;
}

.ltd-small-note a:hover {
    opacity: 0.8;
}

.ltd-wrap {
    max-width: 1100px;
    margin: 0 auto;
}

.ltd-intro,
.ltd-small-note {
    max-width: 600px;
}

.ltd-intro-block {
    max-width: 720px;
    margin-bottom: 40px;
}

@media (min-width: 900px) {
    .ltd-intro-block {
        margin-left: 360px;
    }
}

.ltd-intro,
.ltd-small-note {
    max-width: 520px;
    line-height: 1.6;
}


/* ----------------------------------------------------
   CUSTOM FONTS
---------------------------------------------------- */

@font-face {
    font-family: 'DiarioDeAndy';
    src: url('./fonts/DiarioDeAndy-L3ADy.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Super Malibu';
    src: url('./fonts/super-malibu.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}


/* ----------------------------------------------------
   RESPONSIVE
---------------------------------------------------- */

@media (max-width: 900px) {
    .ltd-grid {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }

    #ltd-layer-panel {
        grid-column: span 2;
        max-width: 100%;
    }
}

@media (max-width: 700px) {
    .ltd-grid {
        display: block;
    }

    .ltd-preview,
    .ltd-controls,
    #ltd-layer-panel {
        width: 100%;
        max-width: 100%;
    }

    .ltd-preview {
        position: relative;
        top: auto;
        z-index: auto;
        margin-bottom: 20px;
        background: #f5f5f5;
        padding: 10px 10px 14px;
        border-radius: 14px;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    }

    .ltd-controls {
        position: relative;
        z-index: auto;
        max-height: none;
        overflow: visible;
        padding-right: 0;
        margin-bottom: 20px;
        gap: 12px;
    }

.ltd-mobile-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 8px;
    }

    .ltd-mobile-tab {
        border: 1px solid #ddd;
        background: #fff;
        border-radius: 10px;
        padding: 12px 10px;
        font-size: 13px;
        font-weight: 600;
        line-height: 1.2;
        text-align: center;
        cursor: pointer;
        color: #000;
    }

    .ltd-mobile-tab.active {
        border-color: #8aff00;
        background: #f7ffe8;
    }

    .ltd-accordion {
        border-bottom: none;
        padding-bottom: 0;
        margin-bottom: 0;
    }

   .ltd-accordion-header {
    display: none !important;
    }

    .ltd-accordion-content {
        display: none;
        max-height: none;
        opacity: 1;
        pointer-events: auto;
        overflow: visible;
        padding: 14px;
        background: rgba(138, 255, 0, 0.05);
        border-left: 3px solid #8aff00;
        border-radius: 10px;
    }

    .ltd-accordion-content.open {
        display: block;
        max-height: none;
        overflow: visible;
        opacity: 1;
        pointer-events: auto;
        padding: 14px;
    }

    .ltd-mobile-layer-editor {
        display: block;
    }

    #ltd-layer-panel {
        display: none;
    }

    .ltd-shirt {
        max-width: 320px;
        width: 100%;
        margin: 0 auto;
    }

    #ltd-base {
        border-radius: 12px;
    }

    .ltd-note {
        margin-top: 10px;
        padding: 0 8px;
        font-size: 12px;
        text-align: center;
    }

    .ltd-btn,
    .ltd-tool-btn,
    .ltd-layer-btn,
    .ltd-delete-layer,
    .ltd-mobile-icon-btn,
    .ltd-wrap button,
    .ltd-wrap input[type="button"],
    .ltd-wrap input[type="submit"] {
        color: #000 !important;
        text-decoration: none !important;
    }

    .ltd-btn,
    .ltd-tool-btn {
        min-height: 44px;
        padding: 12px 14px;
        font-size: 15px;
    }

    .ltd-text-controls {
        gap: 12px;
    }

    .ltd-art-layer {
        width: 120px;
    }

    .ltd-small-note a {
        color: #000 !important;
        text-decoration: underline !important;
        text-decoration-color: #8aff00 !important;
        text-underline-offset: 3px;
    }

    .ltd-small-note a:hover {
        color: #000 !important;
        text-decoration-color: #6fe600 !important;
    }
}