/* ============================================================
   WooCommerce Product Options - Frontend Styles
   ============================================================ */

/* ---- Main Container ---- */
.wpo-product-options {
    margin: 20px 0;
    clear: both;
}

/* ---- Individual Option Field ---- */
.wpo-option-field {
    margin-bottom: 20px;
}

/* ---- Labels ---- */
.wpo-label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
    font-size: 14px;
}

.wpo-required {
    color: #e2401c;
    margin-left: 2px;
}

.wpo-field-description {
    color: #777;
    font-size: 13px;
    margin: 0 0 8px;
}

/* ---- Text Inputs ---- */
.wpo-input,
.wpo-textarea,
.wpo-select,
.wpo-date {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.wpo-input:focus,
.wpo-textarea:focus,
.wpo-select:focus,
.wpo-date:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.15);
    outline: none;
}

.wpo-textarea {
    resize: vertical;
    min-height: 100px;
}

/* ---- Character count ---- */
.wpo-char-count {
    display: block;
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

/* ---- Per-character price ---- */
.wpo-per-char-price {
    display: block;
    font-size: 12px;
    color: #555;
    margin-top: 4px;
    font-style: italic;
}

/* ---- Radio Buttons ---- */
.wpo-radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wpo-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    padding: 6px 10px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    transition: border-color 0.2s, background 0.2s;
    max-width: 400px;
}

.wpo-radio-label:hover {
    border-color: #2271b1;
    background: #f0f6fc;
}

.wpo-radio-label:has(.wpo-radio:checked) {
    border-color: #2271b1;
    background: #e8f0fe;
}

.wpo-radio {
    flex-shrink: 0;
    accent-color: #2271b1;
}

/* ---- Checkboxes ---- */
.wpo-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wpo-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    padding: 6px 10px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    transition: border-color 0.2s, background 0.2s;
    max-width: 400px;
}

.wpo-checkbox-label:hover {
    border-color: #2271b1;
    background: #f0f6fc;
}

.wpo-checkbox {
    flex-shrink: 0;
    accent-color: #2271b1;
}

/* ---- Price Badge on Choices ---- */
.wpo-choice-price-badge {
    margin-left: auto;
    font-size: 12px;
    color: #2271b1;
    font-weight: 600;
    background: #e8f0fe;
    padding: 2px 6px;
    border-radius: 10px;
    white-space: nowrap;
}

/* ---- Color Swatches ---- */
.wpo-color-swatch-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
}

.wpo-color-swatch {
    display: inline-block;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid #e5e5e5;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.15s;
    position: relative;
}

.wpo-color-swatch:hover {
    transform: scale(1.1);
    border-color: #aaa;
}

.wpo-color-swatch.wpo-swatch-selected {
    border-color: #2271b1;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #2271b1;
}

.wpo-swatch-selected-label {
    display: block;
    font-size: 13px;
    color: #555;
    margin-top: 6px;
    min-height: 18px;
}

/* ---- Image Swatches ---- */
.wpo-image-swatch-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
}

.wpo-image-swatch {
    display: inline-block;
    width: 60px;
    height: 60px;
    border: 3px solid #e5e5e5;
    border-radius: 4px;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s, transform 0.15s;
    position: relative;
}

.wpo-image-swatch img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wpo-image-swatch:hover {
    border-color: #aaa;
    transform: scale(1.05);
}

.wpo-image-swatch.wpo-swatch-selected {
    border-color: #2271b1;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #2271b1;
}

/* ---- File Upload ---- */
.wpo-file-input {
    display: block;
    margin-bottom: 6px;
}

.wpo-file-info {
    font-size: 12px;
    color: #888;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ---- Heading / Paragraph ---- */
.wpo-heading {
    font-size: 16px;
    font-weight: 700;
    color: #1d2327;
    margin: 0 0 8px;
    padding-bottom: 6px;
    border-bottom: 2px solid #e5e5e5;
}

.wpo-paragraph {
    color: #555;
    font-size: 14px;
}

/* ---- Price Adjustment Display ---- */
.wpo-price-adjustment {
    display: block;
    font-size: 13px;
    color: #2271b1;
    margin-top: 4px;
    font-weight: 600;
}

/* ---- Validation Messages ---- */
.wpo-validation-message {
    display: block;
    color: #e2401c;
    font-size: 12px;
    margin-top: 4px;
    min-height: 16px;
}

.wpo-option-field.wpo-has-error .wpo-input,
.wpo-option-field.wpo-has-error .wpo-textarea,
.wpo-option-field.wpo-has-error .wpo-select {
    border-color: #e2401c;
}

/* ---- Price Summary ---- */
#wpo-price-summary {
    background: #f6f7f7;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 14px;
}

#wpo-price-summary .wpo-price-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    color: #555;
}

#wpo-price-summary .wpo-price-total {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    color: #1d2327;
    border-top: 1px solid #e5e5e5;
    padding-top: 8px;
    margin-top: 8px;
    font-size: 16px;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
    .wpo-input,
    .wpo-textarea,
    .wpo-select,
    .wpo-date,
    .wpo-radio-label,
    .wpo-checkbox-label {
        max-width: 100%;
    }
}
