/**
 * Frontend Styles for Startbiz Product Options
 */

/* Main wrapper */
.sbz-wcpo-options-wrapper {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e1e1e1;
}

/* Group styles */
.sbz-wcpo-group {
    margin-bottom: 25px;
    padding: 15px;
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
}

.sbz-wcpo-group.has-error {
    border-color: #dc3232;
    background: #fff5f5;
}

.sbz-wcpo-group:last-child {
    margin-bottom: 0;
}

/* Group header */
.sbz-wcpo-group-header {
    margin-bottom: 15px;
}

.sbz-wcpo-group-title {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.sbz-wcpo-required-indicator {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 6px;
    background: #dc3232;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 3px;
    letter-spacing: 0.5px;
}

.sbz-wcpo-group-description {
    margin: 8px 0 0 0;
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

/* Group content */
.sbz-wcpo-group-content {
    position: relative;
}

/* Items container */
.sbz-wcpo-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Individual items */
.sbz-wcpo-item {
    padding: 12px;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    background: #fff;
    transition: all 0.2s ease;
}

.sbz-wcpo-item:hover {
    border-color: #ccc;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sbz-wcpo-item.selected {
    border-color: #2271b1;
    background: #f0f8ff;
    box-shadow: 0 2px 4px rgba(33,113,177,0.2);
}

.sbz-wcpo-item.selected .sbz-wcpo-item-label {
    font-weight: 600;
}

/* Item content layout */
.sbz-wcpo-item-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Item labels */
.sbz-wcpo-item-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
    flex: 1;
}

.sbz-wcpo-item-text {
    flex: 1;
}

/* Item prices */
.sbz-wcpo-item-price {
    margin-left: auto;
}

.sbz-wcpo-price {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.sbz-wcpo-price.sbz-wcpo-free {
    color: #46b450;
}

/* Quantity selector */
.sbz-wcpo-quantity-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e1e1e1;
}

.sbz-wcpo-qty-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #ccc;
    background: #f9f9f9;
    color: #333;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.sbz-wcpo-qty-btn:hover {
    background: #e1e1e1;
    border-color: #999;
}

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

.sbz-wcpo-qty-input {
    width: 60px;
    height: 30px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
}

/* Radio items */
.sbz-wcpo-radio-item .sbz-wcpo-item-label {
    width: 100%;
}

/* Select dropdown */
.sbz-wcpo-select select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
}

/* Validation messages */
.sbz-wcpo-validation-message {
    margin-top: 10px;
    padding: 8px 12px;
    background: #fff5f5;
    border: 1px solid #dc3232;
    border-radius: 4px;
    color: #dc3232;
    font-size: 13px;
    line-height: 1.4;
}

/* Total price display */
.sbz-wcpo-total-price {
    display: inline-block;
    margin-left: 10px;
    font-weight: 600;
    color: #333;
}

/* No options message */
.sbz-wcpo-no-options {
    margin: 0;
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}

/* Loading states */
.sbz-wcpo-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

/* Responsive design */
@media (max-width: 768px) {
    .sbz-wcpo-options-wrapper {
        margin: 15px 0;
        padding: 15px;
    }

    .sbz-wcpo-group {
        margin-bottom: 20px;
        padding: 12px;
    }

    .sbz-wcpo-item {
        padding: 10px;
    }

    .sbz-wcpo-item-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .sbz-wcpo-item-price {
        margin-left: 0;
        align-self: flex-end;
    }

    .sbz-wcpo-quantity-selector {
        justify-content: center;
    }
}

/* Accessibility improvements */
.sbz-wcpo-item input[type="checkbox"],
.sbz-wcpo-item input[type="radio"] {
    margin-right: 8px;
}

.sbz-wcpo-item input[type="checkbox"]:focus,
.sbz-wcpo-item input[type="radio"]:focus,
.sbz-wcpo-select select:focus,
.sbz-wcpo-qty-input:focus,
.sbz-wcpo-qty-btn:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

/* Screen reader only text */
.sbz-wcpo-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Animation for state changes */
.sbz-wcpo-item {
    transition: all 0.2s ease;
}

.sbz-wcpo-quantity-selector {
    transition: all 0.3s ease;
}

/* Focus states for better keyboard navigation */
.sbz-wcpo-item:focus-within {
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(33,113,177,0.2);
}
