/* Custom Product Fields - Frontend Styles */

.cpf-fields-container {
    margin: 20px 0;
    padding: 20px;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    background-color: #fafafa;
    max-width: 600px;
}

.cpf-fields-container h3 { 
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
}

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

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

.cpf-field label,
.cpf-field-label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.cpf-field-description {
    font-size: 0.9em;
    color: #666;
    margin: 5px 0;
    font-style: italic;
}

.required {
    color: #e74c3c;
    font-weight: bold;
}

/* Input Styles */
.cpf-field input[type="text"],
.cpf-field input[type="email"],
.cpf-field input[type="tel"],
.cpf-field input[type="number"],
.cpf-field select,
.cpf-field textarea,
.cpf-input-text, 
.cpf-textarea, 
.cpf-select, 
.cpf-input-email, 
.cpf-input-number, 
.cpf-input-date {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.cpf-field input:focus,
.cpf-field select:focus,
.cpf-field textarea:focus,
.cpf-input-text:focus,
.cpf-textarea:focus,
.cpf-select:focus,
.cpf-input-email:focus,
.cpf-input-number:focus,
.cpf-input-date:focus {
    border-color: #007cba;
    outline: none;
    box-shadow: 0 0 5px rgba(0, 124, 186, 0.3);
}

.cpf-field textarea,
.cpf-textarea {
    min-height: 80px;
    resize: vertical;
    font-family: inherit;
}

/* Radio und Checkbox Felder */
.cpf-field input[type="radio"],
.cpf-field input[type="checkbox"],
.cpf-checkbox, 
.cpf-radio {
    width: auto;
    margin-right: 8px;
    margin-bottom: 5px;
}

.cpf-field .radio-option,
.cpf-field .checkbox-option {
    margin-bottom: 8px;
}

.cpf-field .radio-option label,
.cpf-field .checkbox-option label,
.cpf-radio-label, 
.cpf-checkbox-label {
    font-weight: normal;
    margin-bottom: 0;
    cursor: pointer;
    display: block;
}

.cpf-radio-label:hover,
.cpf-checkbox-label:hover {
    color: #007cba;
}

/* Error States */
.cpf-field.error input,
.cpf-field.error select,
.cpf-field.error textarea {
    border-color: #e74c3c;
    box-shadow: 0 0 5px rgba(231, 76, 60, 0.3);
}

.cpf-field .error-message,
.cpf-field-error {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

/* Add to Cart Wrapper */
.cpf-add-to-cart-wrapper {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: center;
}

.cpf-add-to-cart {
    width: 100%;
    padding: 12px 24px;
    font-size: 16px;
    background-color: #007cba;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.cpf-add-to-cart:hover {
    background-color: #005a87;
}

.cpf-add-to-cart:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* WooCommerce Integration */
.single-product .cpf-fields-container {
    margin-bottom: 20px;
}

.cart .cpf-field-value {
    font-size: 12px;
    color: #666;
}



/* Loading State */
.cart.loading {
    opacity: 0.6;
    pointer-events: none;
}

.cpf-loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: cpf-spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes cpf-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}



/* Mobile Responsive */
@media (max-width: 768px) {
    .cpf-fields-container {
        margin: 15px 0;
        padding: 15px;
        max-width: 100%;
    }
    
    .cpf-field {
        margin-bottom: 15px;
    }
    
    .cpf-field input,
    .cpf-field select,
    .cpf-field textarea {
        padding: 10px;
        font-size: 16px; /* Verhindert Zoom auf iOS */
    }
    
    .cpf-add-to-cart {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .woocommerce-tabs .tabs {
        flex-direction: column;
    }
    
    .woocommerce-tabs .tabs li {
        width: 100% !important;
        margin: 0 0 2px 0 !important;
    }
    
    .woocommerce-tabs .tabs li a {
        margin-right: 0;
        border-radius: 4px;
        border: 1px solid #ddd;
    }
}

/* Alle Tabs - einheitliches Styling */
/* Tab-Links - Padding und Abstände */
@media (min-width: 1000px) {
	/* Tab Integration */
.custom-fields-tab-wrapper {
    padding: 20px 0;
}

.woocommerce-tabs .panel#tab-custom_fields {
    padding: 20px;
}
	/* Tab Navigation für hartnäckige Themes */
.single-product .woocommerce-tabs .tabs {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    width: 100% !important;
}

.single-product .woocommerce-tabs .tabs li {
    display: inline-block !important;
    float: none !important;
    width: auto !important;
    margin: 0 2px 0 0 !important;
}
.woocommerce-tabs .tabs li a {
    padding: 12px 20px !important; /* Oben/Unten Links/Rechts */
    margin: 0 8px 0 0 !important; /* Abstand zwischen den Tabs */
    border: 1px solid #FFF !important;
    border-radius: 5px !important;
    -moz-border-radius: 5px !important;
    -webkit-border-radius: 5px !important;
    box-shadow: 1px 2px 4px rgba(0,0,0,.4) !important;
    display: block !important;
}

/* Alternative: Mehr Padding falls gewünscht */
.woocommerce-tabs .tabs li a {
    padding: 15px 25px !important; /* Größeres Padding */
    margin: 0 10px 0 0 !important; /* Größerer Abstand */
}

/* Tab-Container - Gesamtabstand */
.woocommerce-tabs .tabs {
    gap: 8px; /* Moderne Alternative für Abstände */
    padding: 0 10px !important; /* Seitlicher Abstand vom Container-Rand */
}

/* Letzter Tab - kein rechter Margin */
.woocommerce-tabs .tabs li:last-child a {
    margin-right: 0 !important;
}
.woocommerce-tabs .panel{width:100% !important;
float:none !important;
padding-left:10px;
}
}
/*stückzahl und Preis anzeigen*/

/*Motive Bilder margin bottoim*/
.wb_cptb_content img{margin-bottom:15px !important;}
@media (max-width: 1000px) {.woocommerce-tabs ul.tabs li a{padding:0 !important;}}

/* CPF-spezifische Styles - Template-Ansatz */

/* Hinweis-Box für Benutzer */
.cpf-notice {
    background: #e7f3ff;
    border-left: 4px solid #0073aa;
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
}

.cpf-notice p {
    margin: 0;
    font-size: 16px;
}

/* Custom Fields Tab Styling */
.cpf-tab-content {
    padding: 20px 0;
    min-height: 200px;
}

.cpf-tab-content h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 18px;
}

