/* Montageberegner basic styles */
.mbr-root{font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif}
.mbr-card-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:16px}
.mbr-card{border:1px solid #ddd;border-radius:12px;padding:12px;background:#fff;cursor:pointer}
.mbr-card.selected{outline:3px solid #2271b1}
/* Row layout: keep spacing + color on the same line on desktop, compact the first 3 fields */
.mbr-row{display:grid;grid-template-columns:.6fr .6fr .6fr 2.2fr 1fr 2fr 1.2fr 1fr .8fr;gap:10px;align-items:end;margin:10px 0}
.mbr-row label{display:block;font-size:12px;color:#444;margin-bottom:4px}
.mbr-row input,.mbr-row select{width:100%;padding:8px;border:1px solid #ccc;border-radius:8px}
.mbr-remove{width:100%}
.mbr-actions{display:flex;gap:10px;margin-top:16px;flex-wrap:wrap}
.mbr-table{width:100%;border-collapse:collapse;margin-top:10px}
.mbr-table th,.mbr-table td{border-bottom:1px solid #eee;padding:8px;text-align:left;font-size:14px}
.mbr-lang{display:flex;gap:8px;align-items:center;margin-bottom:12px}

/* Roof type info section */
.mbr-roof-info{margin:14px 0 6px;padding:12px;border:1px solid #e5e5e5;border-radius:12px;background:#fff}
.mbr-roof-info-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
.mbr-roof-info-title{font-weight:700}
.mbr-roof-info-close{font-size:18px;line-height:18px;padding:0 10px;min-width:0}
.mbr-roof-explain{margin-top:10px;color:#333;font-size:14px;line-height:1.45}

/* WooCommerce-like product image list (works even if WC styles aren't loaded)
   Desktop: columns-4, Mobile: 2 columns */
.mbr-products{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;list-style:none;margin:0;padding:0}
.mbr-products .product{width:auto}
.mbr-products .product img{width:100%;height:auto;border-radius:10px;border:1px solid #eee;display:block}

@media (max-width: 860px){
  .mbr-products{grid-template-columns:repeat(2,1fr)}
}

@media (max-width: 480px){
  .mbr-products{grid-template-columns:repeat(2,1fr)}
}

/* Responsive row wrapping */
@media (max-width: 980px){
  .mbr-row{grid-template-columns:repeat(3,minmax(160px,1fr))}
}

@media (max-width: 720px){
  .mbr-row{grid-template-columns:repeat(2,minmax(160px,1fr))}
}

@media (max-width: 560px){
  .mbr-row{grid-template-columns:1fr}
}


/* Section 2 background */
.mbr-section-rows{background:#f5f5f5;padding:14px;border-radius:12px;margin-top:12px}


.mbr-system-picker{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-left:8px}
.mbr-system-label{font-weight:600}
.mbr-radio{display:inline-flex;align-items:center;gap:8px;border:1px solid #ccd0d4;background:#fff;border-radius:999px;padding:8px 12px;cursor:pointer}
.mbr-radio.selected{border-color:#2271b1;box-shadow:inset 0 0 0 1px #2271b1}
.mbr-radio-circle{width:14px;height:14px;border:2px solid #777;border-radius:50%;display:inline-block;position:relative}
.mbr-radio.selected .mbr-radio-circle{border-color:#2271b1}
.mbr-radio.selected .mbr-radio-circle:after{content:'';position:absolute;left:2px;top:2px;width:6px;height:6px;border-radius:50%;background:#2271b1}
.mbr-table select,.mbr-table input[type=number]{width:100%;min-width:140px}

.mbr-radio{display:inline-flex;align-items:center;gap:8px;padding:8px 14px;}
.mbr-radio-text{display:inline-block;}

/* Ensure system choice text is visible on light backgrounds */
.mbr-radio,.mbr-radio *{color:#000 !important;}
.mbr-radio{background:#fff !important;}


/* Ensure system choice text is visible */
.mbr-system-choice,
.mbr-system-choice label,
.mbr-system-choice span,
.mbr-system-card,
.mbr-system-card label,
.mbr-system-card span {
  color: #000 !important;
}


/* Align roof-type images consistently to the bottom of cards */
.mbr-card{display:flex;flex-direction:column;height:100%}
.mbr-card > div:first-child{min-height:3.8em}
.mbr-card img{
  margin-top:auto;
  width:100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display:block;
}
.mbr-card > div:last-child{margin-top:6px}


/* Roof-type change modal */
.mbr-modal-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.45);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
  z-index:99999;
}
.mbr-modal{
  width:min(420px, 100%);
  background:#fff;
  border-radius:18px;
  box-shadow:0 24px 60px rgba(0,0,0,.22);
  padding:22px;
}
.mbr-modal-title{
  font-size:20px;
  font-weight:700;
  color:#111;
  margin-bottom:16px;
}
.mbr-modal-actions{
  display:grid;
  gap:12px;
}
.mbr-modal-btn{
  width:100%;
  min-height:48px;
  border-radius:12px !important;
  font-size:15px;
  justify-content:center;
}
@media (max-width: 560px){
  .mbr-modal{padding:18px;border-radius:16px;}
  .mbr-modal-title{font-size:18px;}
}

.mbr-qty-mismatch{border-color:#c62828 !important;color:#c62828 !important;font-weight:700;}
.mbr-qty-note{margin-top:4px;color:#c62828;font-size:12px;line-height:1.35;}


.mbr-modal-actions{grid-template-columns:1fr;}



/* Mobile-first BOM cards for mounting and complete-system BOM */
@media (max-width: 768px){
  .mbr-bom-table thead{display:none;}
  .mbr-bom-table,
  .mbr-bom-table tbody,
  .mbr-bom-table tr,
  .mbr-bom-table td{display:block;width:100%;}
  .mbr-bom-table{border-collapse:separate;margin-top:8px;}
  .mbr-bom-table tr{
    margin-bottom:14px;
    border:1px solid #ddd;
    border-radius:12px;
    padding:12px;
    background:#fff;
    box-shadow:0 1px 2px rgba(0,0,0,.04);
  }
  .mbr-bom-table td{
    border:none;
    padding:6px 0;
    white-space:normal;
  }
  .mbr-bom-table td[data-label]::before{
    content: attr(data-label);
    display:block;
    font-weight:600;
    color:#555;
    margin-bottom:3px;
    font-size:12px;
    text-transform:none;
  }
  .mbr-bom-table td[data-label=""]::before{display:none;content:'';}
  .mbr-bom-table input[type=number],
  .mbr-bom-table select,
  .mbr-bom-table button{
    width:100%;
    min-width:0;
  }
}


.mbr-summary-card{margin-top:16px;margin-bottom:16px;padding:16px;border:1px solid #d7dde5;border-radius:18px;background:#fff;box-shadow:0 4px 14px rgba(15,23,42,.04)}
.mbr-summary-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:12px}
.mbr-summary-item{padding:12px;border:1px solid #e2e8f0;border-radius:14px;background:#f8fafc}
.mbr-summary-label{font-size:12px;color:#64748b;margin-bottom:4px}
.mbr-summary-value{font-size:20px;font-weight:700;color:#0f172a}
.mbr-dcac-wrap{margin-top:14px;padding:12px;border-radius:14px;background:#f8fafc;border:1px solid #e2e8f0}
.mbr-dcac-label{font-size:14px;font-weight:600;color:#334155;margin-bottom:10px}
.mbr-dcac-track{position:relative;height:12px;border-radius:999px;background:#dbe2ea;overflow:hidden}
.mbr-dcac-good{position:absolute;left:55.5%;width:27.8%;top:0;bottom:0;background:#86efac}
.mbr-dcac-marker{position:absolute;top:50%;width:3px;height:22px;background:#0f172a;border-radius:999px;transform:translate(-50%,-50%)}
.mbr-dcac-ticks{display:flex;justify-content:space-between;font-size:11px;color:#64748b;margin-top:8px}
.mbr-summary-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px}
@media (max-width: 768px){
  .mbr-summary-grid{grid-template-columns:1fr}
  .mbr-summary-actions{flex-direction:column}
  .mbr-summary-actions .button{width:100%}
}


.mbr-roof-graphics{margin-top:16px;margin-bottom:16px}
.mbr-roof-graphics-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.mbr-roof-card{padding:14px;border:1px solid #d7dde5;border-radius:18px;background:#fff;box-shadow:0 4px 14px rgba(15,23,42,.04)}
.mbr-roof-card-head{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:10px}
.mbr-roof-card-title{font-weight:700;color:#0f172a}
.mbr-roof-card-panels{font-size:12px;color:#475569}
.mbr-roof-card-stats{grid-template-columns:repeat(2,minmax(0,1fr))}

.mbr-ground-visual{display:grid;align-items:start;margin-bottom:10px}
.mbr-ground-board{padding:4px;border:1px solid #cbd5e1;border-radius:8px;background:#f8fafc;width:max-content}
.mbr-ground-board-grid{display:grid;grid-template-columns:repeat(6,16px);grid-auto-rows:8px;column-gap:2px;row-gap:2px}
.mbr-ground-panel{border:1px solid #cbd5e1;border-radius:2px;background:#e2e8f0}


.mbr-roof-panels-grid{display:grid;gap:4px;margin-bottom:10px;justify-items:start;align-items:start}
.mbr-roof-panel-block{box-sizing:border-box;display:block;flex:none;border:1px solid #cbd5e1;border-radius:5px;background:#e2e8f0;justify-self:start;align-self:start}
.mbr-roof-panel-block.portrait{width:28px;height:64px}
.mbr-roof-panel-block.landscape{width:64px;height:28px}


.mbr-roof-stat span{display:block !important;margin-bottom:4px !important}
.mbr-roof-stat strong{display:block !important;line-height:1.35 !important}

.mbr-roof-graphics-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,max-content));gap:14px;align-items:start}
.mbr-roof-card{width:max-content;max-width:none;min-width:320px}
@media (max-width: 768px){
  .mbr-roof-graphics-grid{grid-template-columns:1fr}
  .mbr-roof-card{width:auto;max-width:100%;min-width:0}
}
