/* Nacify VTON - Popup Modal Styles */

/* ===== POPUP MODAL ===== */
#nvs-vton-popup {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#nvs-vton-popup.active {
    opacity: 1;
    pointer-events: all;
}

#nvs-vton-popup.active .nvs-popup-panel {
    transform: scale(1);
}

.nvs-popup-backdrop {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(6px);
}

.nvs-popup-panel {
    position: relative;
    background: #FFFFFF;
    border-radius: 20px;
    width: 800px;
    max-width: 95vw;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.4);
    transform: scale(0.92);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nvs-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
    color: #FFFFFF;
    flex-shrink: 0;
}

.nvs-popup-header h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.nvs-popup-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.2);
    color: #FFFFFF;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    line-height: 1;
}

.nvs-popup-close:hover {
    background: rgba(255,255,255,0.3);
}

.nvs-popup-body {
    display: flex;
    flex-direction: row;
    overflow: hidden;
    flex: 1;
}

.nvs-popup-canvas-area {
    flex: 1;
    background: #F5F5F5;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    min-height: 400px;
}

.nvs-popup-canvas-wrap {
    position: relative;
    width: 100%;
    max-width: 400px;
}

#nvs-popup-canvas {
    width: 100%;
    height: auto;
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.nvs-popup-skeleton {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: #F5F5F5;
}

.nvs-popup-skeleton.active {
    display: flex;
}

.nvs-skeleton-canvas {
    width: 80%;
    height: 80%;
    background: linear-gradient(90deg, #E5E5E5 25%, #D4D4D4 50%, #E5E5E5 75%);
    background-size: 200% 100%;
    border-radius: 12px;
    animation: nvs-shimmer 1.5s infinite;
}

@keyframes nvs-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.nvs-popup-result {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.nvs-popup-result img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.nvs-popup-controls {
    width: 340px;
    padding: 24px;
    background: #FFFFFF;
    border-left: 1px solid #E5E5E5;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.nvs-popup-label {
    font-size: 14px;
    font-weight: 700;
    color: #1F1F1F;
    margin: 0;
}

.nvs-popup-sublabel {
    font-size: 12px;
    color: #737373;
    margin: -12px 0 0 0;
    padding: 8px 12px;
    background: #F5F5F5;
    border-radius: 8px;
    border-left: 3px solid #DC2626;
}

/* ===== MANNEQUIN GRID ===== */
.nvs-mannequin-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.nvs-mannequin-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    border: 2px solid #E5E5E5;
    border-radius: 12px;
    background: #FFFFFF;
    cursor: pointer;
    transition: all 0.2s;
}

.nvs-mannequin-card:hover {
    border-color: #A3A3A3;
    transform: translateY(-2px);
}

.nvs-mannequin-card.active {
    border-color: #DC2626;
    background: #FEF2F2;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.1);
}

.nvs-mannequin-img {
    width: 64px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nvs-mannequin-img svg {
    width: 100%;
    height: 100%;
}

.nvs-mannequin-custom svg {
    width: 36px;
    height: 36px;
}

.nvs-mannequin-card span {
    font-size: 12px;
    font-weight: 600;
    color: #404040;
}

.nvs-mannequin-card.active span {
    color: #DC2626;
}

/* ===== BUTTONS ===== */
.nvs-btn-primary {
    width: 100%;
    padding: 14px 20px;
    background: #DC2626;
    color: #FFFFFF;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.nvs-btn-primary:hover {
    background: #B91C1C;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

.nvs-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ===== STICKY MOBILE TRY-ON ===== */
#nvs-sticky-tryon-mobile {
    display: none;
    position: fixed;
    bottom: 80px;
    left: 16px;
    z-index: 99997;
}

.nvs-sticky-tryon-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #A3A3A3;
    color: #FFFFFF;
    border: none;
    border-radius: 28px;
    font-size: 14px;
    font-weight: 600;
    cursor: not-allowed;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    transition: all 0.3s;
    white-space: nowrap;
    opacity: 0.7;
}

.nvs-sticky-tryon-btn.active {
    background: #DC2626;
    cursor: pointer;
    opacity: 1;
}

/* ===== PRODUCT PAGE TRIGGER ===== */
#nvs-vton-product-trigger {
    margin: 20px 0;
    text-align: center;
}