/* Tab-Formular Styling */
.cart {
    background: #fff;
    padding: 0;
    border-radius: 0;
    margin: 0;
}

.cpf-fields-section {
    margin-bottom: 30px;
}

.cpf-variations-section {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 5px;
    margin: 20px 0;
}

.cpf-variations-section h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}

.cpf-variation-field {
    margin-bottom: 15px;
}

.cpf-variation-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.cpf-variation-field select {
    width: 100%;
    max-width: 300px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.cpf-submit-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: center;
}

.cpf-submit-section .single_add_to_cart_button {
    background: #0073aa;
    color: white;
    padding: 15px 30px;
    font-size: 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: auto;
    min-width: 200px;
}

.cpf-submit-section .single_add_to_cart_button:hover {
    background: #005a87;
}

/* CPF Felder im Tab */
.cpf-tab-content .cpf-field {
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 5px;
    border-left: 3px solid #0073aa;
}

.cpf-tab-content .cpf-field:last-child {
    margin-bottom: 0;
}

.cpf-tab-content .cpf-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.cpf-tab-content .cpf-field .required {
    color: #e2401c;
    font-weight: bold;
}

.cpf-tab-content .cpf-field input[type="text"],
.cpf-tab-content .cpf-field input[type="email"],
.cpf-tab-content .cpf-field input[type="tel"],
.cpf-tab-content .cpf-field input[type="number"],
.cpf-tab-content .cpf-field input[type="date"],
.cpf-tab-content .cpf-field select,
.cpf-tab-content .cpf-field textarea {
    width: 100%;
    max-width: 400px;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.cpf-tab-content .cpf-field input:focus,
.cpf-tab-content .cpf-field select:focus,
.cpf-tab-content .cpf-field textarea:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.cpf-tab-content .cpf-field textarea {
    min-height: 80px;
    resize: vertical;
}

/* Radio und Checkbox Styling */
.cpf-tab-content .cpf-field input[type="radio"],
.cpf-tab-content .cpf-field input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

.cpf-tab-content .cpf-field .radio-option,
.cpf-tab-content .cpf-field .checkbox-option {
    margin-bottom: 10px;
    padding: 8px 12px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.cpf-tab-content .cpf-field .radio-option:hover,
.cpf-tab-content .cpf-field .checkbox-option:hover {
    background: #f0f8ff;
}

.cpf-tab-content .cpf-field .radio-option label,
.cpf-tab-content .cpf-field .checkbox-option label {
    margin-bottom: 0;
    font-weight: normal;
    cursor: pointer;
    display: flex;
    align-items: center;
}

/* Error States für Tab */
.cpf-tab-content .cpf-field.error input,
.cpf-tab-content .cpf-field.error select,
.cpf-tab-content .cpf-field.error textarea {
    border-color: #e74c3c;
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.1);
}

.cpf-tab-content .cpf-field .error-message {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
    display: block;
    font-weight: normal;
}

/* Max-Length und Zeichenzähler */
.max-length-info {
    font-size: 11px;
    color: #666;
    font-weight: normal;
    margin-left: 5px;
}

.char-counter {
    font-size: 11px;
    color: #666;
    margin-top: 3px;
    text-align: right;
}

.char-counter.over-limit {
    color: #e74c3c;
    font-weight: bold;
}

.char-counter.near-limit {
    color: #ff9800;
    font-weight: bold;
}

.char-counter .current-length {
    font-weight: bold;
}

/* Input-Felder mit Längen-Überschreitung */
.cpf-field input.over-limit,
.cpf-field textarea.over-limit {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.1) !important;
}

