/* Taoteng Product Options - Public Styles */

.tpo-product-options {
    padding: 8px;
    margin-bottom: 10px;
    border: 2px dashed #2db9e2;
    border-radius: 4px;
}

.tpo-product-options h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
}

.tpo-option-set {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.tpo-option-set:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.tpo-option-set-title {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 600;
}

.tpo-option-set-description {
    margin: 0 0 15px;
    color: #666;
    font-size: 14px;
}

.tpo-fields {
    display: flex;
    flex-wrap: wrap;
    margin-right: -12px;
}

.tpo-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 0 0 calc(100% - 12px);
    margin-bottom: 12px;
    box-sizing: border-box;
}

.tpo-field-label {
    font-weight: 500;
    font-size: 14px;
}

.tpo-required {
    color: #dc3232;
    margin-left: 3px;
}

.tpo-field-description {
    margin: 0;
    font-size: 13px;
    color: #666;
}

.tpo-field-input {
    width: 100%;
}

.tpo-field-input input[type="text"],
.tpo-field-input input[type="number"],
.tpo-field-input input[type="email"],
.tpo-field-input input[type="tel"],
.tpo-field-input input[type="url"],
.tpo-field-input input[type="date"],
.tpo-field-input input[type="time"],
.tpo-field-input textarea,
.tpo-field-input select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 14px;
    box-sizing: border-box;
}

.tpo-field-input textarea {
    min-height: 100px;
    resize: vertical;
}

.tpo-field-input select {
    height: 40px;
}

/* Radio & Checkbox styles */
.tpo-field-input .tpo-radio-group,
.tpo-field-input .tpo-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.tpo-field-input input[type="radio"],
.tpo-field-input input[type="checkbox"] {
    margin: 0;
}

/* Color picker */
.tpo-field-input input[type="color"] {
    width: 60px;
    height: 40px;
    padding: 2px;
    border: 1px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
}

/* File upload */
.tpo-field-input input[type="file"] {
    padding: 10px;
    border: 2px dashed #ccc;
    border-radius: 3px;
    background: #fff;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
}

.tpo-field-input input[type="file"]:hover {
    border-color: #2271b1;
}

/* Range slider */
.tpo-field-input input[type="range"] {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: #ddd;
    border-radius: 4px;
    outline: none;
}

.tpo-field-input input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #2271b1;
    border-radius: 50%;
    cursor: pointer;
}

.tpo-field-input input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #2271b1;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.tpo-range-value {
    display: inline-block;
    margin-left: 10px;
    font-weight: 500;
    color: #2271b1;
}

/* Error state */
.tpo-field.tpo-field-error input,
.tpo-field.tpo-field-error textarea,
.tpo-field.tpo-field-error select {
    border-color: #dc3232;
}

.tpo-field-error .tpo-field-error-message {
    color: #dc3232;
    font-size: 13px;
    margin-top: 3px;
}

.tpo-field-error {
    color: #dc3232;
    font-size: 13px;
    margin-top: 3px;
}

/* Required field indicator */
.tpo-field-required .tpo-field-label::after {
    content: '';
}

/* Price display */
.tpo-price-display {
    margin-top: 15px;
    padding: 15px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
}

.tpo-price-display .tpo-base-price {
    color: #666;
    font-size: 14px;
}

.tpo-price-display .tpo-adjustment {
    color: #2271b1;
    font-size: 14px;
}

.tpo-price-display .tpo-total-price {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
    font-size: 18px;
    font-weight: 600;
}

/* Image select */
.tpo-image-select-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.tpo-image-select-item {
    position: relative;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.tpo-image-select-item:hover {
    border-color: #2271b1;
}

.tpo-image-select-item.selected {
    border-color: #2271b1;
}

.tpo-image-select-item input {
    position: absolute;
    opacity: 0;
}

.tpo-image-select-item img {
    width: 100%;
    height: auto;
    display: block;
}

.tpo-image-select-item .tpo-image-label {
    display: block;
    padding: 5px;
    text-align: center;
    font-size: 12px;
    background: #f5f5f5;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .tpo-product-options {
        padding: 15px;
    }
    
    .tpo-field-input input[type="text"],
    .tpo-field-input input[type="number"],
    .tpo-field-input input[type="email"],
    .tpo-field-input input[type="tel"],
    .tpo-field-input input[type="url"],
    .tpo-field-input input[type="date"],
    .tpo-field-input input[type="time"],
    .tpo-field-input textarea,
    .tpo-field-input select {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}
