/* Tidy Flow Products page */

.products-hero {
  padding: 140px 0 50px;
  background: linear-gradient(135deg, #0a1628 0%, #0f2744 40%, #0d1f3c 100%);
  color: #fff;
  text-align: center;
}

.products-hero h1 {
  font-size: 2.6rem;
  font-weight: 700;
  margin: 0.6rem 0 0.8rem;
  background: linear-gradient(135deg, #ffffff, #c0e0ff, #ffffff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.products-hero p {
  max-width: 720px;
  margin: 0 auto;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.7;
}

.products-section {
  padding: 3rem 0 5rem;
  background: linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
}

.products-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) 420px;
  gap: 2rem;
  align-items: start;
}

/* Left category navigation */
.product-catnav {
  position: sticky;
  top: 90px;
  align-self: start;
  background: #fff;
  border: 1px solid rgba(13, 38, 76, 0.08);
  border-radius: 14px;
  padding: 1rem 0.9rem;
  box-shadow: 0 4px 16px rgba(13, 38, 76, 0.05);
  max-height: calc(100vh - 110px);
  overflow-y: auto;
}

.product-catnav-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--gray-color);
  margin: 0 0 0.6rem;
  padding-left: 0.4rem;
}

.product-catnav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.product-catnav a {
  display: block;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  color: var(--text-color);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
}

.product-catnav a:hover,
.product-catnav a.active {
  background: rgba(0, 102, 204, 0.06);
  color: var(--primary-color);
  border-left-color: var(--primary-color);
}

/* DAB group: parent toggle in the DAB brand colours with a collapsible sub-list */
.catnav-group {
  margin-top: 0.5rem;
  border-top: 1px solid rgba(13, 38, 76, 0.08);
  padding-top: 0.5rem;
}

.catnav-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: none;
  border-radius: 8px;
  background: #1a5632;
  color: #ffd500;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 0.2s ease;
}

.catnav-toggle:hover {
  background: #14722f;
}

.catnav-caret {
  font-size: 0.6rem;
  transition: transform 0.25s ease;
}

.catnav-group.open .catnav-caret {
  transform: rotate(180deg);
}

.catnav-sub {
  display: none;
  margin: 0.25rem 0 0 !important;
  padding-left: 0.55rem !important;
  border-left: 2px solid #ffd500;
}

.catnav-group.open .catnav-sub {
  display: block;
}

.catnav-sub a {
  font-size: 0.8rem;
  padding: 0.4rem 0.55rem;
}

.catnav-sub a:hover,
.catnav-sub a.active {
  background: rgba(26, 86, 50, 0.08);
  color: #1a5632;
  border-left-color: #1a5632;
}

.product-cat-heading {
  font-size: 1.5rem;
  color: var(--dark-color);
  margin: 1.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(0, 102, 204, 0.12);
  scroll-margin-top: 90px;
}

.product-cat-heading:first-child {
  margin-top: 0;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.2rem;
}

.product-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 4px 16px rgba(0, 102, 204, 0.05);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px rgba(0, 102, 204, 0.12);
}

.product-image {
  aspect-ratio: 4 / 3;
  background: #ffffff;
  overflow: hidden;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12px;
  display: block;
}

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

.product-body h3 {
  font-size: 1.05rem;
  color: var(--dark-color);
  margin: 0 0 0.4rem;
  font-weight: 600;
}

.product-desc {
  font-size: 0.85rem;
  color: var(--gray-color);
  line-height: 1.5;
  margin: 0 0 1rem;
  flex-grow: 1;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.product-price {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary-color);
}

