/* =====================================================
   REDWOP TILE CALCULATOR - Modern UI
   ===================================================== */
@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=Inter:wght@400;500;600&display=swap");

#rwcalc,
#rwcalc * {
  box-sizing: border-box;
}

#rwcalc {
  --rw-primary: #FF0000;
  --rw-primary-dark: #cc0000;
  --rw-ink: #1a1a1a;
  --rw-muted: #666666;
  --rw-glass: #ffffff;
  --rw-glass-border: #eeeeee;
  --rw-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  --rw-shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.03);
  font-family: "SF Compact Text", -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
  max-width: 100%;
  margin: 40px auto;
  padding: 30px 10px;
  border-radius: 12px;
  background: #F3F3F3;
}

#rwcalc .rw-hdr {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid rgba(236, 238, 245, 0.6);
  text-align: center;
}

#rwcalc .rw-title {
  font-family: "Outfit", "Google Sans", sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--rw-ink);
  letter-spacing: -0.02em;
}

#rwcalc .rw-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 1.5rem;
  background: rgba(35, 45, 66, 0.04);
  padding: 5px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.03);
  position: relative;
}

/* --- Search Bar --- */
.rw-search-wrap {
  margin-bottom: 1.5rem;
}

#rw-psearch {
  width: 100%;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1.5px solid #eeeeee;
  background: #fdfdfd;
  font-family: inherit;
  font-size: 14px;
  transition: all 0.3s ease;
  outline: none;
}

#rw-psearch:focus {
  border-color: var(--rw-primary);
  background: white;
  box-shadow: 0 0 0 4px rgba(255, 0, 0, 0.08);
}

#rwcalc .rw-tab {
  flex: 1;
  /*   padding: 0.75rem 1rem; */
  font-size: 0.88rem;
  font-weight: 600;
  border: 0;
  border-radius: 999px;
  color: var(--rw-muted);
  background: transparent;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  white-space: nowrap;
}

#rwcalc .rw-tab:hover:not(.rw-on) {
  color: #111;
  background: rgba(255, 255, 255, 0.5);
}

#rwcalc .rw-tab.rw-on {
  background: #fff;
  color: var(--rw-primary);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.08),
    0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Category Headers */
#rwcalc .rw-cat-hdr {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 15px;
  border-left: 4px solid var(--rw-primary);
}

#rwcalc .rw-cat-icon {
  font-size: 2rem;
  background: #fff;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  box-shadow: var(--rw-shadow-soft);
}

#rwcalc .rw-cat-title {
  font-family: "Outfit", sans-serif;
  font-size: 1.25rem !important;
  font-weight: 700;
  color: var(--rw-ink);
  margin: 0;
}

#rwcalc .rw-cat-desc {
  font-size: 0.84rem;
  color: var(--rw-muted);
  margin: 2px 0 0;
}

#rwcalc .rw-divider {
  display: none;
}

/* --- Category Tabs --- */
.rw-cat-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  padding: 10px 5px;
  margin-bottom: 2rem;
}

.rw-ctab {
  padding: 12px 15px;
  border-radius: 12px;
  background: white;
  border: 1px solid #eef0f7;
  color: #4a5568;
  font-size: 14px;
  line-height: 18px;
  font-weight: 600;
  cursor: pointer;
  white-space: normal;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.rw-ctab:hover {
  background: #f8fafc;
  transform: translateY(-1px);
  color: #000;
}

.rw-ctab.rw-on {
  background: rgba(204, 34, 34, 0.06);
  color: #000;
  border-color: var(--rw-primary);
  box-shadow: 0 4px 10px rgba(255, 0, 0, 0.2);
}

.rw-ctab.rw-on:focus {
  outline: none;

}





/* --- Category Boxes --- */
.rw-cat-box {
  display: none;
  animation: rwFadeUp 0.4s ease-out;
}

.rw-cat-box.rw-on {
  display: block;
}

@keyframes rwFadeUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  .rw-cat-tabs {
    grid-template-columns: repeat(2, 1fr);
    margin-left: -5px;
    margin-right: -5px;
    gap: 8px;
  }

  .rw-ctab {
    font-size: 13px;
    padding: 10px 8px;
  }
}

