/**
 * ChefWorks Product Pair - Estilos del modal frontend
 * Base tomada del patrón .cwt-modal de chefworks-tracking-v2
 */

.cwpp-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
    overflow-y: auto;
}

.cwpp-modal[hidden] {
    display: none;
}

.cwpp-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
}

.cwpp-modal-content {
    background: #fff;
    margin: 6% auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 520px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.cwpp-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    background: none;
    border: none;
    padding: 0;
}

.cwpp-modal-close:hover {
    color: #333;
}

.cwpp-modal-title {
    margin: 0 0 12px;
    font-size: 20px;
    line-height: 1.3;
    padding-right: 24px;
    color: #1D2327;
}

.cwpp-modal-message {
    color: #555;
    margin: 0 0 16px;
}

.cwpp-modal-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #666;
    padding: 20px 0;
}

.cwpp-spinner {
    width: 18px;
    height: 18px;
    border: 3px solid #ddd;
    border-top-color: #555;
    border-radius: 50%;
    animation: cwpp-spin 0.8s linear infinite;
    display: inline-block;
}

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

.cwpp-required-product {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #f7f7f7;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 16px;
}

.cwpp-product-image {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.cwpp-product-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cwpp-product-name {
    font-weight: 600;
}

.cwpp-product-price {
    color: #333;
}

.cwpp-attribute-field {
    margin-bottom: 14px;
}

.cwpp-attribute-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}

.cwpp-attribute-field select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* Swatches de color */
.cwpp-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cwpp-swatch {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: 2px solid #d5d7db;
    cursor: pointer;
    padding: 0;
    background-clip: padding-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cwpp-swatch-text {
    width: auto;
    min-width: 42px;
    height: 32px;
    padding: 0 12px;
    background: #f4f4f5;
    color: #1D2327;
    font-size: 13px;
    line-height: 1;
}

.cwpp-swatch:hover {
    border-color: #1D2327;
}

.cwpp-swatch-selected {
    border-color: #B51E23;
    box-shadow: 0 0 0 2px rgba(181, 30, 35, 0.25);
}

.cwpp-variation-info {
    background: #f4f4f5;
    border: 1px solid #d5d7db;
    border-radius: 4px;
    padding: 10px 12px;
    margin-bottom: 14px;
    color: #1D2327;
}

.cwpp-variation-info.cwpp-out-of-stock {
    background: #fdf0f0;
    border-color: #eecccc;
    color: #a00;
}

.cwpp-modal-error {
    background: #fdf0f0;
    border: 1px solid #eecccc;
    color: #a00;
    border-radius: 4px;
    padding: 10px 12px;
    margin-bottom: 14px;
}

.cwpp-qty-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.cwpp-qty-row[hidden] {
    display: none;
}

.cwpp-qty-row label {
    font-weight: 600;
}

.cwpp-qty {
    width: 80px;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.cwpp-modal-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 6px;
}

.cwpp-btn {
    padding: 10px 18px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.2;
}

.cwpp-btn-skip {
    background: #fff;
    color: #1D2327;
    border: 1px solid #c9ccd1;
}

.cwpp-btn-skip:hover:not(:disabled) {
    background: #f4f4f5;
}

.cwpp-btn-skip:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cwpp-btn-confirm {
    background: #B51E23;
    color: #fff;
}

.cwpp-btn-confirm:hover:not(:disabled) {
    background: #991a1e;
}

.cwpp-btn-confirm:disabled {
    background: #dba1a3;
    cursor: not-allowed;
}

body.cwpp-modal-open {
    overflow: hidden;
}
