/* ─────────────────────────────
   PACKAGE CARDS ROW
───────────────────────────── */

.pkg-cards-row {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 48px;
}

.pkg-card {
  flex: 1 1 160px;
  max-width: 200px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.10);
  text-align: center;
  background: #ffffff;
}

.pkg-img-wrap {
  width: 100%;
  height: 160px;
  overflow: hidden;
  background: #f5f5f5;
}

.pkg-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pkg-card-label {
  background: #222222;
  color: #ffffff;
  font-weight: 700;
  font-size: 1rem;
  padding: 10px 8px 6px;
  letter-spacing: 0.03em;
}

.pkg-card-rate {
  font-weight: 700;
  font-size: 1rem;
  padding: 8px 8px 12px;
  color: #ffffff;
}

.pkg-basic .pkg-card-rate {
  background: #e07b1a;
}

.pkg-standard .pkg-card-rate {
  background: #1a72e0;
}

.pkg-premium .pkg-card-rate {
  background: #3aaa35;
}

.pkg-luxury .pkg-card-rate {
  background: #0a9e8e;
}

.pkg-labour .pkg-card-rate {
  background: #8e24aa;
}


/* ─────────────────────────────
   ESTIMATE TABLE MAIN LAYOUT
───────────────────────────── */

.estimate-table-wrap {
  display: flex;
  width: 100%;
  gap: 0;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  margin-top: 48px;
  background: #ffffff;
}


/* ─────────────────────────────
   LEFT SIDEBAR / CATEGORY TABS
───────────────────────────── */

.est-sidebar {
  display: flex;
  flex-direction: column;
  flex: 0 0 200px;
  background: #1a1a1a;
}

.est-sidebar-btn {
  background: #222222;
  color: #cccccc;
  border: none;
  border-bottom: 1px solid #333333;
  padding: 14px 18px;
  text-align: left;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  font-family: inherit;
}

.est-sidebar-btn:hover {
  background: #333333;
  color: #ffffff;
}

