/* ==========================================================================
   SLG (StarLink Goods Pvt Ltd.) — Components Stylesheet
   Product Cards, Modals, 11-Instalment Table, Stepper, Tax Invoice, Admin
   ========================================================================== */

/* ---------------- Appliance Product Card ---------------- */
.product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
  position: relative;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-border-strong);
}

.product-media {
  position: relative;
  width: 100%;
  padding-top: 75%; /* 4:3 Aspect ratio */
  background-color: #F1F5F9;
  overflow: hidden;
}

.product-media img, .product-media svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 1.25rem;
  transition: transform var(--transition-smooth);
}

.product-card:hover .product-media img,
.product-card:hover .product-media svg {
  transform: scale(1.05);
}

.product-badges {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  z-index: 2;
}

.product-stock-tag {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
}

.product-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-category-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.product-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.35;
  margin-bottom: 0.6rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-title a:hover {
  color: var(--color-accent);
}

.product-specs-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.spec-chip {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}

/* Pricing block */
.product-pricing {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--color-border);
}

.price-row-main {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}

.price-slg {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--color-primary);
}

.price-mrp {
  font-size: 0.85rem;
  color: var(--color-text-light);
  text-decoration: line-through;
}

.price-discount {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-success);
}

/* 11-Instalment Plan Teaser */
.product-instalment-box {
  background: linear-gradient(135deg, #FFF7ED 0%, #FFEDD5 100%);
  border: 1px solid #FDBA74;
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  margin-bottom: 1rem;
}

.instalment-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 700;
  color: #C2410C;
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}

.instalment-monthly-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--color-accent);
}

.instalment-box-sub {
  font-size: 0.75rem;
  color: #9A3412;
}

.product-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

/* ---------------- 11-Instalment Schedule Breakdown Table ---------------- */
.instalment-schedule-card {
  background: #FFFFFF;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin: 1.5rem 0;
}

.instalment-schedule-header {
  background: var(--color-primary);
  color: #FFFFFF;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.schedule-header-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #FFFFFF;
}

.schedule-header-badge {
  background: var(--color-accent);
  color: #FFFFFF;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
}

.schedule-table-wrap {
  overflow-x: auto;
}

.schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  text-align: left;
}

.schedule-table th {
  background: var(--color-bg);
  padding: 0.85rem 1.25rem;
  font-weight: 600;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.schedule-table td {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-main);
  vertical-align: middle;
}

.schedule-table tr:hover {
  background-color: var(--color-surface-hover);
}

.schedule-table tr.highlight-first {
  background-color: #FFF7ED;
  font-weight: 600;
}

.schedule-table tr.highlight-last {
  background-color: #F8FAFC;
}

.schedule-footer-disclosure {
  padding: 1rem 1.5rem;
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  font-size: 0.8rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* ---------------- Visual Order / Payment Progress Stepper ---------------- */
.tracker-stepper-container {
  background: #FFFFFF;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 2rem 1.5rem;
  margin: 1.5rem 0;
  box-shadow: var(--shadow-sm);
}

.tracker-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow-x: auto;
  padding: 1rem 0.5rem;
  scrollbar-width: thin;
}

.stepper-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
  min-width: 68px;
}

.stepper-circle {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: #FFFFFF;
  border: 2px solid var(--color-border-strong);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  transition: all var(--transition-normal);
  margin-bottom: 0.5rem;
}

.stepper-node.completed .stepper-circle {
  background: var(--color-success);
  border-color: var(--color-success);
  color: #FFFFFF;
}

.stepper-node.active .stepper-circle {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #FFFFFF;
  box-shadow: 0 0 0 4px var(--color-accent-light);
}

.stepper-node.overdue .stepper-circle {
  background: var(--color-danger);
  border-color: var(--color-danger);
  color: #FFFFFF;
}

.stepper-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-align: center;
  white-space: nowrap;
}

.stepper-node.active .stepper-label {
  color: var(--color-accent);
  font-weight: 700;
}

.stepper-amount {
  font-size: 0.7rem;
  color: var(--color-text-light);
  font-family: var(--font-mono);
}

.stepper-connector {
  position: absolute;
  top: 28px;
  left: 30px;
  right: 30px;
  height: 3px;
  background: var(--color-border);
  z-index: 1;
}

.stepper-connector-fill {
  height: 100%;
  background: var(--color-success);
  transition: width var(--transition-smooth);
}

/* Dispatch Banner in Tracker */
.dispatch-rule-banner {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  color: #1E40AF;
  margin-top: 1.5rem;
  font-size: 0.9rem;
}

.dispatch-rule-banner.ready {
  background: var(--color-success-light);
  border-color: #A7F3D0;
  color: #065F46;
}

/* ---------------- Single Item Cart Conflict Modal ---------------- */
.conflict-modal-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: #FEF3C7;
  color: #D97706;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin: 0 auto 1.25rem;
}

.conflict-products-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.25rem 0;
  background: var(--color-bg);
  padding: 1rem;
  border-radius: var(--radius-md);
}

.compare-col {
  font-size: 0.85rem;
}

.compare-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
  color: var(--color-text-muted);
}

.compare-title {
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 0.25rem;
}

/* ---------------- Simulated Indian Payment Gateway Modal ---------------- */
.gateway-modal-dialog {
  max-width: 480px;
  background: #FFFFFF;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.gateway-header {
  background: #0C2340;
  color: #FFFFFF;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gateway-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.1rem;
}

.gateway-amount {
  font-size: 1.25rem;
  font-weight: 800;
  color: #38BDF8;
}

.gateway-tabs {
  display: flex;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
}

.gateway-tab {
  flex: 1;
  padding: 0.85rem 0.5rem;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
}

.gateway-tab.active {
  color: #0284C7;
  border-bottom-color: #0284C7;
  background: #FFFFFF;
}

.gateway-tab-content {
  padding: 1.5rem;
}

.gateway-sim-controls {
  background: #F8FAFC;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-top: 1rem;
}

.gateway-sim-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

/* ---------------- Official Printable GST Tax Invoice ---------------- */
.tax-invoice-container {
  background: #FFFFFF;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  max-width: 800px;
  margin: 2rem auto;
  box-shadow: var(--shadow-md);
  color: #0F172A;
}

.invoice-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--color-primary);
  margin-bottom: 1.5rem;
}

.invoice-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

.invoice-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.875rem;
}

.invoice-table th {
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: 0.75rem 1rem;
  text-align: left;
}

.invoice-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
}

.invoice-totals-box {
  margin-left: auto;
  width: 320px;
  font-size: 0.875rem;
}

.invoice-total-row {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
}

.invoice-grand-total {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--color-primary);
  border-top: 2px solid var(--color-border-strong);
  padding-top: 0.6rem;
  margin-top: 0.4rem;
}

@media print {
  body * {
    visibility: hidden;
  }
  .tax-invoice-container, .tax-invoice-container * {
    visibility: visible;
  }
  .tax-invoice-container {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 1.5rem;
    box-shadow: none;
    border: none;
  }
  .no-print {
    display: none !important;
  }
}

/* ---------------- Admin Dashboard Elements ---------------- */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: #FFFFFF;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-xs);
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--color-primary);
}

.admin-tabs-nav {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.admin-tab-btn {
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}

.admin-tab-btn.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-accent);
}

.admin-data-table {
  width: 100%;
  border-collapse: collapse;
  background: #FFFFFF;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  font-size: 0.875rem;
}

.admin-data-table th {
  background: var(--color-bg);
  padding: 0.85rem 1.25rem;
  font-weight: 600;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
  text-align: left;
}

.admin-data-table td {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

