/**
 * Rosenj Clothing Customizer - Frontend Styles
 */

.rosenj-customization-wrapper {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e1e1e1;
}

.rosenj-product-type-display {
    margin-bottom: 20px;
    padding: 10px 15px;
    background: #fff;
    border-radius: 5px;
    border-left: 4px solid #0073aa;
}

.rosenj-product-type-label {
    font-weight: 600;
    color: #333;
    margin-right: 10px;
}

.rosenj-product-type-value {
    color: #0073aa;
    text-transform: capitalize;
}

/* Order Type Selection */
.rosenj-order-type-selection {
    margin-bottom: 20px;
}

.rosenj-order-type-selection h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
}

.rosenj-order-type-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rosenj-order-type-button {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #fff;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.rosenj-order-type-button:hover {
    border-color: #0073aa;
    background: #f0f8ff;
}

.rosenj-order-type-button input[type="radio"] {
    margin-right: 15px;
    transform: scale(1.2);
}

.rosenj-order-type-button input[type="radio"]:checked + .order-type-content {
    color: #0073aa;
}

.order-type-content h5 {
    margin: 0 0 5px 0;
    font-size: 14px;
    font-weight: 600;
}

.order-type-content p {
    margin: 0;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

/* Upcycling Options */
.rosenj-upcycling-options {
    margin-bottom: 20px;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e1e1e1;
}

.rosenj-upcycling-options h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 16px;
}

.rosenj-upcycling-options .description {
    margin-bottom: 15px;
    color: #666;
    font-size: 13px;
}

.rosenj-upcycling-choices {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rosenj-upcycling-button {
    display: flex;
    align-items: center;
    padding: 12px;
    background: #f9f9f9;
    border: 2px solid #e1e1e1;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.rosenj-upcycling-button:hover {
    border-color: #0073aa;
    background: #f0f8ff;
}

.rosenj-upcycling-button input[type="radio"] {
    margin-right: 12px;
    transform: scale(1.1);
}

.upcycling-content h5 {
    margin: 0 0 3px 0;
    font-size: 13px;
    font-weight: 600;
}

.upcycling-content p {
    margin: 0;
    font-size: 11px;
    color: #666;
    line-height: 1.3;
}

/* Size Options */
.rosenj-size-options {
    margin-bottom: 20px;
}

.rosenj-size-options h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
}

.rosenj-size-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rosenj-size-button {
    display: inline-block;
    padding: 8px 16px;
    background: #fff;
    border: 2px solid #e1e1e1;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    min-width: 50px;
}

.rosenj-size-button:hover {
    border-color: #0073aa;
    background: #f0f8ff;
}

.rosenj-size-button input[type="radio"] {
    display: none;
}

.rosenj-size-button input[type="radio"]:checked + span {
    color: #0073aa;
    font-weight: 600;
}

.rosenj-size-button.rosenj-custom-measurements {
    min-width: 150px;
    background: #fff3cd;
    border-color: #ffeaa7;
}

.rosenj-size-button.rosenj-custom-measurements:hover {
    background: #ffeaa7;
    border-color: #fdcb6e;
}

/* Measurement Fields */
.rosenj-measurement-fields {
    margin-bottom: 20px;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e1e1e1;
}

.rosenj-measurement-fields h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 16px;
}

.rosenj-measurement-fields .description {
    margin-bottom: 15px;
    color: #666;
    font-size: 13px;
}

.rosenj-measurement-unit-selector {
    margin-bottom: 15px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 5px;
}

.rosenj-measurement-unit-selector label {
    font-weight: 600;
    margin-right: 10px;
    color: #333;
}

.rosenj-measurement-unit-selector select {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
}

.rosenj-measurement-field {
    margin-bottom: 15px;
}

.rosenj-measurement-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.rosenj-measurement-field .required {
    color: #e74c3c;
}