#rwcalc .rw-panel {
  display: none;
}

#rwcalc .rw-panel.rw-on {
  display: block;
}

#rwcalc .rw-grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

#rwcalc .rw-full {
  grid-column: 1 / -1;
}

#rwcalc .rw-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--rw-shadow-soft);
  transition: transform 0.2s ease;
}

#rwcalc .rw-slabel {
  font-family: "Outfit", sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #68728a;
  margin-bottom: 12px;
}

#rwcalc .rw-irow {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 1rem;
}

#rwcalc .rw-irow label {
  font-size: 0.84rem;
  color: #414a5f;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

#rwcalc .rw-irow input,
#rwcalc .rw-irow select {
  width: 100%;
  padding: 11px 12px;
  font-size: 0.92rem;
  color: var(--rw-ink);
  border: 1px solid #dbe1ea;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.92);
  transition: all 0.2s ease;
}

#rwcalc .rw-irow input:focus,
#rwcalc .rw-irow select:focus {
  outline: none;
  border-color: rgba(204, 34, 34, 0.45);
  box-shadow: 0 0 0 4px rgba(204, 34, 34, 0.11);
}

#rwcalc .rw-hint {
  font-size: 0.72rem;
  color: #8f97aa;
}

#rwcalc .rw-badge {
  font-size: 0.62rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
}

#rwcalc .rw-req {
  background: rgba(204, 34, 34, 0.12);
  color: #9c1d1d;
}

#rwcalc .rw-opt {
  background: #eef2f8;
  color: #647089;
}

/* ---- Product Grid ---- */
#rwcalc .rw-pgrid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

#rwcalc .rw-pchip {
  border: 1px solid #dbe2ec;
  border-radius: 12px;
  padding: 9px 4px 7px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: all 0.22s ease;
}

#rwcalc .rw-pchip:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.09);
}

#rwcalc .rw-pchip.rw-sel {
  border-color: var(--rw-primary);
  background: rgba(204, 34, 34, 0.06);
  box-shadow: 0 0 0 3px rgba(204, 34, 34, 0.08);
}

#rwcalc .rw-chip-pulse {
  animation: rwChipPulse 0.35s ease;
}

@keyframes rwChipPulse {
  0% {
    transform: scale(0.96);
  }

  100% {
    transform: scale(1);
  }
}

#rwcalc .rw-pimg {
  width: 50px;
  height: 60px;
  margin: 0 auto 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.12));
  transition: transform 0.22s ease;
}

#rwcalc .rw-pchip:hover .rw-pimg {
  transform: scale(1.1) translateY(-2px);
}

#rwcalc .rw-pimg img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

#rwcalc .rw-pname {
  font-size: 0.65rem;
  font-weight: 600;
  color: #2b3243;
  transition: color 0.2s ease;
  line-height: 1.2;
}

#rwcalc .rw-pname.rw-active {
  color: var(--rw-primary);
}

/* density factor shown below product name */
#rwcalc .rw-pdensity {
  font-size: 0.58rem;
  color: #9ba5bb;
  margin-top: 2px;
  font-family: "Outfit", monospace;
}

/* ⚠️ warning badge on product chip */
#rwcalc .rw-warn-badge {
  font-size: 0.6rem;
  margin-left: 2px;
  vertical-align: middle;
  cursor: help;
}

#rwcalc .rw-proc {
  font-size: 0.77rem;
  color: #4a556d;
  line-height: 1.6;
  padding: 0.78rem 0.85rem;
  background: #f4f7fc;
  border-radius: 10px;
  margin-top: 1rem;
}

#rwcalc .rw-brow {
  display: flex;
  gap: 8px;
  margin-top: 1rem;
}

#rwcalc .rw-btn {
  flex: 1;
  border: 1px solid #d4dde9;
  background: rgba(255, 255, 255, 0.88);
  color: #21293a;
  /*   padding: 10px 14px; */
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