.qty-add {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.product-qty {
  width: 52px;
  padding: 0.4rem;
  border: 1px solid rgba(0, 102, 204, 0.2);
  border-radius: 8px;
  text-align: center;
  font-family: inherit;
}

.add-to-request {
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
}

/* ---- Request panel ---- */
.request-column {
  position: sticky;
  top: 90px;
}

.request-panel {
  background: #fff;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 10px 36px rgba(0, 102, 204, 0.1);
  border: 1px solid rgba(0, 102, 204, 0.06);
  /* Whole panel scrolls as one unit when taller than the viewport,
     so the Submit button is always reachable. */
  max-height: calc(100vh - 110px);
  overflow-y: auto;
}

.request-panel h3 {
  margin: 0 0 1rem;
  color: var(--dark-color);
  font-size: 1.3rem;
}

.request-panel h4 {
  margin: 1.2rem 0 0.6rem;
  color: var(--dark-color);
  font-size: 1rem;
}

.cart-items {
  margin-bottom: 0.8rem;
}

.cart-empty {
  color: var(--gray-color);
  font-size: 0.9rem;
  text-align: center;
  padding: 1.5rem 0;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid #eef2f6;
}

.cart-item-info {
  display: flex;
  flex-direction: column;
}

.cart-item-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--dark-color);
}

.cart-item-line {
  font-size: 0.78rem;
  color: var(--gray-color);
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.qty-btn {
  width: 26px;
  height: 26px;
  border: 1px solid rgba(0, 102, 204, 0.2);
  background: #f5f9ff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  color: var(--primary-color);
}

.qty-btn:hover {
  background: var(--primary-color);
  color: #fff;
}

.cart-item-qty {
  min-width: 22px;
  text-align: center;
  font-weight: 600;
}

.cart-item-remove {
  border: none;
  background: none;
  color: #f44336;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  margin-left: 0.2rem;
}

.cart-summary {
  padding-top: 0.6rem;
  border-top: 2px solid rgba(0, 102, 204, 0.1);
}

.cart-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  color: var(--dark-color);
  padding: 0.22rem 0;
}

.cart-line > span:last-child {
  font-weight: 600;
}

.cart-total {
  font-weight: 700;
  font-size: 1.15rem;
  margin-top: 0.35rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(0, 102, 204, 0.12);
}

.cart-total > span:last-child {
  color: var(--primary-color);
}

.cart-note {
  font-size: 0.78rem;
  color: var(--gray-color);
  margin: 0.5rem 0 0;
  line-height: 1.5;
}

.request-fields .form-group {
  margin-bottom: 0.9rem;
}

.request-fields .form-row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 0.8rem;
}

.request-fields label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--dark-color);
  margin-bottom: 0.3rem;
}

.request-fields input,
.request-fields textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid rgba(0, 102, 204, 0.18);
  border-radius: 9px;
  font-family: inherit;
  font-size: 0.92rem;
  background: #fafcff;
}

.request-fields input:focus,
.request-fields textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.radio-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500 !important;
  font-size: 0.9rem !important;
  margin-bottom: 0.5rem;
  cursor: pointer;
}

.radio-row input {
  width: auto !important;
}

/* ---- Quick-view modal ---- */
.product-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 22, 40, 0.7);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.product-modal.open {
  display: flex;
}

