body {
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #000;
  background-color: #f5f5f5;
}

/* Header */
.header-navbar {
  min-height: 80px;
  padding-top: 0;
  padding-bottom: 0;
  background-color: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

@media (max-width: 991.98px) {
  .header-navbar {
    min-height: auto;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .header-container {
    justify-content: center !important;
    /* Force Center logo */
    display: flex !important;
    width: 100%;
  }

  .header-logo {
    margin-left: 0 !important;
    /* Override bootstrap ms-4 */
    margin-right: 0 !important;
    justify-content: center !important;
    width: 100%;
    /* Allow logo container to take full width for centering if needed, or keep auto */
    flex: 0 0 auto;
    /* Stop it from growing too much if we want tight centering */
  }

  .header-mobile-wrapper form {
    width: 100%;
    max-width: 700px;
    /* Widen search bar */
    margin-left: auto;
    margin-right: auto;
  }

  .header-mobile-wrapper .input-group {
    width: 100%;
  }

  .header-mobile-wrapper .d-flex.flex-wrap {
    justify-content: center !important;
    /* Ensure buttons are centered */
    gap: 0.5rem !important;
    width: 100%;
    display: flex !important;
  }
}

.header-container {
  height: 100%;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  /* Prevent wrapping in the main bar */
}

.header-logo {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 225px;
  height: 45px;
  flex-shrink: 0;
  /* CRITICAL: Prevent logo from shrinking */
}

.header-logo-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.header-search-desktop {
  max-width: 650px;
  width: 100%;
  align-self: center;
}

/* Custom search input styling */
.header-search-input {
  height: 40px;
  font-size: 14px;
  border-color: #d0d4dd;
}

.header-search-input:focus {
  border-color: #b0202a;
  box-shadow: 0 0 0 0.2rem rgba(176, 32, 42, 0.15);
}

@media (max-width: 991.98px) {
  .header-search-desktop {
    max-width: none;
    /* Allow full width on mobile if used */
    width: 100%;
  }
}

.header-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  /* Prevent right buttons from shrinking */
}

.header-right-bottom {
  display: flex;
  align-items: center;
}

.header-text-link {
  color: #1f2937;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0 12px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.header-text-link:hover {
  color: #b0202a;
  background-color: rgba(176, 32, 42, 0.05);
}

.header-login-btn {
  border-color: #b0202a;
  color: #b0202a;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

.header-login-btn:hover {
  background-color: #b0202a;
  border-color: #b0202a;
  color: #ffffff;
}

.header-right-bottom .btn {
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  font-weight: 500;
}
.header-user-name {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 576px) {
  .header-text-link {
    padding: 0 8px;
  }

  .header-logout-btn,
  .header-login-btn {
    height: 40px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
  }

  .header-user-name {
    max-width: 60vw;
  }
}

/* Banner */
.banner-section {
  height: 240px;
  background: linear-gradient(90deg, #c0171d, #0056b3);
}

.banner-title {
  color: #ffffff;
}

/* Ad placeholder */
.ad-placeholder-section {
  height: 120px;
}

/* RFQ form */
.rfq-form {
  max-width: 100%;
}

/* Info cards */
.info-card {
  background-color: #fff5f5;
  border-color: #f1c7c7;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
  min-height: 190px;
}

.info-card:hover {
  background-color: #ffe8e8;
  border-color: #e7aaaa;
  box-shadow: 0 0.4rem 1rem rgba(176, 32, 42, 0.16);
  transform: translateY(-2px);
}

.info-card h2 {
  color: #b0202a;
  font-size: 1.12rem;
  margin-bottom: 0.75rem;
}

.info-card h3 {
  font-size: 0.95rem;
}

.info-card .card-body {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Latest RFQs pills */
.request-info {
  border-radius: 999px;
  border: 1px solid #d0d4dd;
  background-color: #ffffff;
  padding: 10px 18px;
  box-shadow: 0 0.1rem 0.3rem rgba(15, 23, 42, 0.06);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease,
    background-color 0.2s ease;
  max-height: 90px;
  height: 90px;
}

.request-info:hover {
  border-color: #dfe3e8;
  background-color: #ffffff;
  box-shadow: 0 0.25rem 0.8rem rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.request-info-flag {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background-color: #b0202a;
}

.request-info-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #111827;
}

.request-info-body {
  font-size: 0.84rem;
  color: #4b5563;
}

/* Viewall buttons */
.ld-viewall {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid rgba(2, 6, 23, 0.12);
  background: rgba(255, 255, 255, 0.75);
  color: rgba(2, 6, 23, 0.78);
  transition:
    transform 120ms ease,
    box-shadow 120ms ease,
    background 120ms ease,
    color 120ms ease;
}

.ld-viewall:hover {
  background: #fff;
  color: rgba(2, 6, 23, 0.92);
  box-shadow: 0 6px 10px rgba(2, 6, 23, 0.1);
  transform: translateY(-1px);
}

.ld-viewall:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.55);
  outline-offset: 2px;
}

/* Utility overrides */
.bg-secondary-subtle {
  background-color: #e9ecef;
}

/* Imports-Exports Cards */
.home-rfq .request-info-flag {
  background-color: #b0202a;
}

.home-imports .request-info-flag {
  background-color: #b02a37;
}

.home-imports .request-info:hover {
  border-color: #e7aaaa;
  background-color: #fff5f5;
  box-shadow: 0 10px 22px rgba(176, 32, 42, 0.16);
}

.home-imports .request-info:hover .request-info-flag {
  background-color: #8f1d25;
}

.home-exports .request-info-flag {
  background-color: #0d6efd;
}

.home-exports .request-info:hover {
  border-color: #cfe2ff;
  background-color: #f5f9ff;
  box-shadow: 0 10px 22px rgba(13, 110, 253, 0.16);
}

.home-exports .request-info:hover .request-info-flag {
  background-color: #0b5ed7;
}

@media (min-width: 991.98px) {
  .border-lg-left {
    border-left: 2px solid #dee2e6;
  }
}

/* RFQ form */
.rfq-form {
  max-width: 100%;
}

/* RFQ modal */
.rfq-modal .modal-content {
  border-radius: 18px;
  overflow: hidden;
}

.rfq-modal-hero {
  background: linear-gradient(
    120deg,
    rgba(176, 32, 42, 0.12),
    rgba(0, 86, 179, 0.12)
  );
  border: 1px solid rgba(176, 32, 42, 0.15);
}

.rfq-modal-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #b0202a;
  color: #ffffff;
  font-size: 1.2rem;
}

.rfq-form-modal .form-control,
.rfq-form-modal .form-select {
  border-radius: 10px;
  border-color: #d0d4dd;
}

.rfq-form-modal .form-control:focus,
.rfq-form-modal .form-select:focus {
  border-color: #b0202a;
  box-shadow: 0 0 0 0.2rem rgba(176, 32, 42, 0.12);
}

.rfq-form-modal .iti {
  width: 100%;
}

.rfq-form-modal .iti__tel-input {
  border-radius: 10px;
  border-color: #d0d4dd;
}

.rfq-form-modal .iti__tel-input:focus {
  border-color: #b0202a;
  box-shadow: 0 0 0 0.2rem rgba(176, 32, 42, 0.12);
}

.rfq-type-group.is-invalid + .invalid-feedback {
  display: block;
}

.rfq-type-group {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.rfq-type-option {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid #d0d4dd;
  background: #ffffff;
  font-size: 0.85rem;
  font-weight: 600;
  color: #111827;
  cursor: pointer;
}

.rfq-type-option input {
  accent-color: #b0202a;
}

/* === Categories === */

.trade-categories-section {
  background: transparent;
  padding: 40px 0;
  border-radius: 20px;
}

/* Header */
.trade-categories-section header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  padding-bottom: 16px;
  margin-bottom: 28px;
}

.trade-categories-section h2 {
  font-size: 22px;
  font-weight: 600;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.02em;
  margin-left: 24px;
}

/* View All Button */
.view-all-btn {
  font-size: 13px;
  font-weight: 600;
  padding: 8px 20px;
  border-radius: 999px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  color: #1f2937;
  transition: all 0.2s ease;
  margin-right: 24px;
}

.view-all-btn:hover {
  background: #0d6efd;
  border-color: #0d6efd;
  color: #ffffff;
  transform: translateY(-2px);
}

/* Category Part */
#category-slider {
  overflow: visible !important;
}

