/* ==========================================================================
   WC M² Calculator - Frontend Styles
   ========================================================================== */

.wc-m2-calculator {
    background: #f4f7fb;
    border-radius: 12px;
    padding: 24px;
    margin: 20px 0;
    font-family: inherit;
}

/* Header */
.wc-m2-calc__header {
    margin-bottom: 16px;
}

.wc-m2-calc__header strong {
    font-size: 1.1em;
    color: #1a2744;
}

.wc-m2-calc__header::after {
    content: '';
    display: block;
    width: 100%;
    height: 1px;
    background: #d8dfe8;
    margin-top: 10px;
}

/* Input row */
.wc-m2-calc__input-row {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.wc-m2-calc__input-wrap {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #d8dfe8;
    border-radius: 8px;
    padding: 0;
    flex: 1;
    min-width: 160px;
    max-width: 280px;
    overflow: hidden;
}

.wc-m2-calc__input {
    border: none !important;
    background: transparent !important;
    padding: 12px 14px !important;
    font-size: 16px !important;
    width: 100% !important;
    margin: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    -moz-appearance: textfield;
}

.wc-m2-calc__input::-webkit-outer-spin-button,
.wc-m2-calc__input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.wc-m2-calc__input::placeholder {
    color: #a0aec0;
    font-size: 14px;
}

.wc-m2-calc__unit {
    padding: 0 14px 0 4px;
    color: #4a5568;
    font-size: 16px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Calculate button */
.wc-m2-calc__btn {
    background: #ffffff !important;
    color: #1a2744 !important;
    border: 2px solid #1a2744 !important;
    border-radius: 25px !important;
    padding: 10px 24px !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    white-space: nowrap;
    line-height: 1.4 !important;
}

.wc-m2-calc__btn:hover {
    background: #1a2744 !important;
    color: #ffffff !important;
}

/* Cutting loss checkbox */
.wc-m2-calc__cutting-loss {
    margin-bottom: 8px;
}

.wc-m2-calc__cutting-loss label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #4a5568;
    cursor: pointer;
}

.wc-m2-calc__cutting-loss input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
}

.wc-m2-calc__cutting-pct {
    color: #718096;
    font-size: 13px;
}

/* Result area */
.wc-m2-calc__result {
    margin-top: 16px;
}

.wc-m2-calc__result-info {
    background: #ffffff;
    border: 1px solid #d8dfe8;
    border-radius: 8px;
    padding: 16px 20px;
    position: relative;
    margin-bottom: 16px;
}

.wc-m2-calc__packs {
    font-size: 16px;
    color: #1a2744;
    margin-bottom: 4px;
}

.wc-m2-calc__packs strong {
    font-size: 18px;
}

.wc-m2-calc__content {
    font-size: 14px;
    color: #718096;
}

/* Clear button (×) */
.wc-m2-calc__clear {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none !important;
    border: none !important;
    font-size: 24px !important;
    color: #a0aec0 !important;
    cursor: pointer !important;
    padding: 0 !important;
    line-height: 1 !important;
    width: auto !important;
    height: auto !important;
}

.wc-m2-calc__clear:hover {
    color: #4a5568 !important;
}

/* Pricing */
.wc-m2-calc__pricing {
    padding: 0 4px;
}

.wc-m2-calc__total-label {
    font-size: 14px;
    font-weight: 600;
    color: #1a2744;
    margin-bottom: 4px;
}

.wc-m2-calc__total-label::after {
    content: '';
    display: block;
    width: 100%;
    height: 1px;
    background: #d8dfe8;
    margin-top: 6px;
}

.wc-m2-calc__total-price {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-top: 8px;
}

.wc-m2-calc__price {
    font-size: 28px;
    font-weight: 700;
    color: #1a2744;
}

.wc-m2-calc__regular-price {
    font-size: 16px;
    color: #a0aec0;
    text-decoration: line-through;
    display: none;
}

/* Discount */
.wc-m2-calc__discount {
    margin-top: 6px;
    display: none;
}

.wc-m2-calc__discount-amount {
    font-weight: 700;
    color: #e67e22;
    font-size: 15px;
}

.wc-m2-calc__discount-text {
    color: #e67e22;
    font-size: 14px;
}

/* Shake animation for validation */
@keyframes wc-m2-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

.wc-m2-calc--shake {
    animation: wc-m2-shake 0.4s ease-in-out;
    box-shadow: 0 0 0 2px #e53e3e;
}

/* Responsive */
@media (max-width: 480px) {
    .wc-m2-calc__input-row {
        flex-direction: column;
        align-items: stretch;
    }

    .wc-m2-calc__input-wrap {
        max-width: 100%;
    }

    .wc-m2-calc__btn {
        text-align: center;
    }

    .wc-m2-calc__price {
        font-size: 24px;
    }
}