.product-modal-content {
  background: #fff;
  border-radius: 16px;
  max-width: 640px;
  width: 100%;
  overflow: hidden;
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.product-modal-content img {
  width: 100%;
  height: 100%;
  max-height: 360px;
  object-fit: contain;
  padding: 18px;
  background: #fff;
}

.product-modal-info {
  padding: 1.8rem 1.5rem;
}

.product-modal-info h3 {
  margin: 0 0 0.6rem;
  color: var(--dark-color);
}

.product-modal-info p {
  color: var(--gray-color);
  line-height: 1.6;
  font-size: 0.92rem;
  margin-bottom: 1rem;
}

.product-modal-info .product-price {
  display: block;
  margin-bottom: 1rem;
}

.product-modal-close {
  position: absolute;
  top: 10px;
  right: 16px;
  font-size: 1.8rem;
  color: #fff;
  cursor: pointer;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  z-index: 2;
  line-height: 1;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .products-layout {
    grid-template-columns: 1fr;
  }
  .request-column {
    position: static;
  }
  /* On mobile the page scrolls naturally - don't cap the panel height */
  .request-panel {
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 600px) {
  .products-hero h1 {
    font-size: 2rem;
  }
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.8rem;
  }
  .product-modal-content {
    grid-template-columns: 1fr;
    max-height: 90vh;
    overflow-y: auto;
  }
  .product-modal-content img {
    max-height: 240px;
  }
}


/* --- FX layer: gradient sheen on the products hero heading --- */
.products-hero h1 {
  background: linear-gradient(110deg, #ffffff 0%, #cfe9ff 25%, #ffffff 50%, #9fd8ff 75%, #ffffff 100%);
  background-size: 250% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: fxSheen 9s linear 1.2s infinite;
}

@media (prefers-reduced-motion: reduce) {
  .products-hero h1 { animation: none; }
}


/* ==========================================================================
   THEME V3 appendix — products page
   ========================================================================== */

.products-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4.6vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  animation: fxHeroIn 1.1s cubic-bezier(0.16, 1, 0.3, 1) both,
             fxSheen 9s linear 1.4s infinite;
}

.product-card {
  border-radius: var(--radius-card);
  border: 1px solid rgba(13, 38, 76, 0.07);
  box-shadow: var(--shadow-card);
}

.product-card:hover {
  box-shadow: var(--shadow-card-hover);
}

.product-cat-heading {
  font-size: 1.6rem;
  letter-spacing: -0.02em;
  border-bottom: 1.5px solid rgba(0, 102, 204, 0.14);
}

.request-panel {
  border-radius: 24px;
  border: 1px solid rgba(13, 38, 76, 0.07);
  box-shadow: 0 4px 10px rgba(13, 38, 76, 0.04), 0 30px 70px rgba(0, 102, 204, 0.10);
}

@media (prefers-reduced-motion: reduce) {
  .products-hero h1 { animation: none; }
}


/* ==========================================================================
   PRODUCT STOCK CODE (item number) — shown on card image, cart line & modal
   ========================================================================== */
.product-image {
  position: relative;
}

.product-code {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  background: rgba(13, 38, 76, 0.82);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 9px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(2, 18, 51, 0.25);
}

.cart-item-code {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--primary-color);
  background: rgba(0, 102, 204, 0.09);
  border-radius: 5px;
  padding: 1px 6px;
  margin-right: 6px;
  vertical-align: middle;
}

.product-modal-info .modal-code {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--primary-color);
  background: rgba(0, 102, 204, 0.09);
  border-radius: 6px;
  padding: 2px 10px;
  margin-bottom: 0.6rem;
}


/* Spec-sheet download button in the quick-view modal */
.modal-spec-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.9rem;
  padding: 0.7rem 1.2rem;
  border: 1.5px solid rgba(0, 102, 204, 0.35);
  border-radius: 12px;
  background: rgba(0, 102, 204, 0.05);
  color: var(--primary-color);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  transition: all 0.25s ease;
}

.modal-spec-btn:hover {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 102, 204, 0.25);
}

.modal-spec-btn svg {
  flex-shrink: 0;
}


/* Per-item delivery cost line in the cart */
.cart-item-dlv {
  display: block;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--secondary-color);
  margin-top: 2px;
}


/* ==========================================================================
   ORDER CONFIRMATION MODAL (after a successful request)
   ========================================================================== */
.order-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10050;
  background: rgba(8, 15, 30, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 1.5rem;
  overflow-y: auto;
}

.order-modal.open {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.order-modal-content {
  position: relative;
  background: #fff;
  border-radius: 20px;
  max-width: 540px;
  width: 100%;
  margin: auto;
  padding: 2rem 1.8rem;
  box-shadow: 0 30px 80px rgba(2, 18, 51, 0.4);
  animation: orderPop 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes orderPop {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.order-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  border: none;
  background: transparent;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--gray-color);
  cursor: pointer;
}
.order-modal-close:hover { color: var(--dark-color); }

.order-modal-head {
  text-align: center;
  margin-bottom: 1.3rem;
}
.order-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #34d399);
  color: #fff;
  font-size: 1.6rem;
  margin-bottom: 0.7rem;
  box-shadow: 0 10px 24px rgba(16, 185, 129, 0.35);
}
.order-modal-head h2 {
  font-family: var(--font-display, inherit);
  font-size: 1.5rem;
  color: var(--dark-color);
  margin: 0 0 0.4rem;
}
.order-modal-head p {
  color: var(--gray-color);
  font-size: 0.92rem;
  line-height: 1.5;
  margin: 0;
}