#rwcalc .rw-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.12);
}

#rwcalc .rw-btnp {
    background: rgba(204, 34, 34, 0.06);
    color: #000;
	line-height: 13px;
    border-color: var(--rw-primary);
    
}

#rwcalc .rw-btnp:hover {
  box-shadow: 0 10px 22px rgba(204, 34, 34, 0.35);
}

#rwcalc .rw-note {
  font-size: 0.72rem;
  color: #79839b;
  margin-top: 0.58rem;
}

#rwcalc .rw-err {
  font-size: 0.8rem;
  color: #9d1f1f;
  background: rgba(204, 34, 34, 0.1);
  border-radius: 10px;
  padding: 9px 12px;
  margin-top: 8px;
  display: none;
}

/* ---- Result Card ---- */
#rwcalc #rw-rescard {
  display: none;
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 0.28s ease,
    transform 0.28s ease;
}

#rwcalc #rw-rescard.rw-show {
  opacity: 1;
  transform: translateY(0);
}

#rwcalc .rw-res {
  background: linear-gradient(145deg, #f8fafc 0%, #fff 100%);
  border: 1px solid #eef2f8;
  border-radius: 14px;
  padding: 1.15rem;
  display: grid;
  grid-template-columns: auto 1px 1fr 1px 1fr;
  gap: 16px;
  align-items: center;
}

#rwcalc .rw-res-img {
  text-align: center;
}

#rwcalc .rw-res-pimg {
  width: 80px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.15));
}

#rwcalc .rw-res-pimg img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

#rwcalc .rw-res-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--rw-primary);
  margin-top: 4px;
}

#rwcalc .rw-res-sel {
  font-size: 9px;
  color: #8b94a8;
}

#rwcalc .rw-mdiv {
  background: #e6ebf2;
  align-self: stretch;
  width: 1px;
}

#rwcalc .rw-metric {
  text-align: center;
}

#rwcalc .rw-mval {
  font-family: "Outfit", sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: #101623;
  line-height: 1;
}

#rwcalc .rw-munit {
  font-size: 0.75rem;
  color: #617088;
  margin-top: 3px;
}

#rwcalc .rw-mlabel {
  font-size: 0.72rem;
  color: #8b96ad;
  margin-top: 3px;
}

#rwcalc .rw-tag {
  display: inline-flex;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.68rem;
  margin: 2px;
}

#rwcalc .rw-tg {
  background: #eaf3de;
  color: #2a6010;
}

#rwcalc .rw-tb {
  background: #e6f1fb;
  color: #0c447c;
}

#rwcalc .rw-params {
  font-size: 0.7rem;
  color: #7f8aa2;
  margin-top: 5px;
}

/* ---- Product link button (in result) ---- */
#rwcalc .rw-product-link-wrap {
  margin-top: 1rem;
  text-align: center;
}

#rwcalc #rw-product-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  background: #fff;
  border: 1.5px solid rgba(204, 34, 34, 0.35);
  color: var(--rw-primary);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.22s ease;
  box-shadow: 0 2px 8px rgba(204, 34, 34, 0.07);
}

#rwcalc #rw-product-link:hover {
  background: var(--rw-primary);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 20px rgba(204, 34, 34, 0.28);
  transform: translateY(-1px);
}

#rwcalc #rw-product-link.rw-link-warn {
  border-color: rgba(200, 134, 26, 0.45);
  color: #9a6300;
  box-shadow: 0 2px 8px rgba(200, 134, 26, 0.1);
}

#rwcalc #rw-product-link.rw-link-warn:hover {
  background: #c8861a;
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 20px rgba(200, 134, 26, 0.3);
}

/* ---- Warn notice below result ---- */
#rwcalc #rw-warn-notice {
  display: none;
  margin-top: 0.75rem;
  padding: 10px 14px;
  background: rgba(200, 134, 26, 0.1);
  border: 1px solid rgba(200, 134, 26, 0.25);
  border-radius: 10px;
  font-size: 0.78rem;
  color: #7a4e00;
  line-height: 1.5;
}