.cpf-field input.near-limit,
.cpf-field textarea.near-limit {
    border-color: #ff9800 !important;
    box-shadow: 0 0 0 2px rgba(255, 152, 0, 0.1) !important;
}

/* Info-Box Styling */
.cpf-info-box {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border: 1px solid #2196f3;
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
    position: relative;
}

.cpf-info-box::before {
    content: "ℹ️";
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 18px;
    opacity: 0.7;
}

.cpf-info-title {
    color: #1976d2;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
}

.cpf-info-title::before {
    content: "📋";
    margin-right: 8px;
    font-size: 14px;
}

.cpf-info-content {
    color: #424242;
    line-height: 1.6;
    margin-bottom: 10px;
}

.cpf-info-content p {
    margin: 0 0 10px 0;
}

.cpf-info-content p:last-child {
    margin-bottom: 0;
}

.cpf-info-details {
    background: rgba(255, 255, 255, 0.7);
    padding: 12px;
    border-radius: 4px;
    font-size: 14px;
    color: #555;
    border-left: 3px solid #2196f3;
}

.cpf-info-details p {
    margin: 0 0 8px 0;
}

.cpf-info-details p:last-child {
    margin-bottom: 0;
}

/* Info-Box Varianten */
.cpf-field-info .cpf-info-box {
    background: linear-gradient(135deg, #e8f5e8 0%, #f0f8f0 100%);
    border-color: #4caf50;
}

.cpf-field-info .cpf-info-title {
    color: #2e7d32;
}

.cpf-field-info .cpf-info-details {
    border-left-color: #4caf50;
}

/* Kompakte Info-Box (für kurze Hinweise) */
.cpf-info-box.compact {
    padding: 12px 15px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-left: 4px solid #2196f3;
}

.cpf-info-box.compact::before {
    display: none;
}

.cpf-info-box.compact .cpf-info-title {
    font-size: 14px;
    margin-bottom: 5px;
}

.cpf-tab-success {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    margin: 15px 0;
    display: none;
}

/* Responsive für Tabs */
@media (max-width: 768px) {
    .cpf-tab-content .cpf-field {
        padding: 10px;
    }
    
    .cpf-tab-content .cpf-field input,
    .cpf-tab-content .cpf-field select,
    .cpf-tab-content .cpf-field textarea {
        max-width: 100%;
    }
    
    .cpf-variations-section {
        padding: 15px;
        margin: 15px 0;
    }
    
    .cpf-submit-section .single_add_to_cart_button {
        width: 100%;
        min-width: auto;
    }
    
    /* Info-Box responsive */
    .cpf-info-box {
        padding: 15px;
        margin: 10px 0;
    }
    
    .cpf-info-box::before {
        top: 12px;
        right: 12px;
        font-size: 16px;
    }
    
    .cpf-info-title {
        font-size: 15px;
        margin-bottom: 8px;
    }
    
    .cpf-info-details {
        padding: 10px;
        font-size: 13px;
    }
    
    /* Zeichenzähler responsive */
    .char-counter {
        font-size: 10px;
        text-align: left;
        margin-top: 2px;
    }
    
    .max-length-info {
        font-size: 10px;
        display: block;
        margin-top: 2px;
        margin-left: 0;
    }
}

.cpf-tab-content h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 18px;
}

