/**
 * Virtual Try-On Modal styles (loaded in layout head so they apply on all pages)
 */

.try-on-btn .me-2 { margin-right: 0.35rem !important; }
@media (max-width: 576px) { .try-on-btn span { font-size: 0.875rem; } }

/* Modal container */
.tryon-modal .modal-dialog {
    max-width: 660px;
    min-height: 72vh;
    display: flex;
    align-items: center;
    margin: 0.75rem auto;
    padding: 0 0.75rem;
}
.tryon-modal .modal-content {
    border-radius: 1rem;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    border: 1px solid rgba(0,0,0,0.06);
}
.tryon-modal .modal-body {
    min-height: 380px;
    overflow-y: auto;
    flex: 1 1 auto;
    padding: 1.5rem 1.75rem;
}
.tryon-modal .modal-header {
    padding: 1rem 1.75rem 0.75rem;
    flex-shrink: 0;
}
.tryon-modal-icon {
    width: 2.25rem;
    height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(13, 110, 253, 0.12);
    color: #0d6efd;
    border-radius: 0.5rem;
    flex-shrink: 0;
}

/* Upload step */
.tryon-upload-header {
    padding-right: 0.5rem;
    margin-bottom: 1rem;
}
.tryon-upload-label {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #212529;
}
.tryon-tips-trigger {
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
    cursor: help;
    transition: opacity 0.2s, background 0.2s;
}
.tryon-tips-trigger:hover {
    opacity: 0.9;
    background: rgba(13, 110, 253, 0.18);
}
.tryon-tips-trigger i {
    font-size: 0.75rem;
}

/* Dropzone - no native file input visible */
.tryon-dropzone {
    position: relative;
    border: 2px dashed #dee2e6;
    border-radius: 0.75rem;
    padding: 1.75rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafbfc;
    overflow: hidden;
}
.tryon-dropzone:hover,
.tryon-dropzone.tryon-dragover {
    border-color: #0d6efd;
    background-color: #f0f7ff;
}

/* Hide native file input completely - no "Choose File" / "No file chosen" */
.tryon-file-input {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 100% !important;
    opacity: 0 !important;
    cursor: pointer !important;
    z-index: 2 !important;
    font-size: 0 !important;
    line-height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

.tryon-dropzone-inner {
    pointer-events: none;
}
.tryon-dropzone-icon {
    font-size: 2.25rem;
    color: #adb5bd;
    margin-bottom: 0.5rem;
    display: block;
    transition: color 0.2s;
}
.tryon-dropzone:hover .tryon-dropzone-icon {
    color: #0d6efd;
}
.tryon-dropzone-text {
    font-weight: 600;
    font-size: 0.9375rem;
    color: #212529;
    margin-bottom: 0.25rem;
}
.tryon-dropzone-hint {
    font-size: 0.8125rem;
    color: #6c757d;
}

/* Selected photo preview: remove button in a bar ABOVE the image (never on top of photo) */
.tryon-selected-preview {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    background: #fff;
    border-radius: 0.75rem;
    z-index: 3;
    padding: 0;
}
.tryon-selected-preview-bar {
    flex-shrink: 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0.5rem 0.5rem 0.25rem;
    min-height: 2.5rem;
}
.tryon-selected-img-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1rem 1rem;
    min-height: 0;
}
.tryon-selected-img {
    max-height: 180px;
    max-width: 100%;
    object-fit: contain;
    border-radius: 0.5rem;
}
.tryon-selected-remove {
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 50%;
    background: #dc3545;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
    transition: opacity 0.2s, transform 0.2s, background 0.2s;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4);
}
.tryon-selected-remove:hover {
    opacity: 1;
    transform: scale(1.08);
    background: #bb2d3b;
}
.tryon-selected-remove:focus {
    outline: 2px solid #dc3545;
    outline-offset: 2px;
}

.tryon-btn-preview {
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 1rem;
    margin-top: 1.25rem;
}

