/* Legacy watercolor configurator (/customize) only. Split from
   configurator.css (Task 14); rules here are not used by the three
   modern editors, so this file is not linked there. A handful of
   selectors below (.placement-icon*, .placement-options, .form-textarea)
   were unreferenced by any of the four editor templates or their JS at
   audit time; kept as-is (no visual-change constraint), flagged for a
   future cleanup pass. The .swatch-* fills were NOT unreferenced (the
   templates build them as swatch-{{ color }}); they now live in
   editor-shared.css. */

/* Breed Search Dropdown */
.breed-search-wrap {
    position: relative;
}

.breed-search-input {
    cursor: text;
    width: 100%;
}

.breed-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg);
    border: 2px solid var(--color-border);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    max-height: 240px;
    overflow-y: auto;
    z-index: 20;
    box-shadow: var(--shadow-md);
}

.breed-search-dropdown.hidden {
    display: none;
}

.breed-search-item {
    padding: var(--spacing-sm) var(--spacing-md);
    cursor: pointer;
    font-size: 0.9375rem;
    transition: background var(--transition-fast);
}

.breed-search-item:hover,
.breed-search-item.active {
    background: var(--color-bg-alt);
}

.breed-search-item.hidden {
    display: none;
}

/* Breed Variant Gallery */
.breed-variants {
    margin-top: var(--spacing-md);
}

.breed-variants.hidden {
    display: none;
}

.breed-variants-scroll {
    display: flex;
    gap: var(--spacing-sm);
    overflow-x: auto;
    padding-bottom: var(--spacing-sm);
    -webkit-overflow-scrolling: touch;
}

.breed-variants-scroll::-webkit-scrollbar {
    height: 4px;
}

.breed-variants-scroll::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 2px;
}

.breed-variant-img {
    width: 100px;
    height: 125px;
    object-fit: cover;
    border-radius: var(--radius-md);
    flex-shrink: 0;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 2px solid var(--color-border);
}

.breed-variant-img:hover,
.breed-variant-img.active {
    border-color: var(--color-primary);
    transform: scale(1.05);
}

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

.form-hint {
    font-size: 0.9375rem;
    color: var(--color-text-muted);
}

.form-textarea {
    resize: vertical;
    min-height: 70px;
}

/* Tap targets customers hit repeatedly (comparing colours, trying fonts,
   stepping quantities). Without this, two quick taps on iOS are read as
   double-tap-to-zoom and the whole page zooms. Page-level pinch-zoom is
   deliberately left alone so anyone who needs to magnify still can. */
.placement-option,
.font-option {
    touch-action: manipulation;
}

.swatch-recommend {
    font-size: 0.65rem;
    color: #f5a623;
    font-weight: 600;
    display: none;
}

.swatch-recommend.visible {
    display: block;
}

/* Text Color Swatches — Card Style */
.text-color-swatches {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: var(--spacing-sm);
}

.text-color-swatches .text-swatch {
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) var(--spacing-xs);
    background: var(--color-bg);
    gap: 2px;
}

.text-color-swatches .text-swatch.active {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
}

.swatch-stock-badge {
    font-size: 0.6rem;
    color: var(--color-text-muted);
    font-weight: 500;
    white-space: nowrap;
}

/* Garment swatches. Hexes live in SHIRTS in app/design_tokens.py, which is
   also where the mockup file names are declared, so a new colour is one edit. */
/* Shirt swatch colours (.swatch-black etc.) live in editor-shared.css: every
   editor needs them, not only this page. */

/* Placement Options */
.placement-options {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.placement-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-md);
    background: var(--color-bg-alt);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    min-width: 100px;
}

@media (hover: hover) {

    .placement-option:hover {
        border-color: var(--color-border);
    }
}

.placement-option:active {
    border-color: var(--color-border);
}

.placement-option.active {
    border-color: var(--color-primary);
    background: var(--color-bg);
}

/* Accessory Selectors */
.accessory-group {
    margin-bottom: var(--spacing-md);
}

.accessory-group-label {
    display: block;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
}

.accessory-color-wrapper {
    margin-top: var(--spacing-sm);
    overflow: hidden;
    max-height: 60px;
    transition: max-height var(--transition-base), opacity var(--transition-base), margin var(--transition-base);
    opacity: 1;
}

.accessory-color-wrapper.hidden {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
}

.accessory-color-input {
    max-width: 240px;
}

