
/* WooCommerce Grouped Options - Enhanced Interactive Styles */
.wc-grouped-options-container {
    margin: 20px 0;
    padding: 25px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    position: relative;
}

.grouped-options-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.grouped-options-header h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 24px;
    font-weight: 600;
    animation: fadeInDown 0.5s ease;
}

.selection-overview {
    margin-bottom: 15px;
    color: #666;
    font-size: 16px;
    line-height: 1.4;
}

.option-group {
    margin-bottom: 40px;
    padding: 30px;
    background: white;
    border-radius: 12px;
    border: 2px solid #dee2e6;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    position: relative;
}

.option-group:hover {
    border-color: #007cba;
    box-shadow: 0 4px 16px rgba(0, 124, 186, 0.1);
}

.option-group.group-complete {
    border-color: #28a745;
    background: linear-gradient(135deg, #f8fff9 0%, #fff 100%);
    box-shadow: 0 4px 16px rgba(40, 167, 69, 0.15);
}

.option-group.group-partial {
    border-color: #ffc107;
    background: linear-gradient(135deg, #fffdf5 0%, #fff 100%);
}

.group-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.group-title {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    line-height: 1.3;
    position: relative;
    z-index: 1;
}

.required-indicator {
    color: #dc3545;
    font-size: 20px;
    font-weight: bold;
    background: #fff5f5;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    animation: pulse 2s infinite;
}

.group-progress {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.group-status {
    font-weight: 600;
    color: #495057;
    font-size: 15px;
    min-width: 220px;
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.group-status.status-complete {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.group-status.status-partial {
    background: #fff3cd;
    color: #856404;
    border-color: #ffeaa7;
}

.progress-bar {
    flex: 1;
    height: 10px;
    background: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
    min-width: 150px;
    border: 1px solid #dee2e6;
}

.progress-fill {
    height: 100%;
    background: #007cba;
    transition: width 0.4s ease, background-color 0.3s ease;
    border-radius: 4px;
    position: relative;
}

.progress-fill::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

/* ENHANCED: Fancy feedback messages */
.group-feedback-message {
    padding: 15px 20px;
    margin: 15px 0;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    animation: slideInDown 0.4s ease;
    border: 2px solid transparent;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.group-feedback-message::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shine 1.5s ease-in-out;
}

.group-feedback-message.feedback-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border-color: #28a745;
}

.group-feedback-message.feedback-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    border-color: #ffc107;
}

.group-feedback-message.feedback-error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border-color: #dc3545;
}

.group-feedback-message.feedback-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
    border-color: #17a2b8;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.option-item {
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 0;
    transition: all 0.3s ease;
    background: #fff;
    position: relative;
    overflow: hidden;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    user-select: none;
}

.option-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 124, 186, 0.08) 0%, rgba(40, 167, 69, 0.08) 100%);
    transition: width 0.3s ease;
    z-index: 1;
}

.option-item:hover::before {
    width: 100%;
}

.option-item:hover {
    border-color: #007cba;
    box-shadow: 0 6px 20px rgba(0, 124, 186, 0.15);
    transform: translateY(-3px);
}

.option-item.selected {
    border-color: #28a745;
    background: linear-gradient(135deg, #f8fff9 0%, #fff 100%);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.2);
    animation: selectPulse 0.5s ease;
}

.option-item.selected::before {
    width: 100%;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1) 0%, rgba(40, 167, 69, 0.05) 100%);
}

.option-item.disabled {
    opacity: 0.6;
    pointer-events: none;
    filter: grayscale(0.5);
}

.option-label {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    margin: 0;
    position: relative;
    z-index: 2;
    height: 100%;
    padding: 20px;
}

.option-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.checkmark {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 28px;
    height: 28px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 3;
}

.checkmark::after {
    content: "✓";
    color: white;
    font-weight: bold;
    font-size: 16px;
    transform: scale(0);
    transition: transform 0.2s ease;
}

.option-item.selected .checkmark {
    background: #28a745;
    border-color: #28a745;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
    animation: checkmarkBounce 0.5s ease;
}

.option-item.selected .checkmark::after {
    transform: scale(1);
}

.option-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-right: 50px;
    margin-top: 0;
    flex: 1;
}

.option-name {
    display: block;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0;
    font-size: 17px;
    line-height: 1.3;
    word-wrap: break-word;
}

.option-price {
    display: block;
    color: #007cba;
    font-weight: 700;
    margin-bottom: 0;
    font-size: 15px;
    background: #f0f8ff;
    padding: 4px 8px;
    border-radius: 4px;
    align-self: flex-start;
    animation: priceGlow 2s infinite alternate;
}

.option-description {
    display: block;
    color: #6c757d;
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 0;
    font-style: italic;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    align-self: stretch;
    transition: all 0.3s ease;
}

.quantity-controls.active {
    background: #e3f2fd;
    border-color: #2196f3;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.2);
}