.order-ref {
  text-align: center;
  background: linear-gradient(135deg, rgba(0,102,204,0.07), rgba(0,168,232,0.07));
  border: 1px dashed rgba(0, 102, 204, 0.35);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  margin-bottom: 1.2rem;
}
.order-ref-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--gray-color);
  margin-bottom: 0.25rem;
}
.order-ref-num {
  display: block;
  font-family: var(--font-display, inherit);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--primary-color);
}
.order-ref-hint {
  display: block;
  font-size: 0.78rem;
  color: var(--gray-color);
  margin-top: 0.25rem;
}

.order-lines {
  border-top: 1px solid rgba(13, 38, 76, 0.08);
  margin-bottom: 0.5rem;
}
.order-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.15rem 0.8rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid rgba(13, 38, 76, 0.06);
}
.order-line-main {
  grid-column: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.order-line-code {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--primary-color);
  background: rgba(0, 102, 204, 0.09);
  border-radius: 5px;
  padding: 1px 6px;
}
.order-line-name { font-size: 0.9rem; font-weight: 600; color: var(--dark-color); }
.order-line-meta { grid-column: 1; font-size: 0.78rem; color: var(--gray-color); }
.order-line-total { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-weight: 700; color: var(--dark-color); }

.order-totals {
  margin: 0.9rem 0 1.3rem;
}
.order-totals > div {
  display: flex;
  justify-content: space-between;
  padding: 0.28rem 0;
  font-size: 0.92rem;
  color: var(--text-color);
}
.order-totals .order-grand {
  border-top: 2px solid rgba(13, 38, 76, 0.1);
  margin-top: 0.3rem;
  padding-top: 0.6rem;
  font-family: var(--font-display, inherit);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary-color);
}

.order-pay {
  background: #f7fafc;
  border: 1px solid rgba(13, 38, 76, 0.08);
  border-radius: 14px;
  padding: 1.2rem;
  text-align: center;
  margin-bottom: 1.3rem;
}
.order-pay-logo { margin-bottom: 0.5rem; }
.order-pay-logo img { max-height: 46px; width: auto; }
.order-pay-logo-text {
  display: none;
  font-family: var(--font-display, inherit);
  font-weight: 800;
  font-size: 1.7rem;
  letter-spacing: 0.05em;
  color: #009999; /* FNB teal-ish placeholder */
}
.order-pay-note {
  font-size: 0.95rem;
  color: var(--dark-color);
  margin: 0 0 0.9rem;
}
.order-bank {
  text-align: left;
  margin: 0;
  display: grid;
  gap: 0.35rem;
}
.order-bank > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.88rem;
  border-bottom: 1px dotted rgba(13, 38, 76, 0.12);
  padding-bottom: 0.35rem;
}
.order-bank dt { color: var(--gray-color); margin: 0; }
.order-bank dd { margin: 0; font-weight: 700; color: var(--dark-color); text-align: right; }

/* ---- order confirmation modal (EFT only) ---- */
.order-list-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gray-color);
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.order-pay-terms {
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--gray-color);
  background: #fff8e6;
  border: 1px solid #f5e2a8;
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  margin: 0 0 1.1rem;
}

@media (max-width: 560px) {
  .order-modal-content { padding: 1.6rem 1.1rem; }
  .order-ref-num { font-size: 1.25rem; }
}


/* Category nav — responsive collapse */
@media (max-width: 1100px) {
  .products-layout {
    grid-template-columns: 170px minmax(0, 1fr);
  }
  .request-column {
    grid-column: 1 / -1;
    position: static;
    margin-top: 1.6rem;
  }
}

@media (max-width: 900px) {
  .products-layout {
    grid-template-columns: 1fr;
  }
  .product-catnav {
    position: static;
    max-height: none;
    overflow: visible;
    grid-column: 1 / -1;
  }
  .product-catnav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
  }
  .product-catnav a {
    border-left: none;
    border: 1px solid rgba(0, 102, 204, 0.18);
  }
}


/* Tidy Flow logo in the shop hero (dark navy hero -> white backing card) */
.products-hero-logo {
  display: block;
  width: 190px;
  height: auto;
  margin: 0 auto 1.2rem;
  background: rgba(255, 255, 255, 0.96);
  padding: 0.8rem 1.1rem;
  border-radius: 16px;
  box-shadow: 0 14px 36px rgba(2, 18, 51, 0.35);
}
