/* ============================================================
   RLC Pharma Catalog — pharma-catalog.css
   Fully responsive: desktop table + mobile card/accordion
   ============================================================ */

/* ---------- Section wrapper ---------- */
.rlc-product-catalog {
  background:
    linear-gradient(
      180deg,
      rgba(229, 250, 249, 0.92),
      rgba(255, 255, 255, 0.98)
    ),
    radial-gradient(
      circle at 12% 18%,
      rgba(33, 212, 184, 0.12),
      transparent 34%
    ),
    radial-gradient(circle at 90% 4%, rgba(17, 133, 200, 0.12), transparent 30%);
  padding: 84px 0;
}

.rlc-product-catalog .section-title-content {
  max-width: 620px;
  margin-left: auto;
}

/* ---------- Shell ---------- */
.rlc-catalog-shell {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(14, 121, 171, 0.1);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(7, 48, 80, 0.08);
  overflow: hidden;
  padding: 0;
}

/* ---------- Tabs ---------- */
.rlc-catalog-tabs {
  background: rgba(247, 251, 253, 0.92);
  border: 0;
  border-bottom: 1px solid rgba(14, 121, 171, 0.12);
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-bottom: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  scrollbar-width: thin;
  white-space: nowrap;
}

.rlc-catalog-tabs::-webkit-scrollbar {
  height: 5px;
}
.rlc-catalog-tabs::-webkit-scrollbar-thumb {
  background: rgba(11, 120, 182, 0.28);
  border-radius: 999px;
}

.rlc-catalog-tabs .nav-item {
  flex-shrink: 0;
}

.rlc-catalog-tabs .nav-link {
  align-items: center;
  border: 1px solid rgba(12, 153, 199, 0.24);
  border-radius: 999px;
  color: #0b4c76;
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  gap: 8px;
  min-height: 42px;
  padding: 8px 14px;
  transition:
    background 0.2s,
    border-color 0.2s,
    box-shadow 0.2s,
    color 0.2s,
    transform 0.2s;
  white-space: nowrap;
}

