/**
 * Woo Size Tables Manager - Frontend Styles
 * Przycisk + Modal/Lightbox
 */

/* ==========================================
   PRZYCISK
   ========================================== */
.wst-size-table-wrap {
    margin: 12px 0;
    width: 100%;
}

.wst-size-table-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #10b98120;
    border: 1px solid var(--color-button);
    color: var(--color-white);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wst-size-table-btn:hover,
.wst-size-table-btn:focus {
    background: var(--color-button);
}

.wst-size-table-btn:active {
    transform: translateY(0);
}

.wst-size-table-icon {
    font-size: 18px;
    line-height: 1;
}

.wst-size-table-label {
    line-height: 1.2;
}

/* ==========================================
   MODAL
   ========================================== */
.wst-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.wst-modal.wst-modal-active {
    display: flex;
    animation: wstFadeIn 0.2s ease;
}

@keyframes wstFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.wst-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    cursor: pointer;
}

.wst-modal-content {
    position: relative;
    background: #fff;
    border-radius: 8px;
    max-width: 1100px;
    max-height: 90vh;
    width: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: wstSlideUp 0.3s ease;
}

@keyframes wstSlideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.wst-modal-title {
    margin: 0;
    padding: 18px 50px 18px 22px;
    font-size: 18px;
    font-weight: 600;
    color: #1d2327;
    border-bottom: 1px solid #e0e0e0;
    background: #f9f9f9;
}

.wst-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: #666;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    padding: 0;
    transition: all 0.2s;
}

.wst-modal-close:hover,
.wst-modal-close:focus {
    background: #e0e0e0;
    color: #1d2327;
    outline: none;
}

.wst-modal-body {
    flex: 1;
    overflow: auto;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    min-height: 200px;
}

.wst-modal-image {
    max-width: 100%;
    max-height: 100%;
    height: auto;
    width: auto;
    display: block;
    object-fit: contain;
}

/* Loading state */
.wst-modal-body.wst-loading::before {
    content: '';
    display: block;
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: wstSpin 0.8s linear infinite;
}

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

.wst-modal-body.wst-loading .wst-modal-image {
    display: none;
}

/* Body lock */
body.wst-modal-open {
    overflow: hidden;
}

/* ==========================================
   RESPONSYWNOŚĆ
   ========================================== */
@media (max-width: 768px) {
    .wst-modal {
        padding: 10px;
    }
    
    .wst-modal-content {
        max-height: 95vh;
    }
    
    .wst-modal-title {
        font-size: 16px;
        padding: 14px 50px 14px 18px;
    }
    
    .wst-modal-body {
        padding: 12px;
    }
    
    .wst-size-table-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 16px;
    }
}

@media (max-width: 480px) {
    .wst-size-table-btn {
        font-size: 13px;
        padding: 11px 14px;
    }
    
    .wst-size-table-icon {
        font-size: 16px;
    }
}