.category-grid {
  padding: 0 25px;
  display: flex;
  flex-wrap: wrap;
  gap: 18px !important;
}

.category-item {
  width: 125px;
}

.category-circle {
  background: #ffffff;
  border: 3px solid rgba(15, 23, 42, 0.12);
  border-radius: 60px;
  padding: 26px 14px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
  width: 130px;
  height: 130px;
}

.category-icon {
  font-size: 26px;
  margin-bottom: 10px;
  color: #475569;
  transition: all 0.25s ease;
}

.category-label {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  line-height: 1.3;
  display: block;
}

.category-link:hover .category-circle {
  border-color: #0d6efd;
  transform: translateY(-8px);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
}

.category-link:hover .category-icon {
  color: #0d6efd;
  transform: scale(1.1);
}

.category-link:hover .category-label {
  color: #0d6efd;
}

/* Navigation */
.category-nav {
  width: 44px;
  height: 44px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 50%;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
}

.category-nav i {
  font-size: 18px;
}

.category-nav:hover {
  background: #0d6efd;
  color: #ffffff;
  border-color: #0d6efd;
  transform: translateY(-50%) scale(1.08);
}

.category-nav-left {
  left: 5px;
}

.category-nav-right {
  right: 5px;
}

@media (min-width: 768px) and (max-width: 992px) {
  .category-item {
    width: 120px;
  }
  .category-grid {
    padding: 0 100px;
    justify-content: center;
    gap: 15px;
  }
  .trade-categories-section header {
    padding-left: 24px;
    padding-right: 24px;
  }
}

@media (max-width: 768px) {
  .trade-categories-section {
    padding: 20px 0;
  }

  .trade-categories-section header {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px 12px 16px;
    margin-bottom: 20px;
    gap: 10px;
  }

  .trade-categories-section h2 {
    margin-left: 0;
    font-size: 18px;
    white-space: nowrap;
  }

  .view-all-btn {
    margin-right: 0;
    width: 100%;
    text-align: center;
  }

  .category-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    padding: 0 16px;
    flex-wrap: nowrap;
  }

  .category-item {
    width: 100% !important;
  }

  .category-circle {
    padding: 16px 8px;
    height: auto;
    min-height: 110px;
  }

  #category-slider {
    overflow: visible !important;
  }
}