.quantity-controls label {
    font-weight: 600;
    color: #495057;
    margin: 0;
    font-size: 14px;
}

.qty-controls {
    display: flex;
    align-items: center;
    gap: 0;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    overflow: hidden;
    background: white;
}

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

.qty-btn:hover:not(:disabled) {
    background: #007cba;
    color: white;
    transform: scale(1.1);
}

.qty-btn:disabled {
    background: #e9ecef;
    color: #adb5bd;
    cursor: not-allowed;
}

.option-quantity {
    width: 60px;
    height: 36px;
    text-align: center;
    border: none;
    border-left: 1px solid #dee2e6;
    border-right: 1px solid #dee2e6;
    font-weight: 600;
    background: white;
    color: #495057;
    font-size: 14px;
}

.qty-help-text {
    font-size: 12px;
    color: #6c757d;
    font-weight: normal;
    flex: 1;
    text-align: right;
    transition: all 0.3s ease;
}

.grouped-options-summary {
    background: white;
    padding: 30px;
    border-radius: 12px;
    border: 2px solid #007cba;
    text-align: center;
    margin-top: 30px;
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.1);
    position: relative;
    overflow: hidden;
}

.summary-content {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.selection-summary {
    margin-bottom: 25px;
    text-align: left;
}

.selection-summary h4 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
}

.summary-details {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    margin-bottom: 20px;
}

.summary-details ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.summary-details li {
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
    color: #495057;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: fadeInUp 0.3s ease;
}

.summary-details li:last-child {
    border-bottom: none;
}

.total-extra-cost {
    font-size: 20px;
    color: #007cba;
    margin-bottom: 25px;
    padding: 18px;
    background: #f0f8ff;
    border-radius: 8px;
    border: 2px solid #b3d7ff;
    font-weight: 700;
    animation: costPulse 2s infinite;
}

#add-to-cart-grouped {
    padding: 18px 50px;
    font-size: 18px;
    font-weight: 700;
    border-radius: 8px;
    border: none;
    transition: all 0.3s ease;
    min-width: 220px;
    background: #28a745;
    color: white;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

#add-to-cart-grouped::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

#add-to-cart-grouped:hover:not(:disabled)::before {
    left: 100%;
}

#add-to-cart-grouped:hover:not(:disabled) {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.3);
}

#add-to-cart-grouped:disabled {
    background: #6c757d;
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#add-to-cart-grouped.button-ready {
    background: #28a745;
    animation: buttonReady 1s ease;
}

#add-to-cart-grouped.incomplete {
    background: #dc3545;
    animation: shake 0.5s ease;
}

.completion-requirements {
    margin-top: 25px;
    padding: 20px;
    background: #fff3cd;
    border: 2px solid #ffeaa7;
    border-radius: 8px;
    color: #856404;
    text-align: left;
    animation: slideInUp 0.5s ease;
}

.requirements-list {
    margin: 15px 0 0 20px;
    padding: 0;
}

.requirements-list li {
    margin-bottom: 8px;
    font-weight: 600;
    list-style-type: disc;
    animation: fadeInLeft 0.3s ease forwards;
    opacity: 0;
}

.requirements-list li:nth-child(1) { animation-delay: 0.1s; }
.requirements-list li:nth-child(2) { animation-delay: 0.2s; }
.requirements-list li:nth-child(3) { animation-delay: 0.3s; }

/* ANIMATIONS */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInDown {
    from { opacity: 0; transform: translateY(-15px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes shine {
    0% { left: -100%; }
    100% { left: 100%; }
}

@keyframes selectPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

@keyframes checkmarkBounce {
    0% { transform: scale(0.8); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes priceGlow {
    0% { box-shadow: 0 0 5px rgba(0, 124, 186, 0.3); }
    100% { box-shadow: 0 0 15px rgba(0, 124, 186, 0.6); }
}

@keyframes costPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

@keyframes buttonReady {
    0% { background: #6c757d; }
    100% { background: #28a745; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .wc-grouped-options-container {
        padding: 20px 15px;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .option-item {
        min-height: auto;
    }
    
    .group-progress {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .group-status {
        min-width: auto;
        width: 100%;
    }
    
    .quantity-controls {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .qty-help-text {
        text-align: left;
        width: 100%;
        margin-top: 5px;
    }
    
    .summary-content {
        padding: 0;
    }
    
    .grouped-options-summary {
        padding: 20px;
    }
    
    .group-title {
        font-size: 18px;
        flex-wrap: wrap;
    }
    
    .option-content {
        margin-right: 45px;
    }
    
    .checkmark {
        top: 12px;
        right: 12px;
        width: 24px;
        height: 24px;
    }
}

/* Loading states */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 12px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success overlay */
.success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.success-message {
    background: #28a745;
    color: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    animation: bounceIn 0.5s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes bounceIn {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}
    