.rosenj-measurement-input {
    width: 100%;
    max-width: 200px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.rosenj-measurement-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.unit-display {
    margin-left: 10px;
    color: #666;
    font-size: 13px;
}

/* Color Options */
.rosenj-color-options {
    margin-bottom: 20px;
}

.rosenj-color-options h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 16px;
}

.rosenj-color-options .description {
    color: #666;
    font-size: 13px;
}

/* Validation Messages */
.rosenj-validation-message {
    padding: 10px 15px;
    margin: 10px 0;
    border-radius: 5px;
    font-size: 13px;
}

.rosenj-validation-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.rosenj-validation-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.rosenj-validation-message.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Loading States */
.rosenj-loading {
    opacity: 0.6;
    pointer-events: none;
}

.rosenj-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: rosenj-spin 1s linear infinite;
}

@keyframes rosenj-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .rosenj-customization-wrapper {
        padding: 15px;
        margin: 15px 0;
    }

    .rosenj-order-type-options {
        gap: 8px;
    }

    .rosenj-order-type-button {
        padding: 12px;
    }

    .rosenj-size-buttons {
        gap: 6px;
    }

    .rosenj-size-button {
        padding: 6px 12px;
        min-width: 40px;
        font-size: 13px;
    }

    .rosenj-size-button.rosenj-custom-measurements {
        min-width: 120px;
    }

    .rosenj-measurement-input {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .rosenj-customization-wrapper {
        padding: 10px;
    }

    .rosenj-order-type-button {
        padding: 10px;
    }

    .order-type-content h5 {
        font-size: 13px;
    }

    .order-type-content p {
        font-size: 11px;
    }

    .rosenj-size-button {
        padding: 5px 10px;
        min-width: 35px;
        font-size: 12px;
    }
}

/* WooCommerce Integration */
.woocommerce .rosenj-customization-wrapper {
    margin: 20px 0;
}

.woocommerce .rosenj-order-type-button {
    background: #fff;
}

.woocommerce .rosenj-size-button {
    background: #fff;
}

.woocommerce .rosenj-measurement-input {
    background: #fff;
}

/* Cart and Checkout Integration */
.woocommerce-cart .rosenj-customization-summary {
    background: #f9f9f9;
    padding: 10px;
    border-radius: 5px;
    margin: 5px 0;
}

.woocommerce-cart .rosenj-customization-summary dt {
    font-weight: 600;
    color: #333;
}

.woocommerce-cart .rosenj-customization-summary dd {
    color: #666;
    margin-left: 10px;
}

/* Elementor Compatibility */
.elementor .rosenj-customization-wrapper {
    margin: 20px 0;
}

.elementor .rosenj-order-type-button {
    background: #fff;
}

.elementor .rosenj-size-button {
    background: #fff;
}

/* Accessibility */
.rosenj-order-type-button:focus,
.rosenj-upcycling-button:focus,
.rosenj-size-button:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.rosenj-measurement-input:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .rosenj-customization-wrapper {
        border: 2px solid #000;
    }

    .rosenj-order-type-button,
    .rosenj-upcycling-button,
    .rosenj-size-button {
        border: 2px solid #000;
    }

    .rosenj-order-type-button:hover,
    .rosenj-upcycling-button:hover,
    .rosenj-size-button:hover {
        border-color: #0073aa;
        background: #fff;
    }
}

/* Split Payment Display Styles */
.rosenj-split-payment-info {
    background: #e3f2fd;
    border: 1px solid #2196f3;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
}

.rosenj-split-payment-info h4 {
    color: #1976d2;
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
}

