.partecipant-fields-container h3 {
    margin-bottom: 20px;
}

.partecipant-fields {
    display: grid;
    gap: 20px;
}

.partecipant-group {
    border: 1px solid #e0e0e0;
    padding: 20px;
    border-radius: 4px;
    background: #f9f9f9;
}

.partecipant-group legend {
    font-weight: 600;
    padding: 0 10px;
}

.partecipant-group p {
    margin: 15px 0;
    display: grid;
    grid-template-columns: minmax(100px, 150px) 1fr;
    grid-template-rows: auto auto;
    gap: 5px 10px;
    align-items: center;
}

.partecipant-group label {
    grid-row: 1;
}

.partecipant-group input {
    grid-row: 1;
}

.error-message {
    grid-column: 2;
    grid-row: 2;
}

.partecipant-group input,
.partecipant-group select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 100%;
}

.partecipant-group input:invalid {
    border-color: #ddd;
}

.error-message {
    display: none;
    color: #ff4444;
    font-size: 0.8em;
    margin-top: 5px;
}

.partecipant-group p {
    margin-bottom: 5px;
}

.partecipant-fields-container {
    position: relative;
    padding-bottom: 0;
    margin-bottom: 20px;
    width: 100%;
}

.partecipant-fields-container .quantity {
    margin-bottom: 15px;
}

/* Show quantity buttons */
.quantity .quantity-change {
    display: inline-block !important;
}

/* Style add to cart button */
.quantity .single_add_to_cart_button {
    position: static;
    width: 100%;
    margin-top: 5px;
    padding-top: 5px;
    display: block;
}

/* Edit partecipant styles */
.product-partecipant-actions {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}

.edit-partecipant, .edit-cart-partecipant, 
.edit-all-partecipants, .reset-partecipants {
    background: #2271b1;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
}

.edit-partecipant:hover, .edit-cart-partecipant:hover,
.edit-all-partecipants:hover, .reset-partecipants:hover {
    background: #135e96;
}

.reset-partecipants {
    background: #f44336;
}

.reset-partecipants:hover {
    background: #d32f2f;
}

.edit-all-partecipants-form {
    padding: 15px;
    border: 1px solid #ddd;
    background: #f9f9f9;
    border-radius: 4px;
    margin-bottom: 15px;
}

.partecipant-edit-group {
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-bottom: 15px;
    background: white;
}

.partecipant-edit-group p {
    margin: 15px 0;
    display: grid;
    grid-template-columns: minmax(100px, 150px) 1fr;
    gap: 10px;
    align-items: center;
}

.partecipant-edit-group input,
.partecipant-edit-group select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 100%;
}

.edit-partecipant-form {
    padding: 15px;
    border: 1px solid #ddd;
    background: #f9f9f9;
    border-radius: 4px;
    margin-bottom: 15px;
}

.edit-partecipant-form p {
    margin: 15px 0;
}

.edit-partecipant-form input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 100%;
}

.save-partecipant, .cancel-edit {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 10px;
}

.save-partecipant {
    background: #4CAF50;
    color: white;
}

.save-partecipant:hover {
    background: #3e8e41;
}

.cancel-edit {
    background: #f44336;
    color: white;
}

.cancel-edit:hover {
    background: #d32f2f;
}

.partecipants-details {
    margin-top: 10px;
}

.partecipant-detail {
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-bottom: 10px;
    background: white;
}

/* Checkbox group styling */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 5px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: auto !important;
    margin: 0;
}

/* Conditional field styling */
.commercialisti-text-field,
.consulenti-text-field,
.altro-text-field {
    background: #f5f5f5;
    padding: 10px;
    border-radius: 4px;
    border-left: 3px solid #2271b1;
}

.commercialisti-text-field label,
.consulenti-text-field label,
.altro-text-field label {
    font-weight: 600;
    margin-bottom: 5px;
    display: block;
}

.commercialisti-text-field input,
.consulenti-text-field input,
.altro-text-field input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-top: 5px;
}


.woocommerce-checkout dl.variation,
.woocommerce-cart dl.variation {
    display: none;
}

/* Course quantity tooltip styles */
.course-product-quantity {
    display: flex;
    align-items: center;
}

.course-quantity-info {
    position: relative;
    margin-left: 5px;
    cursor: help;
}

.course-quantity-info .dashicons {
    color: #999;
    font-size: 16px;
    width: auto;
    height: auto;
}

.course-quantity-info .tooltip-text {
    visibility: hidden;
    position: absolute;
    background: #333;
    color: #fff;
    padding: 8px;
    border-radius: 4px;
    width: 200px;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    font-size: 12px;
    line-height: 1.4;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.course-quantity-info:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.course-quantity-info .tooltip-text::after {
    content: "";
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: transparent #333 transparent transparent;
}


/* Add to cart fix */
.woocommerce-variation-add-to-cart {
    flex-wrap: wrap;
}
.woocommerce-variation-add-to-cart .quantity {
    width: 100% !important;
}

/* Quantity tooltip styles */
.quantity-tooltip-info {
    background: #f0f6fc;
    border-left: 3px solid #2271b1;
    padding: 10px 15px;
    margin-bottom: 15px;
    border-radius: 4px;
    font-size: 14px;
    color: #1d2327;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quantity-tooltip-info .tooltip-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.quantity-tooltip-info .tooltip-text {
    font-weight: 500;
    line-height: 1.4;
}

/* Hide participant details in small cart overlay */
.mfn-ch-content .variation dt.variation-Nomipartecipanti,
.mfn-ch-content .variation dd.variation-Nomipartecipanti,
.mfn-ch-content .variation dt.variation-Qualifica,
.mfn-ch-content .variation dd.variation-Qualifica,
.mfn-ch-content .variation dt.variation-Province,
.mfn-ch-content .variation dd.variation-Province,
.mfn-ch-content .variation dt.variation-GestioneCorso,
.mfn-ch-content .variation dd.variation-GestioneCorso {
    display: none !important;
}

/* Responsive design for participant forms */
@media (max-width: 768px) {
    .partecipant-group p {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: 5px;
    }
    
    .partecipant-group label {
        grid-row: 1;
        grid-column: 1;
        font-weight: 600;
    }
    
    .partecipant-group input {
        grid-row: 2;
        grid-column: 1;
        width: 100%;
    }
    
    .error-message {
        grid-column: 1;
        grid-row: 3;
    }
    
    .partecipant-edit-group p {
        grid-template-columns: 1fr;
        gap: 5px;
    }
    
    .product-partecipant-actions {
        flex-direction: column;
    }
}

/* CPC overlay notice modal */
.cpc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 100000; /* above theme overlays */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.cpc-modal {
    background: #fff;
    width: 100%;
    max-width: 680px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    overflow: hidden;
}

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

.cpc-modal-title {
    font-weight: 600;
    margin: 0;
    font-size: 16px;
}

.cpc-modal-close {
    background: transparent;
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.cpc-modal-body {
    padding: 16px;
}

.cpc-modal .woocommerce-error {
    margin: 0;
}
