/* MAY Panel Calculator — Frontend v2.2 */
.may-panel-calculator {
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    margin: 15px 0 20px 0;
    background: #fafafa;
    overflow: hidden;
    max-width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 50;
}
.may-calc-header {
    display: flex; align-items: center; padding: 14px 16px;
    cursor: pointer; background: #f5f5f5; border-bottom: 1px solid #e8e8e8;
    user-select: none; transition: background 0.2s;
    position: relative;
    z-index: 51;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
}
.may-calc-header:hover { background: #eee; }
.may-calc-icon { font-size: 20px; margin-right: 10px; }
.may-calc-title { font-size: 15px; font-weight: 600; color: #333; flex-grow: 1; }
.may-calc-arrow { font-size: 12px; color: #888; transition: transform 0.3s; }
.may-calc-arrow.open { transform: rotate(180deg); }
.may-calc-body { padding: 16px; display: none; }
.may-calc-body.open { display: block; }

.may-calc-product-dims {
    background: #fff; border: 1px solid #e0e0e0; border-radius: 6px;
    padding: 10px 14px; margin-bottom: 16px; color: #555;
}
.may-calc-product-dims small { font-size: 13px; }

/* ===== INPUTS ===== */
.may-panel-calculator .may-calc-inputs {
    display: flex; flex-direction: column; gap: 14px;
    margin-bottom: 16px; width: 100%; box-sizing: border-box;
}
.may-panel-calculator .may-calc-field {
    width: 100% !important; max-width: 100% !important; box-sizing: border-box;
}
.may-panel-calculator .may-calc-field label {
    display: block; font-size: 14px; font-weight: 600; color: #333; margin-bottom: 6px;
}
#may-panel-calculator input#may-wall-width,
#may-panel-calculator input#may-wall-height {
    display: block !important; width: 100% !important; max-width: 100% !important;
    min-width: 0 !important; padding: 14px 16px !important;
    border: 2px solid #ccc !important; border-radius: 8px !important;
    font-size: 18px !important; font-weight: 500 !important; color: #222 !important;
    background: #fff !important; box-sizing: border-box !important;
    -webkit-appearance: none !important; -moz-appearance: textfield !important;
    height: auto !important; line-height: normal !important; margin: 0 !important;
    transition: border-color 0.2s, box-shadow 0.2s;
}
#may-panel-calculator input#may-wall-width:focus,
#may-panel-calculator input#may-wall-height:focus {
    outline: none !important; border-color: #0073aa !important;
    box-shadow: 0 0 0 3px rgba(0,115,170,.15) !important;
}
#may-panel-calculator input::placeholder { color: #aaa !important; font-weight: 400 !important; }
#may-panel-calculator input[type="number"]::-webkit-outer-spin-button,
#may-panel-calculator input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none !important; margin: 0 !important;
}

/* Button */
.may-panel-calculator .may-calc-button {
    display: block; width: 100%; padding: 14px 20px;
    background: #0073aa; color: #fff; border: none; border-radius: 8px;
    font-size: 16px; font-weight: 600; cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
}
.may-panel-calculator .may-calc-button:hover { background: #005d8c; }
.may-panel-calculator .may-calc-button:active { transform: scale(0.98); }

/* Result */
.may-calc-result {
    margin-top: 16px; padding: 14px 16px; border-radius: 8px;
    background: #e8f5e9; border: 1px solid #a5d6a7;
}
.may-calc-result-number { font-size: 22px; font-weight: 700; color: #2e7d32; margin-bottom: 8px; }
.may-calc-result .may-calc-tip {
    margin-top: 10px; padding: 10px 12px; background: #fff3e0;
    border: 1px solid #ffe0b2; border-radius: 6px; font-size: 13px; color: #e65100;
}
.may-calc-result .may-calc-qty-notice { margin-top: 10px; font-size: 14px; color: #2e7d32; font-weight: 600; }
.may-calc-result.error { background: #ffebee; border-color: #ef9a9a; }
.may-calc-result.error .may-calc-result-number { color: #c62828; font-size: 14px; font-weight: 500; }

/* ===== ACCESSORIES ===== */
#may-calc-accessories { margin-top: 16px; }
.may-acc-title {
    font-size: 15px; font-weight: 700; color: #333;
    margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid #e0e0e0;
}
.may-acc-item {
    display: flex; align-items: center; gap: 12px; padding: 12px;
    margin-bottom: 8px; background: #fff; border: 1px solid #e0e0e0;
    border-radius: 8px; cursor: pointer; transition: border-color 0.2s, box-shadow 0.2s;
}
.may-acc-item:hover { border-color: #0073aa; box-shadow: 0 0 0 2px rgba(0,115,170,.1); }
.may-acc-item.unchecked { opacity: 0.5; }
.may-acc-checkbox { flex-shrink: 0; width: 20px; height: 20px; accent-color: #0073aa; cursor: pointer; }
.may-acc-img { width: 50px; height: 50px; object-fit: cover; border-radius: 6px; flex-shrink: 0; border: 1px solid #eee; }
.may-acc-info { flex: 1; min-width: 0; }
.may-acc-name { font-weight: 600; font-size: 14px; color: #333; display: block; margin-bottom: 2px; }
.may-acc-name a { color: inherit; text-decoration: none; }
.may-acc-name a:hover { text-decoration: underline; color: #0073aa; }
.may-acc-meta { font-size: 13px; color: #666; }
.may-acc-type-badge {
    display: inline-block; background: #eee; color: #555;
    padding: 1px 8px; border-radius: 3px; font-size: 11px; font-weight: 600; margin-right: 6px;
}
.may-acc-qty-price { text-align: right; flex-shrink: 0; white-space: nowrap; }
.may-acc-qty { display: block; font-size: 15px; font-weight: 700; color: #222; }
.may-acc-price { display: block; font-size: 12px; color: #888; }

/* Accessory cart button */
.may-acc-add-button {
    display: block; width: 100%; padding: 14px 20px; margin-top: 14px;
    background: #2e7d32; color: #fff; border: none; border-radius: 8px;
    font-size: 16px; font-weight: 600; cursor: pointer;
    transition: background 0.2s, transform 0.1s, opacity 0.2s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
}
.may-acc-add-button:hover { background: #1b5e20; }
.may-acc-add-button:active { transform: scale(0.98); }
.may-acc-add-button:disabled { opacity: 0.7; cursor: wait; }

/* Accessory add-to-cart button (green, separate from WC button) */

/* Desktop */
@media (min-width: 600px) {
    .may-panel-calculator .may-calc-inputs { flex-direction: row; gap: 16px; }
    .may-panel-calculator .may-calc-field { flex: 1 1 0% !important; }
}
/* Small mobile */
@media (max-width: 480px) {
    .may-calc-body { padding: 12px; }
    #may-panel-calculator input#may-wall-width,
    #may-panel-calculator input#may-wall-height { padding: 12px 14px !important; font-size: 16px !important; }
    .may-calc-result-number { font-size: 18px; }
    .may-panel-calculator .may-calc-button { padding: 12px 16px; font-size: 15px; }
    .may-acc-item { gap: 8px; padding: 10px; }
    .may-acc-img { width: 40px; height: 40px; }
}
