/* =========================================================================
   ROOF TYPE CARDS — FINAL AUTHORITATIVE STYLING
   Restores: clean rounded image on top + a separate YELLOW label box
   (yellow background, yellow outline, blue text) below. No divider lines.
   Works on desktop, tablet, mobile.
   Loaded LAST so it overrides the "images only / no labels" experiment.
   ========================================================================= */

/* Grid: 3 across on desktop, responsive down */
#stepRoofType .roof-type-grid,
.roof-type-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 22px !important;
  align-items: stretch !important;
  max-width: 980px !important;
  margin: 0 auto !important;
}

/* Card: ONE yellow outline around the whole thing. Image fills top,
   label box fills bottom, sharing the single frame — no doubled lines. */
#stepRoofType .roof-type-card,
.roof-type-card {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  width: 100% !important;
  max-width: 100% !important;
  padding: 0 !important;
  gap: 0 !important;
  background: #f2b705 !important;           /* YELLOW default (match frame, no gap) */
  border: 3px solid #f2b705 !important;     /* single YELLOW outline by default */
  border-radius: 16px !important;
  overflow: hidden !important;              /* clip image + label to the frame */
  cursor: pointer !important;
  box-shadow: 0 8px 20px rgba(5, 31, 61, .12) !important;
  position: relative !important;
}

/* kill any pseudo-element overlays from older fixes */
#stepRoofType .roof-type-card::before,
#stepRoofType .roof-type-card::after,
.roof-type-card::before,
.roof-type-card::after {
  display: none !important;
  content: none !important;
}

/* Image: fills the top, flush to the frame, NO border/line of its own */
#stepRoofType .roof-type-card img,
.roof-type-card img {
  display: block !important;
  width: 100% !important;
  height: 200px !important;
  aspect-ratio: auto !important;
  object-fit: cover !important;
  object-position: center center !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  outline: 0 !important;
  background: #f5f5f5 !important;
  filter: none !important;
  box-shadow: none !important;
}

/* LABEL: box at the bottom inside the same frame — NO border of its own */
#stepRoofType .roof-type-label,
#stepRoofType .roof-type-card span,
.roof-type-card .roof-type-label {
  display: flex !important;
  visibility: visible !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  min-height: 56px !important;
  height: auto !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 12px 10px !important;
  box-sizing: border-box !important;
  background: #f2b705 !important;          /* YELLOW background by default */
  color: #ffffff !important;               /* WHITE text by default */
  border: 0 !important;                    /* no extra line — frame is the card's */
  border-radius: 0 !important;
  font-family: Impact, Haettenschweiler, 'Arial Narrow Bold', 'Oswald', sans-serif !important;
  font-weight: 900 !important;
  letter-spacing: .04em !important;
  text-transform: uppercase !important;
  text-align: center !important;
  line-height: 1.05 !important;
  font-size: clamp(1rem, 1.6vw, 1.45rem) !important;
  overflow: visible !important;
  white-space: normal !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
}

/* Selected/pressed: STAY yellow, just add a blue outer border around the box */
#stepRoofType .roof-type-card.selected,
.roof-type-card.selected {
  border-color: #051f3d !important;        /* blue outer border when selected */
  background: #f2b705 !important;          /* stays yellow */
  outline: 0 !important;
  box-shadow: 0 0 0 3px #051f3d !important; /* crisp blue outer ring */
}
#stepRoofType .roof-type-card.selected img,
.roof-type-card.selected img {
  outline: 0 !important;
  border: 0 !important;
}
#stepRoofType .roof-type-card.selected .roof-type-label,
.roof-type-card.selected .roof-type-label {
  background: #f2b705 !important;          /* label stays yellow */
  color: #ffffff !important;               /* white text stays */
  border: 0 !important;
}

/* ---------- TABLET ---------- */
@media (max-width: 900px) {
  #stepRoofType .roof-type-grid,
  .roof-type-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    max-width: 720px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    justify-items: center !important;
  }
  #stepRoofType .roof-type-card img,
  .roof-type-card img {
    height: 180px !important;
  }
}

/* ---------- MOBILE ---------- */
@media (max-width: 560px) {
  #stepRoofType .roof-type-grid,
  .roof-type-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    max-width: 420px !important;     /* keep cards a comfortable width */
    margin-left: auto !important;
    margin-right: auto !important;
    justify-items: center !important;
  }
  #stepRoofType .roof-type-card,
  .roof-type-card {
    width: 100% !important;
    max-width: 380px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  #stepRoofType .roof-type-card img,
  .roof-type-card img {
    height: 200px !important;
  }
  #stepRoofType .roof-type-label,
  .roof-type-card .roof-type-label {
    min-height: 52px !important;
    font-size: 1.2rem !important;
  }
}