.placement-icon {
    width: 40px;
    height: 50px;
    background: var(--color-border);
    border-radius: var(--radius-sm);
    position: relative;
}

.placement-icon::after {
    content: '';
    position: absolute;
    background: var(--color-primary);
    border-radius: 2px;
}

.placement-icon-full-front::after {
    width: 20px;
    height: 24px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.placement-icon-chest::after {
    width: 10px;
    height: 10px;
    top: 12px;
    left: 8px;
}

.placement-icon-back::after {
    width: 18px;
    height: 20px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.placement-label {
    font-size: 0.875rem;
    font-weight: 500;
}

/* ============================================================================
   Mobile Preview Bar
   ============================================================================ */

.mobile-preview-bar {
    display: none;
}

@media (max-width: 767px) {

    .mobile-preview-bar {
        display: block;
        /* fixed (not sticky) so the hidden bar doesn't reserve layout space at
           the top of the page — sticky kept its box in flow and pushed the hero
           down, leaving a large empty gap below the header. */
        position: fixed;
        top: calc(56px + env(safe-area-inset-top, 0px));
        left: 0;
        right: 0;
        z-index: 90;
        background: var(--color-bg);
        border-bottom: 1px solid var(--color-border);
        box-shadow: var(--shadow-sm);
        transform: translateY(-100%);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.25s ease, opacity 0.25s ease;
    }

    .mobile-preview-bar.visible {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .mobile-preview-bar-inner {
        display: flex;
        align-items: center;
        gap: var(--spacing-sm);
        padding: var(--spacing-sm) max(var(--spacing-lg), env(safe-area-inset-left));
        padding-right: max(var(--spacing-lg), env(safe-area-inset-right));
    }

    .mobile-preview-thumb {
        width: 44px;
        height: 44px;
        object-fit: contain;
        border-radius: var(--radius-sm);
        background: var(--color-bg-alt);
        flex-shrink: 0;
    }

    .mobile-preview-label {
        flex: 1;
        font-size: 0.875rem;
        font-weight: 500;
        color: var(--color-text);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-preview-scroll-btn {
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--color-bg-alt);
        border: 1px solid var(--color-border);
        border-radius: 50%;
        cursor: pointer;
        font-size: 1.125rem;
        color: var(--color-text);
        flex-shrink: 0;
        transition: background var(--transition-fast);
    }

    .mobile-preview-scroll-btn:active {
        background: var(--color-border);
    }
}

@media (pointer: coarse) {

    .step-number {
        width: 36px;
        height: 36px;
    }

    .step-link {
        min-height: 44px;
    }

    .placement-options {
        gap: var(--spacing-md);
    }

    .placement-option {
        min-width: 110px;
        min-height: 44px;
    }

    .text-swatch {
        padding: var(--spacing-sm) var(--spacing-md);
        min-height: 44px;
    }

    .form-checkbox-label {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .form-checkbox {
        width: 20px;
        height: 20px;
    }

    /* Tap feedback */
    .text-swatch,
.placement-option,
.step-link,
.mobile-preview-scroll-btn {
        -webkit-tap-highlight-color: transparent;
    }

    .text-swatch:active {
        transform: scale(0.92);
    }

    .placement-option:active {
        transform: scale(0.96);
    }
}

/* Font Selector */
.font-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-sm);
}

.font-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: var(--spacing-sm) var(--spacing-xs);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg);
    cursor: pointer;
    transition: all var(--transition-base);
}

.font-option:hover {
    border-color: var(--color-text-muted);
}

.font-option.active {
    border-color: var(--color-primary);
    background: var(--color-bg-alt);
}

.font-option-preview {
    font-size: 1.5rem;
    line-height: 1.2;
    color: var(--color-text);
}

.font-option-name {
    font-size: 0.625rem;
    color: var(--color-text-muted);
    text-align: center;
}

@media (max-width: 480px) {

    .font-options {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Inline Preview Mirrors (mobile only) */
.inline-preview {
    display: none;
}

@media (max-width: 768px) {

    .inline-preview {
        display: block;
        margin: var(--spacing-lg) 0;
    }

    .inline-preview-img {
        width: 100%;
        height: auto;
        border-radius: var(--radius-lg);
        background: var(--color-bg-alt);
    }

    .inline-preview--zoomed {
        overflow: hidden;
        border-radius: var(--radius-lg);
    }

    .inline-preview--zoomed .inline-preview-img {
        transform: scale(1.6);
        transform-origin: center 38%;
    }
}
