#pcon-iframe-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
#pcon-iframe-overlay.active {
    display: flex;
}
#pcon-iframe-overlay .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top-color: #333;
    border-radius: 50%;
    animation: pcon-spin 0.8s linear infinite;
}
@keyframes pcon-spin {
    to { transform: rotate(360deg); }
}

.pcon-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 20px;
}
.pcon-popup.active {
    display: flex;
}
.pcon-popup-content {
    background: #fff;
    border-radius: 8px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    position: relative;
}
.pcon-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 40px;
    height: 40px;
}
.pcon-popup-close:hover {
    color: #333;
}
.pcon-popup-header {
    text-align: center;
    padding: 30px 20px 20px;
    border-bottom: 1px solid #eee;
}
.pcon-check-icon {
    width: 60px;
    height: 60px;
    fill: #4caf50;
    margin-bottom: 10px;
}
.pcon-popup-header h3 {
    margin: 0;
    font-size: 24px;
    color: #333;
}
.pcon-popup-body {
    padding: 30px;
}
.pcon-product-item {
    display: flex;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}
.pcon-product-item img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #eee;
}
.pcon-product-details {
    flex: 1;
}
.pcon-product-details h4 {
    margin: 0 0 8px;
    font-size: 18px;
    color: #333;
}
.pcon-product-subtitle {
    font-size: 14px;
    color: #666;
    margin: 0 0 8px;
}
.pcon-product-price {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin: 8px 0;
}
.pcon-product-quantity {
    font-size: 14px;
    color: #666;
    margin: 0;
}
.pcon-cart-summary {
    text-align: center;
    margin-bottom: 30px;
}
.pcon-cart-total {
    font-size: 16px;
    color: #666;
    margin: 0 0 20px;
}
.pcon-popup-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}
.pcon-btn {
    padding: 12px 30px;
    border-radius: 4px;
    font-size: 16px;
    text-decoration: none;
    display: inline-block;
    border: 2px solid;
    cursor: pointer;
    transition: all 0.3s;
}
.pcon-btn-continue {
    background: #fff;
    color: #333;
    border-color: #ddd;
}
.pcon-btn-continue:hover {
    background: #f5f5f5;
}
.pcon-btn-primary {
    background: #333;
    color: #fff;
    border-color: #333;
}
.pcon-btn-primary:hover {
    background: #000;
    border-color: #000;
}
.pcon-related-products {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}
.pcon-related-products h4 {
    margin: 0 0 20px;
    font-size: 20px;
    color: #333;
}
.pcon-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
}
.pcon-related-item {
    text-align: center;
}
.pcon-related-item a {
    text-decoration: none;
    color: #333;
    display: block;
}
.pcon-related-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #eee;
    margin-bottom: 10px;
}
.pcon-related-item h5 {
    font-size: 14px;
    margin: 0 0 5px;
    height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.pcon-related-price {
    font-size: 14px;
    font-weight: bold;
    color: #666;
}

@media (max-width: 768px) {
    .pcon-popup-content {
        margin: 20px;
    }
    .pcon-product-item {
        flex-direction: column;
        text-align: center;
    }
    .pcon-product-item img {
        margin: 0 auto;
    }
    .pcon-popup-actions {
        flex-direction: column;
    }
    .pcon-btn {
        width: 100%;
    }
    .pcon-related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.pcon-cart-details {
    font-size: 14px;
    line-height: 1.6;
}
.pcon-cart-selection,
.pcon-cart-options,
.pcon-cart-reference,
.pcon-cart-man-code {
    margin-bottom: 8px;
}
.pcon-cart-selection strong,
.pcon-cart-options > strong {
    color: #333;
    font-weight: 600;
}
.pcon-options-list {
    margin-left: 15px;
    margin-top: 5px;
}
.pcon-option-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    gap: 10px;
}
.pcon-option-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border: 1px solid #ddd;
    border-radius: 4px;
    flex-shrink: 0;
}
.pcon-option-name {
    flex: 1;
}
.pcon-option-price {
    font-weight: bold;
    color: #2c3e50;
}
.pcon-price-unavailable {
    font-style: italic;
    color: #999;
}

/* Quote table - pCon item layout */
.pcon-quote-details {
    font-size: 13px;
    line-height: 1.6;
    margin-top: 4px;
}
.pcon-quote-subtitle {
    font-size: 11px;
    color: #999;
    margin-bottom: 6px;
    font-style: italic;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
details.pcon-quote-config {
    margin-top: 6px;
}
details.pcon-quote-config > summary {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: #555;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    list-style: none;
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 3px;
}
details.pcon-quote-config > summary::-webkit-details-marker {
    display: none;
}
details.pcon-quote-config > summary::after {
    content: '▾';
    font-size: 10px;
    display: inline-block;
    transition: transform 0.2s ease;
}
details.pcon-quote-config[open] > summary::after {
    transform: rotate(180deg);
}
details.pcon-quote-config > summary:hover {
    background: #333;
}
.pcon-config-line {
    font-size: 12px;
    color: #555;
    margin-bottom: 2px;
}
.pcon-config-line .select-label {
    color: #888;
    font-weight: 500;
}
/* Suppress the orphan colon rendered by YITH for empty item_data keys (YITH uses <li><strong>key:</strong> value</li>) */
.product-name li:has(.pcon-quote-details) > strong {
    display: none;
}
/* Remove YITH's default list indent/bullets on our pCon item */
.product-name ul:has(.pcon-quote-details) {
    margin-left: 0 !important;
    padding-left: 0;
    list-style: none;
}