.cpf-tab-content .cpf-field {
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 5px;
    border-left: 3px solid #0073aa;
}

.cpf-tab-content .cpf-field:last-child {
    margin-bottom: 0;
}

.cpf-tab-content .cpf-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.cpf-tab-content .cpf-field .required {
    color: #e2401c;
    font-weight: bold;
}

.cpf-tab-content .cpf-field input[type="text"],
.cpf-tab-content .cpf-field input[type="email"],
.cpf-tab-content .cpf-field input[type="tel"],
.cpf-tab-content .cpf-field input[type="number"],
.cpf-tab-content .cpf-field input[type="date"],
.cpf-tab-content .cpf-field select,
.cpf-tab-content .cpf-field textarea {
    width: 100%;
    max-width: 400px;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.cpf-tab-content .cpf-field input:focus,
.cpf-tab-content .cpf-field select:focus,
.cpf-tab-content .cpf-field textarea:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.cpf-tab-content .cpf-field textarea {
    min-height: 80px;
    resize: vertical;
}

/* Radio und Checkbox Styling */
.cpf-tab-content .cpf-field input[type="radio"],
.cpf-tab-content .cpf-field input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

.cpf-tab-content .cpf-field .radio-option,
.cpf-tab-content .cpf-field .checkbox-option {
    margin-bottom: 10px;
    padding: 8px 12px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.cpf-tab-content .cpf-field .radio-option:hover,
.cpf-tab-content .cpf-field .checkbox-option:hover {
    background: #f0f8ff;
}

.cpf-tab-content .cpf-field .radio-option label,
.cpf-tab-content .cpf-field .checkbox-option label {
    margin-bottom: 0;
    font-weight: normal;
    cursor: pointer;
    display: flex;
    align-items: center;
}

/* Fieldset für Radio Groups */
.cpf-tab-content .cpf-field fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

.cpf-tab-content .cpf-field fieldset legend {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    padding: 0;
}

/* Error States für Tab */
.cpf-tab-content .cpf-field.error input,
.cpf-tab-content .cpf-field.error select,
.cpf-tab-content .cpf-field.error textarea {
    border-color: #e74c3c;
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.1);
}

.cpf-tab-content .cpf-field .error-message {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
    display: block;
    font-weight: normal;
}

/* Tab-Formular Styling */
.cart {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 5px;
    margin: 20px 0;
}

.cpf-tab-title {
    font-size: 18px;
    color: #333;
    margin-bottom: 15px;
    font-weight: bold;
}

.cart input[type="submit"] {
    background: #0073aa;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.cart input[type="submit"]:hover {
    background: #005a87;
}

.cart input[type="submit"]:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.cpf-tab-success {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    margin: 15px 0;
    display: none;
}

/* Loading State */
.cart.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Admin Frontend Styles */
.quantity input {
    display: none !important;
}

/* Cart und Checkout Styling */
.woocommerce-cart-form__cart-item .cpf-field-value,
.woocommerce-checkout-review-order-table .cpf-field-value {
    font-size: 0.9em;
    color: #666;
    margin: 5px 0;
}

.woocommerce-cart-form__cart-item .cpf-field-value strong,
.woocommerce-checkout-review-order-table .cpf-field-value strong {
    color: #333;
}

/* Responsive für Tabs */
@media (max-width: 768px) {
    .cart {
        padding: 15px;
        margin: 15px 0;
    }
    
    .cpf-tab-content .cpf-field {
        padding: 10px;
    }
    
    .cpf-tab-content .cpf-field input,
    .cpf-tab-content .cpf-field select,
    .cpf-tab-content .cpf-field textarea {
        max-width: 100%;
    }
}