/**
 * WooCommerce Flooring Calculator - Frontend Styles
 */

.wfc-calculator-wrapper {
    margin: 20px 0;
    max-width: 100%;
}

.wfc-calculator-box {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Input Section */
.wfc-input-section {
    margin-bottom: 16px;
}

.wfc-label {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 10px;
}

.wfc-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #f9fafb;
    color: #1a1a1a;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
    -moz-appearance: textfield;
}

.wfc-input::-webkit-outer-spin-button,
.wfc-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.wfc-input:focus {
    border-color: #374151;
    box-shadow: 0 0 0 2px rgba(55, 65, 81, 0.1);
    background: #ffffff;
}

.wfc-input::placeholder {
    color: #9ca3af;
}

/* Wastage Section */
.wfc-wastage-section {
    margin-bottom: 16px;
}

.wfc-wastage-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #4b5563;
    cursor: pointer;
    font-weight: 400;
}

.wfc-wastage-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #374151;
}

/* Divider */
.wfc-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 16px 0;
}

/* Results Section */
.wfc-results-section {
    animation: wfcFadeIn 0.3s ease;
}

@keyframes wfcFadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wfc-result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.wfc-result-label {
    font-size: 14px;
    color: #4b5563;
    font-weight: 400;
}

.wfc-result-value {
    font-size: 14px;
    color: #1a1a1a;
    font-weight: 600;
}

/* Total Row */
.wfc-total-row {
    padding: 12px 0;
}

.wfc-total-label {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
}

.wfc-total-value {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
}

/* Colour attribute dropdown */
.wfc-color-section {
    margin: 4px 0 16px;
}

.wfc-color-select {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #f9fafb;
    color: #1a1a1a;
    outline: none;
    box-sizing: border-box;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wfc-color-select:focus {
    border-color: #374151;
    box-shadow: 0 0 0 2px rgba(55, 65, 81, 0.1);
    background: #ffffff;
}

/* Hide the WooCommerce quantity input when the calculator is active */
.wfc-hide-quantity .quantity,
.wfc-hide-quantity div.quantity,
.wfc-hide-quantity .qty {
    display: none !important;
}

/* Colour swatches */
.wfc-native-select-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.wfc-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 8px 0 4px;
}

.wfc-swatch {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    border: 2px solid #e5e7eb;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    cursor: pointer;
    padding: 0;
    transition: border-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
    outline: none;
}

.wfc-swatch:hover {
    border-color: #9ca3af;
    transform: translateY(-1px);
}

.wfc-swatch.is-selected {
    border-color: #1a1a1a;
    box-shadow: 0 0 0 2px rgba(26, 26, 26, 0.15);
}

.wfc-swatch--label {
    width: auto;
    min-width: 44px;
    padding: 0 12px;
    font-size: 13px;
    font-weight: 500;
    color: #1a1a1a;
    background: #f9fafb;
}

.wfc-swatch-selected-label {
    font-size: 13px;
    color: #4b5563;
    margin-bottom: 8px;
    min-height: 18px;
}

/* Responsive */
@media (max-width: 768px) {
    .wfc-calculator-box {
        padding: 16px;
    }

    .wfc-label {
        font-size: 15px;
    }

    .wfc-input {
        padding: 12px 14px;
        font-size: 15px;
    }

    .wfc-total-label,
    .wfc-total-value {
        font-size: 16px;
    }
}
