/**
 * DS WooCommerce Smart Quotes - Modal Styles
 * 
 * @package Dsantos\WooSmartQuotes
 * @since 1.0.0
 */

/* ==========================================================================
   Overlay do Modal
   ========================================================================== */

.wsq-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.wsq-modal.wsq-modal--open {
    opacity: 1;
    visibility: visible;
}

.wsq-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

/* ==========================================================================
   Conteúdo do Modal
   ========================================================================== */

.wsq-modal-content {
    position: relative;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.wsq-modal.wsq-modal--open .wsq-modal-content {
    transform: translateY(0);
}

/* ==========================================================================
   Header do Modal
   ========================================================================== */

.wsq-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
}

.wsq-modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.wsq-modal-close {
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.wsq-modal-close:hover {
    color: #333;
    background: #f5f5f5;
}

/* ==========================================================================
   Body do Modal
   ========================================================================== */

.wsq-modal-body {
    padding: 24px;
}

/* Informações do Produto */
.wsq-product-info {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 6px;
    margin-bottom: 24px;
}

.wsq-product-info img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.wsq-product-info__details {
    flex: 1;
}

.wsq-product-info__name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.wsq-product-info__price {
    font-size: 14px;
    color: #666;
}

/* ==========================================================================
   Footer do Modal
   ========================================================================== */

.wsq-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #eee;
    background: #fafafa;
    border-radius: 0 0 8px 8px;
}

.wsq-modal-footer .wsq-btn {
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wsq-btn--secondary {
    background: #fff;
    border: 1px solid #ddd;
    color: #666;
}

.wsq-btn--secondary:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.wsq-btn--primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: #fff;
}

.wsq-btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.wsq-btn--primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ==========================================================================
   Estados do Modal
   ========================================================================== */

/* Loading */
.wsq-modal--loading .wsq-modal-body {
    opacity: 0.6;
    pointer-events: none;
}

/* Success */
.wsq-modal--success .wsq-modal-body {
    text-align: center;
    padding: 40px 24px;
}

.wsq-success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    background: #d4edda;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #28a745;
    font-size: 32px;
}

.wsq-success-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.wsq-success-message {
    color: #666;
    margin-bottom: 20px;
}

/* ==========================================================================
   Responsivo
   ========================================================================== */

@media screen and (max-width: 768px) {
    .wsq-modal-content {
        width: 95%;
        max-height: 95vh;
        margin: 10px;
    }

    .wsq-modal-header {
        padding: 16px 20px;
    }

    .wsq-modal-header h2 {
        font-size: 18px;
    }

    .wsq-modal-body {
        padding: 20px;
    }

    .wsq-modal-footer {
        flex-direction: column;
        padding: 16px 20px;
    }

    .wsq-modal-footer .wsq-btn {
        width: 100%;
        text-align: center;
    }

    .wsq-product-info {
        flex-direction: column;
        text-align: center;
    }
}

/* ==========================================================================
   Animações
   ========================================================================== */

@keyframes wsq-modal-in {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes wsq-modal-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

.wsq-modal.wsq-modal--closing {
    animation: wsq-modal-out 0.3s ease forwards;
}

.wsq-modal.wsq-modal--opening {
    animation: wsq-modal-in 0.3s ease forwards;
}