/**
 * Frontend Styles
 */

.ferle-order-form-v2 {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.ferle-form-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.ferle-form-header h2 {
    margin: 0 0 10px 0;
    color: #333;
}

.ferle-form-header p {
    margin: 0;
    color: #666;
}

.ferle-form-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 5px;
}

.ferle-form-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}

/* Products Grid */
.ferle-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.ferle-product-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    transition: box-shadow 0.3s;
}

.ferle-product-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.ferle-product-image img {
    width: 100%;
    height: auto;
    border-radius: 5px;
    margin-bottom: 15px;
}

.ferle-product-info h4 {
    margin: 0 0 10px 0;
    color: #333;
}

.ferle-product-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.ferle-product-analytes {
    font-size: 13px;
    margin-bottom: 10px;
}

.ferle-product-analytes ul {
    margin: 5px 0;
    padding-left: 20px;
}

.ferle-product-price {
    font-weight: bold;
    color: #2e7d32;
    font-size: 18px;
    margin-bottom: 10px;
}

.ferle-product-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ferle-product-quantity label {
    font-weight: bold;
}

.ferle-product-quantity input {
    width: 80px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

/* Custom Builder */
.ferle-custom-analytes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.ferle-custom-analyte-item label {
    display: block;
    padding: 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.2s;
}

.ferle-custom-analyte-item label:hover {
    background: #f0f0f0;
}

.ferle-custom-analyte-item input[type="checkbox"]:checked + span {
    font-weight: bold;
    color: #2e7d32;
}

.ferle-custom-panel-info {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 15px;
}

.ferle-panel-price {
    font-weight: bold;
    color: #2e7d32;
    font-size: 18px;
}

.ferle-custom-panel-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Form Fields */
.ferle-form-fields .ferle-form-field {
    margin-bottom: 15px;
}

.ferle-form-fields label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}

.ferle-form-fields input[type="text"],
.ferle-form-fields input[type="email"],
.ferle-form-fields input[type="tel"],
.ferle-form-fields textarea,
.ferle-form-fields select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
}

.ferle-form-fields textarea {
    min-height: 100px;
    resize: vertical;
}

.ferle-form-fields .required {
    color: #f44336;
}

/* Order Summary */
.ferle-order-summary table {
    width: 100%;
    border-collapse: collapse;
}

.ferle-order-summary th,
.ferle-order-summary td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.ferle-order-summary th {
    background: #f5f5f5;
    font-weight: bold;
}

.ferle-total-row {
    background: #f5f5f5;
    font-size: 16px;
}

/* Submit Button */
.ferle-submit-btn {
    width: 100%;
    padding: 15px;
    background: #2e7d32;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.ferle-submit-btn:hover {
    background: #1b5e20;
}

/* Loading */
.ferle-loading {
    text-align: center;
    padding: 20px;
}

.ferle-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2e7d32;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: ferle-spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

/* Messages */
.ferle-success-message {
    text-align: center;
    padding: 40px 20px;
    background: #e8f5e9;
    border-radius: 5px;
    color: #2e7d32;
}

.ferle-error-message {
    padding: 20px;
    background: #ffebee;
    border-radius: 5px;
    color: #c62828;
    margin-bottom: 20px;
}

/* Empty state */
.ferle-no-products,
.ferle-empty-summary {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    .ferle-order-form-v2 {
        padding: 10px;
    }

    .ferle-products-grid {
        grid-template-columns: 1fr;
    }

    .ferle-custom-analytes-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ferle-custom-panel-info {
        flex-direction: column;
        gap: 10px;
    }

    .ferle-order-summary {
        font-size: 14px;
    }
}