.rosenj-split-payment-breakdown {
    display: flex;
    justify-content: space-between;
    margin: 8px 0;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.rosenj-split-payment-breakdown:last-child {
    border-bottom: none;
    font-weight: 600;
    color: #1976d2;
}

.rosenj-split-payment-breakdown .label {
    font-weight: 500;
}

.rosenj-split-payment-breakdown .amount {
    font-weight: 600;
}

.rosenj-deposit-amount {
    color: #2e7d32;
    font-weight: 600;
}

.rosenj-final-payment-amount {
    color: #f57c00;
    font-weight: 600;
}

/* Cart and Checkout Split Payment Styles */
.woocommerce-cart .rosenj-split-payment-notice,
.woocommerce-checkout .rosenj-split-payment-notice {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 12px;
    margin: 10px 0;
    font-size: 14px;
    color: #856404;
}

.woocommerce-cart .rosenj-split-payment-notice strong,
.woocommerce-checkout .rosenj-split-payment-notice strong {
    color: #856404;
}

/* Fee Display Styles */
.woocommerce-cart .fee,
.woocommerce-checkout .fee {
    border-top: 1px solid #e0e0e0;
    padding-top: 8px;
    margin-top: 8px;
}

.woocommerce-cart .fee.deposit-fee,
.woocommerce-checkout .fee.deposit-fee {
    color: #2e7d32;
    font-weight: 600;
}

.woocommerce-cart .fee.final-payment-fee,
.woocommerce-checkout .fee.final-payment-fee {
    color: #f57c00;
    font-weight: 600;
    font-style: italic;
}

/* Responsive Split Payment */
@media (max-width: 768px) {
    .rosenj-split-payment-breakdown {
        flex-direction: column;
        gap: 5px;
    }
}

/* Cart Customization Display Styles */
.rosenj-cart-customization {
    color: #0073aa;
    font-size: 12px;
    font-weight: 500;
    display: block;
    margin-top: 5px;
    line-height: 1.3;
}

.rosenj-cart-customization-details {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #0073aa;
}

.rosenj-cart-detail {
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.4;
}

.rosenj-cart-detail:last-child {
    margin-bottom: 0;
}

.rosenj-cart-detail strong {
    color: #333;
    font-weight: 600;
}

.rosenj-mini-cart-customization {
    color: #0073aa;
    font-size: 11px;
    font-weight: 500;
    display: block;
    margin-top: 3px;
    line-height: 1.2;
}

/* WooCommerce Cart Integration */
.woocommerce-cart .rosenj-cart-customization-details {
    margin-top: 8px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #0073aa;
}

.woocommerce-cart .rosenj-cart-detail {
    font-size: 12px;
    margin-bottom: 6px;
}

.woocommerce-mini-cart .rosenj-mini-cart-customization {
    font-size: 10px;
    margin-top: 2px;
}

/* Elementor Compatibility */
.elementor .rosenj-cart-customization-details {
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #0073aa;
    padding: 10px;
    margin-top: 10px;
}

.elementor .rosenj-cart-detail {
    font-size: 13px;
    margin-bottom: 8px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .rosenj-cart-customization-details {
        border: 2px solid #000;
        background: #fff;
    }
    
    .rosenj-cart-customization,
    .rosenj-mini-cart-customization {
        color: #000;
        font-weight: 700;
    }
}

/* WooCommerce Blocks compatibility */
.wc-block-cart-item__product .rosenj-cart-customization {
    margin-top: 8px;
    font-size: 0.9em;
    color: #666;
}

.wc-block-components-product-metadata .rosenj-cart-customization {
    margin-top: 4px;
    padding: 4px 8px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 0.85em;
    color: #495057;
}

/* Blocks cart customization display */
.rosenj-blocks-cart-customization {
    display: block;
    margin-top: 8px;
    padding: 6px 10px;
    background: #f0f8ff;
    border-left: 3px solid #0073aa;
    border-radius: 3px;
    font-size: 0.85em;
    color: #333;
    line-height: 1.4;
}

.rosenj-blocks-cart-customization strong {
    color: #0073aa;
    font-weight: 600;
}

/* Blocks cart item customization */
.wc-block-cart-item__product .rosenj-blocks-cart-customization {
    margin-top: 6px;
    font-size: 0.8em;
    color: #666;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    padding: 4px 8px;
}

/* High contrast mode support for blocks */
@media (prefers-contrast: high) {
    .rosenj-blocks-cart-customization {
        border: 2px solid currentColor;
        background: transparent;
    }
} 