/* Estilos para as tabelas de produtos do Manus Product Tables */

/* Container principal */
.manus-product-table-wrapper {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
}

.manus-product-table {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Linha de produto */
.manus-product-row {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.manus-product-row:last-child {
    border-bottom: none;
}

.manus-product-row:hover {
    background-color: #f9f9f9;
}

/* Imagem do produto */
.manus-product-image {
    flex-shrink: 0;
    margin-right: 15px;
}

.manus-product-image img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #e1e1e1;
}

/* Informações do produto */
.manus-product-info {
    flex: 1;
    min-width: 0;
}

.manus-product-title {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.manus-product-price {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.manus-product-price .woocommerce-Price-amount {
    color: #2c5aa0;
    font-weight: 600;
}

/* Ações do produto */
.manus-product-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* Seletor de quantidade */
.manus-quantity-selector {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
}

.manus-qty-btn {
    background: #f7f7f7;
    border: none;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    color: #666;
    transition: background-color 0.2s ease;
}

.manus-qty-btn:hover {
    background: #e7e7e7;
    color: #333;
}

.manus-qty-btn:active {
    background: #ddd;
}

.manus-qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.manus-qty-input {
    border: none;
    width: 50px;
    height: 32px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    background: #fff;
    outline: none;
}

.manus-qty-input::-webkit-outer-spin-button,
.manus-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.manus-qty-input[type=number] {
    -moz-appearance: textfield;
}

/* Botões */
.manus-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    line-height: 1.2;
}

/* Botão adicionar ao carrinho */
.manus-btn-add-to-cart {
    background: #ff9500;
    color: #fff;
    border: 1px solid #ff9500;
}

.manus-btn-add-to-cart:hover {
    background: #e8860a;
    border-color: #e8860a;
    color: #fff;
}

.manus-btn-add-to-cart:active {
    background: #d17a0a;
    border-color: #d17a0a;
}

.manus-btn-add-to-cart:disabled {
    background: #ccc;
    border-color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.manus-btn-add-to-cart.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Botão ver opções */
.manus-btn-options {
    background: #ff9500;
    color: #fff;
    border: 1px solid #ff9500;
}

.manus-btn-options:hover {
    background: #e8860a;
    border-color: #e8860a;
    color: #fff;
}

.manus-btn-options:active {
    background: #d17a0a;
    border-color: #d17a0a;
}

/* Modal para produtos variáveis */
.manus-modal {
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
}

.manus-modal-content {
    position: relative;
    background-color: #fff;
    margin: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
}

.manus-modal-close {
    position: fixed;
    top: 20px;
    right: 20px;
    color: #fff;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    background: rgba(0,0,0,0.7);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border: 2px solid rgba(255,255,255,0.3);
}

.manus-modal-close:hover {
    background: rgba(0,0,0,0.9);
    border-color: rgba(255,255,255,0.5);
    transform: scale(1.1);
}

.manus-modal-body {
    width: 100%;
    height: 100%;
    position: relative;
}

.manus-modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0;
}

/* Estados de loading */
.manus-loading {
    position: relative;
    opacity: 0.7;
    pointer-events: none;
}

.manus-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ddd;
    border-top-color: #ff9500;
    border-radius: 50%;
    animation: manus-spin 1s linear infinite;
}

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

/* Feedback visual */
.manus-success-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4caf50;
    color: white;
    padding: 12px 20px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 999999;
    font-size: 14px;
    font-weight: 500;
    animation: manus-slide-in 0.3s ease;
}

.manus-error-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #f44336;
    color: white;
    padding: 12px 20px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 999999;
    font-size: 14px;
    font-weight: 500;
    animation: manus-slide-in 0.3s ease;
}

@keyframes manus-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsividade */
@media (max-width: 768px) {
    .manus-product-row {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px;
        text-align: left;
    }
    
    .manus-product-image {
        margin-right: 0;
        margin-bottom: 10px;
        align-self: center;
    }
    
    .manus-product-info {
        width: 100%;
        text-align: center;
        margin-bottom: 15px;
    }
    
    .manus-product-actions {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .manus-quantity-selector {
        order: 1;
    }
    
    .manus-add-to-cart {
        order: 2;
        flex: 1;
        min-width: 140px;
    }
    
    .manus-btn {
        min-width: 120px;
        padding: 10px 16px;
    }
    
    .manus-modal-close {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .manus-product-table-wrapper {
        margin: 15px -10px;
    }
    
    .manus-product-table {
        border-left: none;
        border-right: none;
        border-radius: 0;
    }
    
    .manus-product-row {
        padding: 12px 15px;
    }
    
    .manus-product-image img {
        width: 50px;
        height: 50px;
    }
    
    .manus-product-title {
        font-size: 15px;
    }
    
    .manus-product-price {
        font-size: 13px;
    }
    
    .manus-qty-btn {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .manus-qty-input {
        width: 40px;
        height: 28px;
        font-size: 13px;
    }
    
    .manus-btn {
        font-size: 13px;
        padding: 8px 12px;
        min-height: 32px;
    }
}

/* Compatibilidade com temas */
.manus-product-table-wrapper * {
    box-sizing: border-box;
}

.manus-product-table-wrapper .manus-btn:focus {
    outline: 2px solid #ff9500;
    outline-offset: 2px;
}

/* Melhorias de acessibilidade */
.manus-qty-btn:focus,
.manus-qty-input:focus {
    outline: 2px solid #ff9500;
    outline-offset: 1px;
}

.manus-modal-close:focus {
    outline: 2px solid #ff9500;
    outline-offset: 2px;
}

/* Estados especiais */
.manus-product-row.out-of-stock {
    opacity: 0.6;
}

.manus-product-row.out-of-stock .manus-product-title::after {
    content: " (Fora de Stock)";
    color: #999;
    font-weight: normal;
    font-size: 12px;
}