/* Result step */
.tryon-result-step-layout {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}
.tryon-result-preview-area {
    flex: 1 1 auto;
    min-height: 0;
    max-height: 46vh;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tryon-result-toolbar {
    flex: 0 0 auto;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(0,0,0,0.08);
    margin-top: 0.25rem;
}
.tryon-result-wrap {
    background: #f8f9fa;
    border-radius: 0.75rem;
    padding: 1rem;
    text-align: center;
    min-height: 180px;
    width: 100%;
}
.tryon-result-img {
    max-height: 42vh;
    width: auto;
    border-radius: 0.5rem;
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}
.tryon-result-img.tryon-fade-in {
    animation: tryonFadeIn 0.4s ease-out;
}
@keyframes tryonFadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}
.tryon-modal .modal.fade .modal-dialog {
    transition: transform 0.3s ease-out;
}
.tryon-modal.show .modal-dialog {
    transform: scale(1);
}
.tryon-modal .modal-dialog {
    transform: scale(0.95);
}
.tryon-result-adjust {
    min-height: 180px;
    max-height: 42vh;
    background: #f8f9fa;
}
.tryon-result-bg {
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
}
.tryon-result-overlay {
    display: block;
    max-width: none;
    max-height: none;
    object-fit: fill;
}
.tryon-controls-panel {
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f4fd 100%);
    border: 1px solid rgba(13, 110, 253, 0.2);
    box-shadow: 0 2px 12px rgba(13, 110, 253, 0.06);
}
.tryon-controls-title {
    font-weight: 700;
    color: #0d6efd;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}
.tryon-control-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}
.tryon-control-group {
    padding: 0.5rem 0;
}
.tryon-move-btn {
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: background-color 0.2s, color 0.2s, transform 0.15s;
    border: 1px solid rgba(13, 110, 253, 0.35);
    background: #fff;
    color: #0d6efd;
}
.tryon-move-btn:hover {
    background: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
    transform: scale(1.05);
}
.tryon-move-btn:active {
    transform: scale(0.98);
}
.tryon-size-btn {
    border-radius: 0.5rem;
    padding: 0.55rem 0.9rem;
    font-size: 0.875rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    transition: background-color 0.2s, color 0.2s, transform 0.15s;
    border: 1px solid rgba(13, 110, 253, 0.4);
    background: #fff;
    color: #0d6efd;
}
.tryon-size-btn:hover {
    background: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
    transform: scale(1.03);
}
.tryon-size-btn:active {
    transform: scale(0.98);
}

@media (max-width: 575.98px) {
    .tryon-modal .modal-dialog {
        min-height: 90vh;
        padding: 0 0.25rem;
    }
    .tryon-modal .modal-body {
        min-height: 320px;
        padding: 1.25rem 1rem;
    }
    .tryon-modal .modal-header {
        padding: 0.75rem 1rem 0.5rem;
    }
    .tryon-upload-header {
        padding-right: 0;
    }
    .tryon-result-preview-area {
        max-height: 40vh;
    }
    .tryon-result-img {
        max-height: 38vh;
    }
    .tryon-result-adjust {
        max-height: 38vh;
    }
    .tryon-dropzone {
        min-height: 180px;
        padding: 1.25rem 1rem;
    }
    .tryon-selected-img {
        max-height: 140px;
    }
    .tryon-result-actions .btn {
        width: 100%;
    }
    .tryon-controls-panel {
        padding: 0.75rem 1rem !important;
    }
    .tryon-move-btn {
        width: 2.5rem;
        height: 2.5rem;
        min-width: 2.5rem;
    }
    .tryon-size-btn {
        padding: 0.5rem 0.65rem;
        font-size: 0.8125rem;
    }
    .tryon-size-label {
        display: inline;
    }
}
@media (max-width: 380px) {
    .tryon-size-label {
        display: none;
    }
    .tryon-size-btn .me-1 {
        margin-right: 0 !important;
    }
}