.est-sidebar-btn.active {
  background: var(--gold, #c9a84c);
  color: #000000;
  font-weight: 700;
}


/* ─────────────────────────────
   RIGHT TABLE AREA
───────────────────────────── */

.est-table-area {
  flex: 1;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.est-table-header,
.est-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.est-table-header {
  background: #f0f0f0;
  border-bottom: 2px solid #dddddd;
}

.est-table-header .est-col {
  padding: 14px 12px;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-align: center;
  color: #333333;
  white-space: nowrap;
}

.est-category {
  display: none;
}

.est-category.active {
  display: block;
}

.est-row {
  border-bottom: 1px solid #eeeeee;
}

.est-row:last-child {
  border-bottom: none;
}

.est-row:nth-child(even) {
  background: #fafafa;
}

.est-col {
  padding: 12px 14px;
  font-size: 0.9rem;
  line-height: 1.7;
  color: #444444;
  border-right: 1px solid #eeeeee;
  word-break: normal;
  overflow-wrap: break-word;
}

.est-col:last-child {
  border-right: none;
}


/* ─────────────────────────────
   FULL WIDTH NOTE ROWS
───────────────────────────── */

.est-row-note {
  display: block;
  padding: 14px 18px;
  border-bottom: 1px solid #eeeeee;
  background: #fafafa;
}

.est-row-note:last-child {
  border-bottom: none;
}

.est-col-full {
  font-size: 0.92rem;
  color: #444444;
  line-height: 1.7;
}


/* ─────────────────────────────
   TABLE SCROLLBAR
───────────────────────────── */

.est-table-area::-webkit-scrollbar,
.est-sidebar::-webkit-scrollbar {
  height: 6px;
}

.est-table-area::-webkit-scrollbar-thumb,
.est-sidebar::-webkit-scrollbar-thumb {
  background: #c9c9c9;
  border-radius: 20px;
}

.est-table-area::-webkit-scrollbar-track,
.est-sidebar::-webkit-scrollbar-track {
  background: #f2f2f2;
}


/* ─────────────────────────────
   TABLE SCROLL HINT FOR MOBILE
───────────────────────────── */

.est-table-area::after {
  content: "";
}


/* ─────────────────────────────
   RESPONSIVE - TABLET & MOBILE
───────────────────────────── */

@media (max-width: 768px) {
  .pkg-cards-row {
    gap: 12px;
    margin-top: 32px;
  }

  .pkg-card {
    flex: 1 1 calc(50% - 12px);
    max-width: none;
  }

  .pkg-img-wrap {
    height: 130px;
  }

  .pkg-card-label,
  .pkg-card-rate {
    font-size: 0.85rem;
  }

  .estimate-table-wrap {
    flex-direction: column;
    width: 100%;
    margin-top: 32px;
    overflow: hidden;
  }

  .est-sidebar {
    flex-direction: row;
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .est-sidebar::-webkit-scrollbar {
    display: none;
  }

  .est-sidebar-btn {
    flex: 0 0 auto;
    white-space: nowrap;
    border-bottom: none;
    border-right: 1px solid #333333;
    padding: 12px 16px;
    font-size: 0.78rem;
  }

  .est-table-area {
    width: 100%;
    overflow-x: auto;
  }

  .est-table-header,
  .est-row {
    grid-template-columns: repeat(5, 155px);
    min-width: 775px;
  }

  .est-table-header .est-col {
    padding: 12px 10px;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
  }

  .est-col {
    padding: 12px 10px;
    font-size: 0.78rem;
    line-height: 1.65;
  }

  .est-row-note {
    min-width: 775px;
    padding: 12px 14px;
  }

  .est-col-full {
    font-size: 0.82rem;
  }
}


/* ─────────────────────────────
   EXTRA SMALL MOBILE
───────────────────────────── */

@media (max-width: 480px) {
  .pkg-card {
    flex: 1 1 100%;
  }

  .pkg-img-wrap {
    height: 150px;
  }

  .est-table-header,
  .est-row {
    grid-template-columns: repeat(5, 145px);
    min-width: 725px;
  }

  .est-row-note {
    min-width: 725px;
  }

  .est-sidebar-btn {
    padding: 11px 14px;
    font-size: 0.72rem;
  }

  .est-table-header .est-col {
    font-size: 0.68rem;
  }

  .est-col {
    font-size: 0.75rem;
  }
}

/* ── COST CALCULATOR ── */
.calc-pkg-tabs {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.calc-pkg-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 24px;
  background: #1a1a2e;
  color: #fff;
  border: 2px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-condensed);
  font-size: 1rem;
  font-weight: 700;
  transition: all 0.25s;
  min-width: 120px;
}

.calc-pkg-btn span { font-size: 0.8rem; color: rgba(255,255,255,0.6); }
.calc-pkg-btn.active { background: #0ea5e9; border-color: #0284c7; }
.calc-pkg-btn.active span { color: rgba(255,255,255,0.9); }
.calc-pkg-btn:hover:not(.active) { background: #0f2d4a; border-color: #0ea5e9; }

.calc-table-wrap {
  background: #fff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  overflow: hidden;
}

/* Desktop layout */
.calc-table-header,
.calc-table-row {
  display: grid;
  grid-template-columns: 50px 1fr 150px 70px 100px 110px;
  gap: 10px;
  padding: 14px 20px;
  align-items: center;
}

.calc-table-header {
  background: #0ea5e9;
  color: #fff;
  font-family: var(--font-condensed);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.calc-table-row {
  border-bottom: 1px solid #e0f2fe;
  font-size: 0.9rem;
  color: #0f172a;
}

.calc-table-row:nth-child(even) { background: #f0f9ff; }

.calc-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #bae6fd;
  border-radius: 4px;
  font-size: 0.9rem;
  color: #0f172a;
  background: #fff;
  outline: none;
}

.calc-input:focus { border-color: #0ea5e9; }
.calc-rate-cell { color: #0284c7; font-weight: 600; }
.calc-cost-cell { font-weight: 600; color: #0f172a; }

.calc-table-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background: #0f172a;
  color: #fff;
}

.calc-total-label {
  font-family: var(--font-condensed);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.calc-total-value {
  font-family: var(--font-condensed);
  font-size: 1.4rem;
  font-weight: 800;
  color: #38bdf8;
}

/* ── MOBILE ── */
@media (max-width: 640px) {
  .calc-table-header { display: none; }

  .calc-table-row {
    display: grid;
    grid-template-columns: 28px 1fr;
    grid-template-rows: auto auto auto;
    gap: 6px;
    padding: 14px 14px;
  }

  .calc-sl {
    grid-column: 1;
    grid-row: 1;
    font-weight: 700;
    color: #0ea5e9;
    font-size: 0.85rem;
  }

  .calc-desc {
    grid-column: 2;
    grid-row: 1;
    font-weight: 600;
    font-size: 0.88rem;
    color: #0f172a;
  }

  .calc-area {
    grid-column: 2;
    grid-row: 2;
  }

  .calc-area input { width: 160px; font-size: 1rem; padding: 10px 12px; }

  /* Unit + Rate + Cost on one line */
  .calc-unit,
  .calc-rate,
  .calc-cost {
    grid-column: 2;
    grid-row: 3;
    display: inline;
    font-size: 0.82rem;
  }

  /* Put unit, rate, cost in a flex row */
  .calc-table-row {
    grid-template-columns: 28px 1fr;
  }

  .calc-unit::before { content: 'Unit: '; color: #64748b; }
  .calc-rate::before { content: '  |  Rate: '; color: #64748b; }
  .calc-cost::before { content: '  |  Cost: '; color: #64748b; }

  /* Override grid for the meta row */
  .calc-table-row > .calc-unit,
  .calc-table-row > .calc-rate,
  .calc-table-row > .calc-cost {
    grid-row: 3;
    grid-column: 2;
  }

  /* Flex trick for the meta info row */
  .calc-table-row::after {
    content: '';
    display: none;
  }

  .calc-table-total {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 16px 14px;
  }

  .calc-total-value { font-size: 1.5rem; }

  .calc-pkg-tabs {
    grid-template-columns: repeat(3, 1fr);
    display: grid;
    gap: 8px;
  }

  .calc-pkg-btn { min-width: unset; padding: 10px 6px; font-size: 0.8rem; }
  .calc-pkg-btn span { font-size: 0.68rem; }
}

/* Responsive */
@media (max-width: 768px) {
  /* Hide the grid header on mobile entirely */
  .calc-table-header {
    display: none;
  }

  .calc-table-wrap {
    overflow: hidden;
  }

  /* Each row becomes a card */
  .calc-table-row {
    display: grid;
    grid-template-columns: 1fr;
    padding: 14px 16px;
    gap: 8px;
    border-bottom: 1px solid #e0f2fe;
    background: #fff;
    font-size: 0.9rem;
  }

  .calc-table-row:nth-child(even) {
    background: #f0f9ff;
  }

  /* Serial number */
  .calc-table-row > div:first-child {
    font-family: var(--font-condensed);
    font-size: 0.7rem;
    font-weight: 700;
    color: #0ea5e9;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  /* Description text */
  .calc-table-row > div:nth-child(2) {
    font-size: 0.92rem;
    font-weight: 600;
    color: #0f172a;
  }

  /* Input area row */
  .calc-table-row > div:nth-child(3) {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .calc-input {
    width: 140px;
    padding: 10px 12px;
    font-size: 1rem;
  }

  /* Unit, Rate, Cost inline row */
  .calc-table-row > div:nth-child(4),
  .calc-table-row > div:nth-child(5),
  .calc-table-row > div:nth-child(6) {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
  }

  /* Add labels inline */
  .calc-table-row > div:nth-child(4)::before {
    content: 'Unit: ';
    color: #475569;
    font-size: 0.78rem;
  }

  .calc-table-row > div:nth-child(5)::before {
    content: 'Rate: ';
    color: #475569;
    font-size: 0.78rem;
  }

  .calc-table-row > div:nth-child(6)::before {
    content: 'Cost: ';
    color: #475569;
    font-size: 0.78rem;
  }

  /* Total row */
  .calc-table-total {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 16px;
  }

  .calc-total-value {
    font-size: 1.6rem;
    text-align: left;
  }

  /* Package tabs — 3 per row on mobile */
  .calc-pkg-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .calc-pkg-btn {
    min-width: unset;
    padding: 10px 8px;
    font-size: 0.82rem;
  }

  .calc-pkg-btn span {
    font-size: 0.7rem;
  }
}
