/* Frontend Styles for WooCommerce Custom Product Fields */

.wccf-custom-fields {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.wccf-field {
    margin-bottom: 20px;
}

.wccf-field:last-child {
    margin-bottom: 0;
}

.wccf-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.wccf-field label .required {
    color: #dc3232;
    font-weight: bold;
}

.wccf-field input[type="text"],
.wccf-field textarea {
    width: 100%;
    padding: 0px 10px !important;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.wccf-field input[type="text"]:focus,
.wccf-field textarea:focus {
    outline: none;
    border-color: #55009c;
    box-shadow: 0 0 0 1px #55009c;
}

.wccf-field-description {
    margin-top: 6px;
    font-size: 13px;
    color: #666;
    font-style: italic;
}

.wccf-datepicker::-webkit-input-placeholder {
    color: #999;
}

/* Chips field */
.wccf-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.wccf-chip {
    margin: 0;
    cursor: pointer;
}

.wccf-chip input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.wccf-chip-label {
    display: inline-block;
    padding: 10px 18px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    transition: all 0.3s ease;
    user-select: none;
}

.wccf-chip:hover .wccf-chip-label {
    border-color: #55009c;
    background: #f0f7ff;
}

.wccf-chip input[type="radio"]:checked + .wccf-chip-label {
    background: #55009c;
    border-color: #55009c;
    color: #fff;
}

.wccf-chip input[type="radio"]:focus + .wccf-chip-label {
    outline: 2px solid #55009c;
    outline-offset: 2px;
}

/* Textarea field */
.wccf-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Checkbox field */
.wccf-checkbox-label {
    display: flex !important;
    align-items: center;
    cursor: pointer;
    font-weight: normal !important;
}

.wccf-checkbox-label input[type="checkbox"] {
    margin: 0 8px 0 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.wccf-checkbox-label span {
    flex: 1;
}

/* Cross-sell products */
.wccf-cross-sell-products {
    margin-top: 12px;
}

.wccf-cross-sell-item {
    margin-bottom: 12px;
    padding: 12px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    transition: border-color 0.3s;
}

.wccf-cross-sell-item:hover {
    border-color: #55009c;
}

.wccf-cross-sell-item label {
    display: flex !important;
    align-items: center;
    margin: 0 !important;
    cursor: pointer;
    font-weight: normal !important;
}

.wccf-cross-sell-item input[type="checkbox"] {
    margin: 0 12px 0 0;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.wccf-cross-sell-item input[type="checkbox"]:checked {
    accent-color: #55009c;
}

.wccf-cross-sell-image {
    flex-shrink: 0;
    margin-right: 12px;
}

.wccf-cross-sell-image img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.wccf-cross-sell-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.wccf-cross-sell-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.wccf-cross-sell-price {
    color: #55009c;
    font-weight: 500;
}

/* Conditional fields */
.wccf-field[data-conditional="true"] {
    transition: opacity 0.3s, max-height 0.3s;
}

.wccf-field.wccf-hidden {
    display: none;
}

/* Required field indicator */
.wccf-field.required input,
.wccf-field.required textarea,
.wccf-field.required select {
    border-left: 3px solid #dc3232;
}

/* Error states */
.wccf-field.wccf-error input,
.wccf-field.wccf-error textarea {
    border-color: #dc3232;
}

.wccf-field .wccf-error-message {
    color: #dc3232;
    font-size: 13px;
    margin-top: 6px;
    display: block;
}

/* Loading state */
.wccf-custom-fields.wccf-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 768px) {
    .wccf-custom-fields {
        padding: 15px;
    }
    
    .wccf-chips-container {
        gap: 8px;
    }
    
    .wccf-chip-label {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .wccf-cross-sell-image img {
        width: 50px;
        height: 50px;
    }
}

/* jQuery UI Datepicker customization */
.ui-datepicker {
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: 1px solid #ddd;
}

.ui-datepicker-header {
    background: #d8b8e8;
    color: #333;
    border-radius: 6px 6px 0 0;
}

.ui-datepicker-title {
    color: #333;
}

.ui-datepicker-prev,
.ui-datepicker-next {
    cursor: pointer;
    color: #333 !important;
}

.ui-datepicker-prev::before,
.ui-datepicker-next::before {
    color: #333 !important;
}

.ui-datepicker-prev span,
.ui-datepicker-next span {
    color: #333 !important;
}

.ui-datepicker td a {
    text-align: center;
    padding: 6px;
    border-radius: 4px;
}

.ui-datepicker td a:hover {
    background: #55009c;
    color: #fff;
}

.ui-datepicker td.ui-state-disabled {
    opacity: 0.4;
}

.ui-datepicker .ui-state-active {
    background: #55009c;
    color: #fff;
}