.rlc-catalog-tabs .nav-link:hover,
.rlc-catalog-tabs .nav-link.active {
  background: linear-gradient(90deg, #1185c8, #21d4b8);
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(17, 133, 200, 0.24);
  color: #fff;
  transform: translateY(-2px);
}

.rlc-catalog-tabs .nav-link b {
  background: rgba(8, 61, 99, 0.08);
  border-radius: 999px;
  color: inherit;
  font-size: 11px;
  min-width: 24px;
  padding: 2px 6px;
  text-align: center;
}

.rlc-catalog-tabs .nav-link:hover b,
.rlc-catalog-tabs .nav-link.active b {
  background: rgba(255, 255, 255, 0.24);
}

/* ============================================================
   DESKTOP TABLE  (≥ 768 px)
   ============================================================ */
.rlc-catalog-table {
  border-collapse: separate !important;
  border-spacing: 0;
  width: 100% !important;
}

.rlc-catalog-table thead th {
  background: #07384f;
  border: 0;
  color: #fff;
  font-size: 14px;
  padding: 16px 18px;
  vertical-align: middle;
}

.rlc-catalog-table tbody td {
  border-color: rgba(11, 76, 118, 0.08);
  color: #264454;
  line-height: 1.45;
  padding: 14px 18px;
}

.rlc-catalog-table tbody tr:hover td {
  background: #f3fbff;
}
.rlc-catalog-table a {
  color: #0878b6;
  font-weight: 700;
}

/* toolbar / footer wrappers injected by DataTables */
.catalog-toolbar,
.catalog-footer {
  align-items: center;
  background: #fff;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  margin: 0;
  padding: 20px 22px;
}

.catalog-toolbar {
  border-bottom: 1px solid rgba(14, 121, 171, 0.08);
}
.catalog-footer {
  border-top: 1px solid rgba(14, 121, 171, 0.08);
}

.dataTables_wrapper {
  padding: 0;
}
.dataTables_wrapper .table-responsive {
  margin: 0;
}

.catalog-toolbar .dt-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.catalog-toolbar .dt-button,
.catalog-footer .dataTables_paginate .paginate_button,
.dataTables_length select {
  background: #f7fbfd !important;
  border: 1px solid rgba(17, 133, 200, 0.18) !important;
  border-radius: 999px !important;
  color: #0b4c76 !important;
  font-weight: 800;
  min-height: 38px;
  padding: 5px !important;
  transition:
    background 0.2s,
    border-color 0.2s,
    color 0.2s,
    transform 0.2s;
}

.catalog-toolbar .dt-button:hover,
.catalog-footer .dataTables_paginate .paginate_button.current,
.catalog-footer .dataTables_paginate .paginate_button.current:hover {
  background: #0b78b6 !important;
  border-color: #0b78b6 !important;
  color: #fff !important;
  transform: translateY(-1px);
}

.catalog-footer .dataTables_paginate .paginate_button:hover {
  background: unset !important;
  border: 1px solid rgba(17, 133, 200, 0.18) !important;
}

.catalog-footer .dataTables_paginate .paginate_button:hover a {
  background: linear-gradient(90deg, #1185c8, #21d4b8) !important;
  color: #fff !important;
}

.catalog-footer .dataTables_paginate,
.catalog-footer .pagination {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  margin: 0;
}

.catalog-footer .page-item {
  margin: 0;
}

.catalog-footer .page-link {
  align-items: center;
  background: transparent !important;
  border: 0 !important;
  border-radius: 999px !important;
  box-shadow: none !important;
  color: #0b4c76 !important;
  display: inline-flex;
  font-size: 14px;
  font-weight: 800;
  justify-content: center;
  min-height: 38px;
  min-width: 38px;
  padding: 5px;
  text-decoration: none;
  transition:
    background 0.2s,
    color 0.2s,
    transform 0.2s;
}

.catalog-footer .page-link:hover,
.catalog-footer .page-link:focus {
  background: rgba(11, 120, 182, 0.1) !important;
  color: #07384f !important;
  outline: 0;
  transform: translateY(-1px);
}

.catalog-footer .page-item.active .page-link {
  background: linear-gradient(90deg, #1185c8, #21d4b8) !important;
  color: #fff !important;
}

.catalog-footer .page-item.disabled .page-link {
  background: transparent !important;
  color: #9badb8 !important;
  cursor: not-allowed;
  opacity: 0.72;
  transform: none;
}

.catalog-footer .dataTables_paginate .paginate_button {
  margin: 0 !important;
  min-width: 36px;
  text-align: center;
}

.catalog-footer .dataTables_paginate .paginate_button.disabled,
.catalog-footer .dataTables_paginate .paginate_button.disabled:hover {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  color: #9badb8 !important;
  cursor: not-allowed;
}

.catalog-footer .dataTables_paginate .ellipsis {
  align-items: center;
  color: #8ca4b1;
  display: inline-flex;
  font-weight: 800;
  min-height: 36px;
  padding: 0 4px;
}

.catalog-toolbar input {
  border: 1px solid rgba(17, 133, 200, 0.22);
  border-radius: 999px;
  min-height: 46px;
  min-width: 380px;
  padding: 10px 18px;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.catalog-toolbar input:focus {
  border-color: #1185c8;
  box-shadow: 0 0 0 4px rgba(17, 133, 200, 0.12);
  outline: 0;
}

.dataTables_length label,
.dataTables_filter label,
.dataTables_info {
  color: #527080;
  font-size: 15px;
  font-weight: 700;
}

.dataTables_length select {
  margin: 0 6px;
  min-width: 96px;
  padding-right: 28px !important;
}

/* processing overlay */
.dataTables_processing {
  align-items: center;
  background: rgba(255, 255, 255, 0.96) !important;
  border: 1px solid rgba(17, 133, 200, 0.12);
  border-radius: 999px;
  box-shadow: 0 18px 44px rgba(7, 48, 80, 0.14);
  color: #07384f;
  display: inline-flex;
  font-weight: 800;
  gap: 10px;
  left: 50% !important;
  margin-left: 0 !important;
  padding: 12px 20px;
  transform: translateX(-50%);
  width: auto !important;
  z-index: 4;
}

.dataTables_processing::before {
  animation: rlcSpin 0.8s linear infinite;
  border: 2px solid rgba(17, 133, 200, 0.18);
  border-top-color: #1185c8;
  border-radius: 999px;
  content: "";
  display: inline-block;
  height: 18px;
  width: 18px;
}

.dataTables_empty {
  color: #6b8290 !important;
  font-weight: 800;
  padding: 38px 16px !important;
  text-align: center;
}

.rlc-product-catalog .dt-button-info {
  border: 0 !important;
  border-radius: 12px !important;
  box-shadow: 0 22px 54px rgba(7, 48, 80, 0.18) !important;
  overflow: hidden;
}

.dt-button-info h2 {
  background: linear-gradient(90deg, #1185c8, #21d4b8) !important;
  color: #fff !important;
  font-size: 18px !important;
  font-weight: 900 !important;
  margin: 0 !important;
  padding: 14px 18px !important;
}

.dt-button-info div {
  color: #264454 !important;
  font-weight: 700 !important;
  padding: 16px 18px !important;
}

/* scrollbar for table on tablet */
.table-responsive::-webkit-scrollbar,
.dataTables_scrollBody::-webkit-scrollbar {
  height: 7px;
}

.table-responsive::-webkit-scrollbar-thumb,
.dataTables_scrollBody::-webkit-scrollbar-thumb {
  background: rgba(11, 120, 182, 0.28);
  border-radius: 999px;
}

@keyframes rlcSpin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================================
   TOGGLE UTILITY — used by pharma-catalog.js
   Replaces jQuery .show()/.hide() so that inline `display` styles
   never fight `!important` rules inside media queries.
   ============================================================ */
.rlc-hidden {
  display: none !important;
}

/* ============================================================
   MOBILE CARDS  (< 768 px)
   ============================================================ */

/* hide DataTables table wrapper on mobile, show card list */
@media (max-width: 767px) {
  /* section spacing */
  .rlc-product-catalog {
    padding: 48px 0;
  }

  .rlc-catalog-shell {
    border-radius: 14px;
    margin-left: -4px;
    margin-right: -4px;
  }

  /* tabs */
  .rlc-catalog-tabs {
    gap: 7px;
    padding: 12px 10px;
  }

  .rlc-catalog-tabs .nav-link {
    font-size: 12px;
    min-height: 38px;
    padding: 7px 11px;
  }

  /*
   * BUG FIX: removed display:none !important from here.
   * Visibility is now controlled by the .rlc-hidden class (defined globally above),
   * toggled by pharma-catalog.js. The old !important blocked jQuery .show() on
   * desktop resize, making the table permanently invisible after visiting mobile width.
   */
  .rlc-catalog-table-wrap {
    /* toggled via .rlc-hidden — see global utility above */
  }

  /* mobile search / toolbar */
  .rlc-mobile-toolbar {
    align-items: center;
    background: #fff;
    border-bottom: 1px solid rgba(14, 121, 171, 0.08);
    display: flex;
    gap: 10px;
    padding: 12px 14px;
  }

  .rlc-mobile-search {
    background: #f7fbfd;
    border: 1px solid rgba(17, 133, 200, 0.22);
    border-radius: 999px;
    color: #264454;
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    min-height: 42px;
    outline: none;
    padding: 8px 16px;
    transition:
      border-color 0.2s,
      box-shadow 0.2s;
  }

  .rlc-mobile-search:focus {
    border-color: #1185c8;
    box-shadow: 0 0 0 3px rgba(17, 133, 200, 0.12);
  }

  .rlc-mobile-search::placeholder {
    color: #8ca4b1;
  }

  /* card list */
  .rlc-card-list {
    list-style: none;
    margin: 0;
    padding: 12px 10px;
  }

  /* individual card */
  .rlc-card-item {
    background: #fff;
    border: 1px solid rgba(14, 121, 171, 0.1);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(7, 48, 80, 0.05);
    margin-bottom: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s;
  }

  .rlc-card-item:last-child {
    margin-bottom: 0;
  }

  .rlc-card-item.rlc-card-open {
    box-shadow: 0 6px 24px rgba(17, 133, 200, 0.14);
  }

  /* card header (always visible — just product name + toggle) */
  .rlc-card-header {
    align-items: center;
    background: transparent;
    border: 0;
    cursor: pointer;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 14px 14px;
    text-align: left;
    width: 100%;
    -webkit-tap-highlight-color: transparent;
  }

  .rlc-card-header:active {
    background: rgba(17, 133, 200, 0.04);
  }

  .rlc-card-num {
    align-items: center;
    background: linear-gradient(135deg, #1185c8, #21d4b8);
    border-radius: 8px;
    color: #fff;
    display: flex;
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 900;
    height: 28px;
    justify-content: center;
    min-width: 28px;
    padding: 2px 5px;
  }

  .rlc-card-name {
    color: #07384f;
    flex: 1;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.35;
  }

  .rlc-card-chevron {
    color: #1185c8;
    flex-shrink: 0;
    height: 20px;
    transition: transform 0.25s ease;
    width: 20px;
  }

  .rlc-card-item.rlc-card-open .rlc-card-chevron {
    transform: rotate(180deg);
  }

  /* card body (hidden by default) */
  .rlc-card-body {
    border-top: 1px solid rgba(14, 121, 171, 0.08);
    display: none;
    padding: 14px 14px 16px;
  }

  .rlc-card-item.rlc-card-open .rlc-card-body {
    display: block;
  }

  /* rows inside card body */
  .rlc-card-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 10px;
  }

  .rlc-card-row:last-child {
    margin-bottom: 0;
  }

  .rlc-card-label {
    color: #8ca4b1;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .rlc-card-value {
    color: #264454;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
  }

  .rlc-card-value a {
    color: #0878b6;
    font-weight: 700;
    text-decoration: none;
    word-break: break-word;
  }

  .rlc-card-value a:hover {
    text-decoration: underline;
  }

  /* mobile pagination */
  .rlc-mobile-footer {
    align-items: center;
    background: #fff;
    border-top: 1px solid rgba(14, 121, 171, 0.08);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
    padding: 12px 14px;
  }

  .rlc-mobile-info {
    color: #527080;
    font-size: 13px;
    font-weight: 700;
  }

  .rlc-mobile-pager {
    align-items: center;
    display: flex;
    gap: 6px;
  }

  .rlc-mobile-pager button {
    align-items: center;
    background: #f7fbfd;
    border: 1px solid rgba(17, 133, 200, 0.22);
    border-radius: 999px;
    color: #0b4c76;
    cursor: pointer;
    display: inline-flex;
    font-size: 13px;
    font-weight: 800;
    height: 36px;
    justify-content: center;
    min-width: 36px;
    padding: 4px 8px;
    transition:
      background 0.2s,
      color 0.2s;
  }

  .rlc-mobile-pager button:disabled {
    cursor: not-allowed;
    opacity: 0.4;
  }

  .rlc-mobile-pager button.rlc-page-active,
  .rlc-mobile-pager button:not(:disabled):hover {
    background: linear-gradient(90deg, #1185c8, #21d4b8);
    border-color: transparent;
    color: #fff;
  }

  /* loading skeleton for mobile */
  .rlc-mobile-loading {
    align-items: center;
    color: #527080;
    display: flex;
    font-size: 14px;
    font-weight: 700;
    gap: 10px;
    justify-content: center;
    padding: 36px 16px;
  }

  .rlc-mobile-loading::before {
    animation: rlcSpin 0.8s linear infinite;
    border: 2px solid rgba(17, 133, 200, 0.18);
    border-top-color: #1185c8;
    border-radius: 999px;
    content: "";
    height: 20px;
    width: 20px;
    flex-shrink: 0;
  }

  .rlc-mobile-empty {
    color: #6b8290;
    font-size: 14px;
    font-weight: 700;
    padding: 36px 16px;
    text-align: center;
  }
}

/* ============================================================
   TABLET  (768 – 1199 px)
   ============================================================ */
@media (min-width: 768px) and (max-width: 1199px) {
  .catalog-toolbar input {
    min-width: 280px;
  }

  .catalog-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .catalog-footer .dataTables_paginate,
  .catalog-footer .pagination {
    justify-content: flex-start;
  }
}
