/* ============================================================
   Wall Putty Estimator – Trimurti Products
   Stylesheet: wall-putty-estimator.css
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red:        #C0232B;
  --red-deep:   #8f1219;
  --red-light:  #FDEDE8;
  --gold:       #c79a2e;
  --gold-light: #FDEDE8;
  --white:      #ffffff;
  --gray-50:    #f9f9f9;
  --gray-100:   #f0f0f0;
  --gray-200:   #e0e0e0;
  --gray-400:   #9e9e9e;
  --gray-600:   #5a5a5a;
  --gray-900:   #1a1a1a;
  --shadow-sm:  0 1px 4px rgba(0,0,0,0.07);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.10);
  --shadow-red: 0 8px 32px rgba(192,35,43,0.18);
}

body {
  font-family: 'DM Sans', sans-serif;
  background: #f4f4f4;
  color: var(--gray-900);
  min-height: 100vh;
}

/* ─── HEADER ─── */
header {
  background: var(--white);
  border-bottom: 3px solid var(--red);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}
.header-inner {
  max-width: 1300px;
  margin: auto;
  padding: 0 20px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo-area {
  display: flex;
  align-items: center;
  gap: 14px;
}
.logo-icon {
  width: 46px;
  height: 46px;
  background: var(--red);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-red);
}
.logo-icon svg { color: white; }
.logo-text h1 {
  font-family: 'Rajdhani', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--red-deep);
  line-height: 1.1;
}
.logo-text span {
  font-size: 11px;
  color: var(--gray-400);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.reset-btn {
  background: var(--gray-100);
  border: none;
  border-radius: 50px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}
.reset-btn:hover { background: var(--red-light); color: var(--red); }

/* ─── LAYOUT ─── */
main {
  max-width: 1300px;
  margin: 32px auto;
  padding: 0 20px 60px;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 28px;
  align-items: start;
}

/* ─── CARD ─── */
.card {
  background: var(--white);
  border-radius: 18px;
  border: 1px solid var(--gray-200);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}
.card-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.card-title svg { color: var(--red); }

/* ─── UNIT TOGGLE ─── */
.unit-row { display: flex; align-items: center; justify-content: space-between; }
.unit-note { font-size: 13px; color: var(--gray-400); margin-top: 8px; }
.toggle-group {
  display: flex;
  background: var(--gray-100);
  border-radius: 10px;
  padding: 3px;
}
.toggle-btn {
  padding: 7px 20px;
  border-radius: 8px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: var(--gray-400);
  transition: all 0.2s;
}
.toggle-btn.active {
  background: var(--white);
  color: var(--red);
  box-shadow: var(--shadow-sm);
}

/* ─── WALLS & ROWS ─── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.add-btn {
  background: var(--red-light);
  color: var(--red);
  border: none;
  border-radius: 50px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
}
.add-btn:hover { background: var(--red); color: white; }

.wall-row, .opening-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
  animation: slideIn 0.2s ease;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.wall-icon {
  width: 32px;
  height: 32px;
  background: var(--red-light);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--red);
  font-weight: 700;
  font-size: 12px;
}
.door-icon   { background: #e8f0fe; color: #1a56db; }
.window-icon { background: #e6f4ea; color: #1e8b4f; }
.custom-icon { background: var(--gold-light); color: var(--gold); }

.wall-name-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-900);
  min-width: 0;
  outline: none;
}
.dim-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
}
.dim-input {
  width: 64px;
  border: 1px solid var(--gray-200);
  background: var(--white);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  text-align: center;
  color: var(--gray-900);
  outline: none;
  transition: border 0.15s;
}
.dim-input:focus { border-color: var(--red); }
.dim-sep  { font-size: 12px; color: var(--gray-400); font-weight: 700; }
.dim-label {
  font-size: 10px;
  color: var(--gray-400);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
}

.remove-btn {
  background: none;
  border: none;
  color: var(--gray-200);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: all 0.15s;
  flex-shrink: 0;
}
.remove-btn:hover { color: var(--red); background: var(--red-light); }

.empty-state {
  border: 2px dashed var(--gray-200);
  border-radius: 12px;
  padding: 28px;
  text-align: center;
  color: var(--gray-400);
  font-size: 13px;
  font-style: italic;
}

/* ─── OPENING BUTTONS ─── */
.opening-add-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.add-door-btn, .add-window-btn, .add-custom-btn {
  padding: 6px 14px;
  border-radius: 50px;
  border: none;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
}
.add-door-btn   { background: #e8f0fe; color: #1a56db; }
.add-door-btn:hover   { background: #1a56db; color: white; }
.add-window-btn { background: #e6f4ea; color: #1e8b4f; }
.add-window-btn:hover { background: #1e8b4f; color: white; }
.add-custom-btn { background: var(--gold-light); color: var(--gold); border: 1px solid #e8c96a; }
.add-custom-btn:hover { background: var(--gold); color: white; border-color: var(--gold); }

/* ─── CUSTOM MODAL ─── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 500;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--white);
  border-radius: 20px;
  padding: 28px;
  width: 340px;
  max-width: 92vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: modalIn 0.2s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.modal-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 6px;
}
.modal-sub  { font-size: 12px; color: var(--gray-400); margin-bottom: 20px; }
.modal-field { margin-bottom: 14px; }
.modal-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--gray-600);
  margin-bottom: 6px;
  display: block;
}
.modal-input {
  width: 100%;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  color: var(--gray-900);
  outline: none;
  transition: border 0.15s;
}
.modal-input:focus { border-color: var(--gold); }
.modal-dims    { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal-actions { display: flex; gap: 10px; margin-top: 22px; }
.modal-cancel {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--gray-200);
  background: var(--gray-100);
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-600);
  cursor: pointer;
  transition: all 0.15s;
}
.modal-cancel:hover { background: var(--gray-200); }
.modal-confirm {
  flex: 2;
  padding: 10px;
  border-radius: 10px;
  border: none;
  background: var(--gold);
  color: white;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.modal-confirm:hover { background: #a07a1a; }

/* ─── INFO BANNER ─── */
.info-banner {
  background: var(--gold-light);
  border: 1px solid #e8c96a;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: #7a5c10;
  line-height: 1.6;
}
.info-banner svg { color: var(--gold); flex-shrink: 0; margin-top: 2px; }

/* ─── RESULTS PANEL ─── */
.results-sticky { position: sticky; top: 90px; }

.result-card {
  background: #FDEDE8;
  border-radius: 22px;
  padding: 28px;
  color: #000000 !important;
  box-shadow: var(--shadow-red);
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
}
.result-card::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 200px; height: 200px;
  background: rgba(255,255,255,0.07);
  border-radius: 50%;
}
.result-card::after {
  content: '';
  position: absolute;
  bottom: -40px; left: -40px;
  width: 140px; height: 140px;
  
  border-radius: 50%;
}
.result-inner { position: relative; z-index: 1; }

.result-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #000000;
  margin-bottom: 14px;
}
.result-big {
  font-family: 'Rajdhani', sans-serif;
  font-size: 58px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}
.result-big span {
  font-size: 22px;
  font-weight: 500;
  margin-left: 4px;
  color: #000000;
}
.result-sub { font-size: 13px; color: #000000; margin-bottom: 22px; }
.result-divider { height: 1px; background: rgba(255,255,255,0.15); margin-bottom: 20px; }

.result-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 22px;
}
.result-meta-item .num {
  font-family: 'Rajdhani', sans-serif;
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}
.result-meta-item .lbl {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #000000;
  margin-top: 3px;
}

.bags-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.bag-card {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 12px 14px;
  backdrop-filter: blur(4px);
}
.bag-card .b-lbl {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #000000;
  margin-bottom: 4px;
}
.bag-card .b-num {
  font-family: 'Rajdhani', sans-serif;
  font-size: 26px;
  font-weight: 700;
}

/* ─── PRODUCT CARDS ─── */
.product-section-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 12px;
  padding-left: 4px;
}
.product-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  gap: 14px;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}
.product-card:hover { border-color: var(--red); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.product-img {
  width: 56px;
  height: 56px;
  background: var(--red-light);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s;
  color: var(--red);
}
.product-card:hover .product-img { transform: scale(1.05); }
.product-info h5 {
  font-weight: 700;
  font-size: 14px;
  color: var(--gray-900);
  margin-bottom: 4px;
}
.product-info p {
  font-size: 12px;
  color: var(--gray-400);
  line-height: 1.5;
  margin-bottom: 6px;
}
.product-link {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--red);
  display: flex;
  align-items: center;
  gap: 3px;
}

/* ─── WARNING BOX ─── */
.warn-box {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: #92400e;
  line-height: 1.6;
  margin-top: 14px;
}
.warn-box svg { color: #f59e0b; flex-shrink: 0; }

/* ─── MOBILE CTA ─── */
.mobile-cta {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
}
.mobile-cta button {
  background: var(--red);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 14px 32px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(192,35,43,0.35);
  transition: all 0.2s;
}
.mobile-cta button:active { transform: scale(0.96); }

/* ─── MOBILE RESULT SHEET ─── */
.result-sheet-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
}
.result-sheet-overlay.open { display: block; }
.result-sheet {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: white;
  border-radius: 24px 24px 0 0;
  padding: 24px;
  max-height: 90vh;
  overflow-y: auto;
}
.sheet-handle {
  width: 40px; height: 4px;
  background: var(--gray-200);
  border-radius: 4px;
  margin: 0 auto 20px;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 760px) {
  main { grid-template-columns: 1fr; }
  .results-panel { display: none; }
  .mobile-cta { display: block; }
  .opening-add-btns { gap: 6px; }
}