/* ---- History rows ---- */
#rwcalc .rw-hrow {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #edf1f7;
  font-size: 0.82rem;
  gap: 14px;
}

#rwcalc .rw-hrow:last-child {
  border: none;
}

#rwcalc .rw-hdate {
  flex-shrink: 0;
  min-width: 90px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #4a556d;
  background: #f0f3f8;
  padding: 5px 10px;
  border-radius: 8px;
  text-align: center;
  white-space: nowrap;
}

#rwcalc .rw-hinfo {
  flex: 1;
  color: #2b3243;
  line-height: 1.4;
}

#rwcalc .rw-hinfo strong {
  font-weight: 700;
  color: #101623;
}

#rwcalc .rw-htime {
  font-size: 0.72rem;
  color: #8b96ad;
}

#rwcalc .rw-hview {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  background: #2563eb;
  color: #fff;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}

#rwcalc .rw-hview:hover {
  background: #1d4ed8;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}

#rwcalc .rw-empty {
  text-align: center;
  font-size: 0.8rem;
  color: #8993a9;
  padding: 1.5rem 0;
}

@media (max-width: 480px) {
  #rwcalc .rw-hdate {
    min-width: 72px;
    font-size: 0.7rem;
    padding: 4px 6px;
  }

  #rwcalc .rw-hview {
    padding: 5px 12px;
    font-size: 0.7rem;
  }
}

/* ---- Product table (All products tab) ---- */
#rwcalc .rw-table {
  width: 100%;
  font-size: 0.82rem;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 10px;
}

#rwcalc .rw-table th {
  text-align: left;
  padding: 8px 10px;
  font-weight: 600;
  color: #5f6b82;
  background: #f4f7fc;
}

#rwcalc .rw-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #edf1f7;
  color: #3d465a;
}

#rwcalc .rw-table tr:last-child td {
  border: none;
}

/* warn row in table */
#rwcalc .rw-table tr.rw-row-warn td {
  background: rgba(200, 134, 26, 0.04);
}

/* colour dot in table */
#rwcalc .rw-tbl-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ⚠️ inline warn text in table */
#rwcalc .rw-warn-inline {
  font-size: 0.7rem;
  color: #9a6300;
  background: rgba(200, 134, 26, 0.12);
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 4px;
}

/* View link in table */
#rwcalc .rw-tbl-link {
  display: inline-block;
  padding: 3px 10px;
  border: 1px solid rgba(204, 34, 34, 0.3);
  border-radius: 20px;
  color: var(--rw-primary);
  font-size: 0.72rem;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.18s ease;
}

#rwcalc .rw-tbl-link:hover {
  background: var(--rw-primary);
  color: #fff;
  border-color: transparent;
}

/* ---- Responsive ---- */
@media (max-width: 820px) {
  #rwcalc .rw-grid2 {
    grid-template-columns: 1fr;
  }

  #rwcalc .rw-res {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  #rwcalc .rw-mdiv {
    display: none;
  }

  #rwcalc .rw-pgrid {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 640px) {
  #rwcalc {
    padding: 20px 10px;
    border-radius: 14px;
  }

  #rwcalc .rw-tabs {
    overflow-x: auto;
    scrollbar-width: none;
  }

  #rwcalc .rw-tabs::-webkit-scrollbar {
    display: none;
  }

  #rwcalc .rw-tab {
    white-space: normal;
    font-size: 10px;
    line-height: 14px;
  }

  #rwcalc .rw-hdr {
    padding-bottom: 1rem;
    margin-bottom: 1rem;
  }

  #rwcalc .rw-title {
    font-size: 1.25rem;
  }

  #rwcalc .rw-pgrid {
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
  }

  #rwcalc .rw-pbag {
    width: 26px;
    height: 33px;
  }

  #rwcalc .rw-pimg {
    width: 40px;
    height: 48px;
  }
}


#rw-ptable a {
  align-items: center;
  padding: 6px 16px;
  background: #2563eb;
  color: #fff;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}