.nvs-vton-btn {
    padding: 14px 32px;
    background: #A3A3A3;
    color: #FFFFFF;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: not-allowed;
    transition: all 0.3s;
    opacity: 0.7;
}

.nvs-vton-btn.active {
    background: #DC2626;
    cursor: pointer;
    opacity: 1;
}

/* ===== WARDROBE ===== */
.nvs-wardrobe-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.nvs-wardrobe-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.nvs-wardrobe-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1F1F1F;
    margin: 0;
}

.nvs-wardrobe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.nvs-wardrobe-card {
    background: #FFFFFF;
    border: 1px solid #E5E5E5;
    border-radius: 16px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}

.nvs-wardrobe-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.nvs-wardrobe-image {
    aspect-ratio: 3/4;
    background: #F5F5F5;
    overflow: hidden;
}

.nvs-wardrobe-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.nvs-wardrobe-meta {
    padding: 14px 16px;
}

.nvs-wardrobe-meta h4 {
    font-size: 15px;
    font-weight: 600;
    color: #1F1F1F;
    margin: 0 0 6px 0;
    line-height: 1.3;
}

.nvs-wardrobe-size,
.nvs-wardrobe-price {
    font-size: 13px;
    color: #737373;
}

.nvs-wardrobe-actions {
    display: flex;
    gap: 8px;
    padding: 0 16px 16px;
}

.nvs-bundle-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #FFFFFF;
    border-top: 1px solid #E5E5E5;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
}

.nvs-bundle-bar span {
    font-size: 15px;
    font-weight: 600;
    color: #1F1F1F;
}

.nvs-bundle-bar .nvs-btn-primary { width: auto; padding: 12px 28px; }

.nvs-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px;
    color: #A3A3A3;
    font-size: 15px;
}

.nvs-error {
    color: #DC2626;
    padding: 16px;
    background: #FEF2F2;
    border-radius: 10px;
    font-size: 14px;
}

/* ===== MOBILE POPUP (Sheet Style) ===== */
@media (max-width: 768px) {
    #nvs-vton-popup {
        padding: 0;
        align-items: flex-end;
    }
    .nvs-popup-panel {
        width: 100%;
        max-width: 100%;
        max-height: 92vh;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
    }
    #nvs-vton-popup.active .nvs-popup-panel {
        transform: translateY(0);
    }
    .nvs-popup-body {
        flex-direction: column;
    }
    .nvs-popup-canvas-area {
        min-height: 280px;
        padding: 16px;
    }
    .nvs-popup-controls {
        width: 100%;
        border-left: none;
        border-top: 1px solid #E5E5E5;
        padding: 16px;
        max-height: 45vh;
    }
    .nvs-mannequin-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .nvs-mannequin-img {
        width: 48px;
        height: 60px;
    }
}

@media (max-width: 640px) {
    #nvs-sticky-tryon-mobile { display: block; }
    .nvs-wardrobe-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .nvs-wardrobe-header h2 {
        font-size: 20px;
    }
    .nvs-wardrobe-container {
        padding: 16px;
        padding-bottom: 100px;
    }
    .nvs-bundle-bar {
        padding: 12px 16px;
        flex-direction: column;
        gap: 10px;
    }
    .nvs-bundle-bar .nvs-btn-primary { width: 100%; }
    #nvs-vton-product-trigger { display: none; }
}

@media (max-width: 380px) {
    .nvs-mannequin-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .nvs-popup-canvas-area {
        min-height: 240px;
    }
    #nvs-sticky-tryon-mobile {
        left: 12px;
        bottom: 76px;
    }
    .nvs-sticky-tryon-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    .nvs-wardrobe-grid {
        grid-template-columns: 1fr;
    }
}
