.sggm-card {
  border: 1px solid #e7edf5;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.sggm-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.sggm-gigs-filter {
  --sggm-filter-height: 46px;
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.4fr) minmax(0, 1.1fr) minmax(0, 0.8fr);
  gap: 10px;
  align-items: stretch;
}

.sggm-gigs-filter .sggm-filter-field {
  min-width: 0;
}

.sggm-gigs-filter .sggm-filter-submit {
  min-width: 0;
  display: flex;
}

.sggm-gigs-filter .sggm-filter-submit .btn {
  min-height: var(--sggm-filter-height);
  height: var(--sggm-filter-height);
  line-height: 1.4;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.sggm-gigs-filter .form-control,
.sggm-gigs-filter .form-select,
.sggm-gigs-filter .btn {
  min-height: var(--sggm-filter-height);
  height: var(--sggm-filter-height);
  box-sizing: border-box;
}

.sggm-gigs-filter .form-select {
  line-height: 1.4;
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
  padding-right: 2rem;
  text-overflow: ellipsis;
}

.sggm-gigs-filter .form-control {
  line-height: 1.4;
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
}

#sggm-profile-gigs .sggm-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#sggm-profile-gigs .card-header {
  padding: 12px 14px;
}

#sggm-profile-gigs .card-body {
  padding: 12px 14px 14px;
}

#sggm-profile-gigs .sggm-gig-item {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 280px;
}

#sggm-profile-gigs .sggm-gig-cover {
  height: 150px;
}

#sggm-profile-gigs .sggm-gig-title {
  margin-bottom: 6px;
  line-height: 1.3;
}

#sggm-profile-gigs .sggm-gig-title a {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#sggm-profile-gigs .sggm-gig-item .small.mb10 {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#sggm-profile-gigs .sggm-gig-item .d-flex.justify-content-between.align-items-center {
  margin-top: auto;
}

.sggm-gig-item {
  border: 1px solid #dce4ef;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.sggm-gig-cover {
  width: 100%;
  height: 170px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 10px;
  border: 1px solid #e3eaf4;
}

.sggm-gig-title a {
  font-weight: 700;
  color: #1d3557;
  text-decoration: none;
}

.sggm-gig-title a:hover {
  text-decoration: underline;
}

.sggm-category-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #d9e4f3;
  background: #f5f9ff;
  color: #274b7a;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sggm-category-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2b5ec5;
  margin-right: 7px;
  flex: 0 0 auto;
}

.sggm-category-pill-lg {
  font-size: 13px;
  padding: 6px 12px;
}

.sggm-requirements-page .card-header .btn {
  white-space: nowrap;
}

.sggm-requirements-page .sggm-gig-item .badge {
  white-space: nowrap;
}

.sggm-requirement-detail-page .card-header .btn {
  white-space: nowrap;
}

.sggm-requirement-detail-page .sggm-proposal-item .btn {
  white-space: nowrap;
}

.sggm-gigs-page .card-header .btn {
  white-space: nowrap;
}

.sggm-gig-detail-page .card-header .btn {
  white-space: nowrap;
}

.sggm-featured-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #7a4b00;
  background: #ffefc2;
  border: 1px solid #f6d98e;
}

.sggm-featured-wrap {
  overflow: hidden;
}

.sggm-featured-track {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.sggm-featured-track.sggm-is-carousel {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  padding-bottom: 6px;
}

.sggm-featured-track.sggm-is-carousel::-webkit-scrollbar {
  height: 8px;
}

.sggm-featured-track.sggm-is-carousel .sggm-featured-item {
  flex: 0 0 calc(33.333% - 8px);
  min-width: calc(33.333% - 8px);
  scroll-snap-align: start;
}

#sggm-profile-gigs .sggm-featured-track.sggm-is-carousel {
  gap: 10px;
}

.sggm-carousel-nav {
  display: flex;
  gap: 6px;
}

#sggm-sidebar-slider .card-header {
  padding: 10px 12px;
}

#sggm-sidebar-slider .card-body {
  padding: 10px 12px 12px;
}

#sggm-sidebar-slider .sggm-sidebar-track {
  gap: 10px;
}

#sggm-sidebar-slider .sggm-sidebar-track .sggm-featured-item {
  flex-basis: 100%;
  min-width: 100%;
}

#sggm-sidebar-slider .sggm-gig-cover {
  height: 140px;
}

#sggm-sidebar-slider .btn.btn-xs {
  width: 26px;
  height: 26px;
  padding: 0;
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#sggm-more-gigs-slider .btn.btn-xs {
  width: 26px;
  height: 26px;
  padding: 0;
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sggm-side-slider-track {
  gap: 0;
}

.sggm-side-slider-track .sggm-featured-item {
  flex: 0 0 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
}

#sggm-more-gigs-slider .sggm-gig-cover {
  height: 140px;
}

.sggm-description {
  line-height: 1.65;
  color: #2f3a4a;
}

.sggm-detail-cover {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #dce4ef;
}

.sggm-form-preview {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #dce4ef;
}

.sggm-proposals-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sggm-proposal-item {
  border: 1px solid #dbe6f3;
  border-radius: 10px;
  padding: 12px;
  background: #fbfdff;
}

.sggm-update-panel summary {
  list-style: none;
  display: inline-block;
}

.sggm-update-panel summary::-webkit-details-marker {
  display: none;
}

.sggm-recent-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sggm-recent-item {
  display: flex;
  gap: 8px;
  padding: 6px;
  border: 1px solid #dce4ef;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  background: #fff;
}

.sggm-recent-item:hover {
  border-color: #b9c9de;
  text-decoration: none;
}

.sggm-recent-item img,
.sggm-recent-placeholder {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  background: #eef3fb;
  flex-shrink: 0;
}

.sggm-recent-meta {
  min-width: 0;
}

.sggm-recent-title {
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 2px;
  color: #1d3557;
}

#sggm-recent-pagination .pagination {
  gap: 6px;
  justify-content: center;
}

#sggm-recent-pagination .page-item .page-link {
  min-width: 30px;
  height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid #d8e2f1;
  color: #1f3b64;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  line-height: 1;
  transition: all 0.15s ease;
}

#sggm-recent-pagination .page-item .page-link:hover {
  border-color: #9db4d8;
  background: #f4f8ff;
  color: #173052;
}

#sggm-recent-pagination .page-item.active .page-link {
  border-color: #2b5ec5;
  background: #2b5ec5;
  color: #fff;
  box-shadow: 0 4px 12px rgba(43, 94, 197, 0.25);
}

@media (max-width: 767px) {
  .sggm-grid {
    grid-template-columns: 1fr;
  }

  .sggm-requirements-page .card-header {
    display: flex;
    flex-direction: column;
    align-items: stretch !important;
    gap: 10px;
  }

  .sggm-requirements-page .card-header > div {
    width: 100%;
  }

  .sggm-requirements-page .card-header .btn {
    width: 100%;
  }

  .sggm-requirements-page .d-flex.gap-2.mb15 {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px !important;
  }

  .sggm-requirements-page .d-flex.gap-2.mb15 .btn {
    width: 100%;
  }

  .sggm-requirements-page .sggm-gig-item {
    padding: 10px;
  }

  .sggm-requirements-page .sggm-gig-title a {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .sggm-requirements-page .sggm-gig-item .small.mb10 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .sggm-requirements-page .sggm-gig-item .d-flex.justify-content-between.align-items-center {
    flex-wrap: wrap;
    gap: 6px;
  }

  .sggm-requirements-page .pagination {
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
  }

  .sggm-requirement-detail-page .card-header {
    display: flex;
    flex-direction: column;
    align-items: stretch !important;
    gap: 10px;
  }

  .sggm-requirement-detail-page .card-header > div {
    width: 100%;
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .sggm-requirement-detail-page .card-header .btn,
  .sggm-requirement-detail-page .card-header .js-sggm-ajax-form {
    width: 100%;
  }

  .sggm-requirement-detail-page .card-header .js-sggm-ajax-form .btn {
    width: 100%;
  }

  .sggm-requirement-detail-page .row.g-2.mb20 > [class*="col-"] {
    width: 100%;
  }

  .sggm-requirement-detail-page .card-body {
    padding: 12px;
  }

  .sggm-requirement-detail-page .sggm-proposal-item {
    padding: 10px;
  }

  .sggm-requirement-detail-page .sggm-proposal-item .d-flex.justify-content-between.align-items-start.mb5 {
    flex-direction: column;
    gap: 6px;
  }

  .sggm-requirement-detail-page .sggm-proposal-item .text-end {
    text-align: left !important;
  }

  .sggm-requirement-detail-page .sggm-proposal-item .d-flex.flex-wrap.gap-2 {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px !important;
  }

  .sggm-requirement-detail-page .sggm-proposal-item .d-flex.flex-wrap.gap-2 form,
  .sggm-requirement-detail-page .sggm-proposal-item .d-flex.flex-wrap.gap-2 .sggm-update-panel {
    width: 100%;
  }

  .sggm-requirement-detail-page .sggm-proposal-item .d-flex.flex-wrap.gap-2 .btn {
    width: 100%;
  }

  .sggm-gigs-page .card-header {
    display: flex;
    flex-direction: column;
    align-items: stretch !important;
    gap: 10px;
  }

  .sggm-gigs-page .card-header > div {
    width: 100%;
  }

  .sggm-gigs-page .card-header .btn {
    width: 100%;
  }

  .sggm-gigs-page .card-body > .d-flex.gap-2.mb15 {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px !important;
  }

  .sggm-gigs-page .card-body > .d-flex.gap-2.mb15 .btn {
    width: 100%;
  }

  .sggm-gigs-page .sggm-gig-item {
    padding: 10px;
  }

  .sggm-gigs-page .sggm-gig-cover {
    height: 160px;
  }

  .sggm-gigs-page .sggm-gig-title a {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .sggm-gigs-page .sggm-gig-item .small.mb10 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .sggm-gigs-page .sggm-gig-item .d-flex.justify-content-between.align-items-center {
    flex-wrap: wrap;
    gap: 6px;
  }

  .sggm-gigs-page .pagination {
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
  }

  .sggm-gig-detail-page .card-header {
    display: flex;
    flex-direction: column;
    align-items: stretch !important;
    gap: 10px;
  }

  .sggm-gig-detail-page .card-header > div {
    width: 100%;
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .sggm-gig-detail-page .card-header .btn,
  .sggm-gig-detail-page .card-header .js-sggm-ajax-form {
    width: 100%;
  }

.sggm-gig-detail-page .card-header .js-sggm-ajax-form .btn {
  width: 100%;
}

.sggm-requirement-detail-page .card-header .js-sggm-ajax-form[data-sggm-inline-confirm],
.sggm-gig-detail-page .card-header .js-sggm-ajax-form[data-sggm-inline-confirm] {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sggm-requirement-detail-page .card-header .sggm-inline-confirm-cancel,
.sggm-gig-detail-page .card-header .sggm-inline-confirm-cancel {
  margin-left: 0 !important;
  min-width: auto;
  white-space: nowrap;
}

.sggm-requirement-detail-page .card-header .js-sggm-ajax-form[data-sggm-inline-confirm] .btn,
.sggm-gig-detail-page .card-header .js-sggm-ajax-form[data-sggm-inline-confirm] .btn {
  width: 96px !important;
  min-width: 96px;
  max-width: 96px;
  text-align: center;
  padding-left: 10px;
  padding-right: 10px;
}

.sggm-requirement-detail-page .card-header > div > .btn,
.sggm-gig-detail-page .card-header > div > .btn {
  width: 96px;
  min-width: 96px;
  text-align: center;
}

/* Fallback sizing when Country Flag Badge styles are not injected on plugin-rendered pages */
.sggm-card .cfb-flag-badge.cfb-flag-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  overflow: hidden;
  vertical-align: middle;
}

.sggm-card .cfb-flag-badge.cfb-flag-inline img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

  .sggm-gig-detail-page .card-body {
    padding: 12px;
  }

  .sggm-gig-detail-page .sggm-detail-cover {
    max-height: 260px;
    border-radius: 10px;
  }

  .sggm-gig-detail-page .row.g-2.mt15 > [class*="col-"] {
    width: 100%;
  }

  .sggm-gig-detail-page .row.g-2.mt15 .p-3.border.rounded {
    padding: 12px !important;
  }

  .sggm-gig-detail-page .sggm-description {
    line-height: 1.55;
    font-size: 15px;
  }

  #sggm-more-gigs-slider .card-header {
    padding: 10px 12px;
  }

  #sggm-more-gigs-slider .card-body {
    padding: 10px 12px 12px;
  }

  .sggm-gigs-filter {
    grid-template-columns: 1fr;
  }

  .sggm-featured-track {
    grid-template-columns: 1fr;
  }

  .sggm-featured-track.sggm-is-carousel .sggm-featured-item {
    flex-basis: 100%;
    min-width: 100%;
  }

  #sggm-profile-gigs .card-header {
    padding: 10px 12px;
  }

  #sggm-profile-gigs .card-body {
    padding: 10px 12px 12px;
  }

  #sggm-profile-gigs .sggm-carousel-nav .btn {
    width: 28px;
    height: 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  #sggm-profile-gigs .sggm-featured-track.sggm-is-carousel .sggm-featured-item {
    flex: 0 0 100%;
    min-width: 100%;
    max-width: 100%;
  }

  #sggm-profile-gigs .sggm-gig-cover {
    height: 170px;
  }

  #sggm-profile-gigs .sggm-gig-item {
    min-height: 0;
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  .sggm-gigs-filter {
    grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr);
  }

  .sggm-gigs-filter .sggm-filter-query {
    grid-column: 1 / -1;
  }

  #sggm-profile-gigs .sggm-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sggm-featured-track.sggm-is-carousel .sggm-featured-item {
    flex-basis: calc(50% - 6px);
    min-width: calc(50% - 6px);
  }
}

@media (max-width: 767px) {
  #sggm-profile-gigs .sggm-grid {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }

  #sggm-profile-gigs .sggm-grid::-webkit-scrollbar {
    display: none;
  }

  #sggm-profile-gigs .sggm-grid .sggm-gig-item {
    flex: 0 0 100%;
    min-width: 100%;
    scroll-snap-align: start;
  }
}

/* Always-on safety rules for Country Flag Badge in Gig Marketplace widgets */
.sggm-country-badge-wrap,
.sggm-country-badge-wrap .cfb-flag-badge,
.sggm-country-badge-wrap .cfb-flag-badge.cfb-flag-inline {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  border-radius: 50%;
  overflow: hidden !important;
  vertical-align: middle;
  line-height: 1;
}

.sggm-country-badge-wrap img,
.sggm-country-badge-wrap .cfb-flag-badge img {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  object-fit: cover !important;
  display: block !important;
}

/* Fallback badge-system styling on plugin-rendered pages */
.sggm-card .badge-system-badges {
  display: inline-flex !important;
  align-items: center;
  gap: 2px;
  vertical-align: middle;
}

.sggm-card .badge-system-badge {
  width: 18px;
  height: 18px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.sggm-card .badge-system-badge i {
  font-size: 14px;
  line-height: 1;
}

/* Fallback Smart Badge System styles on plugin-rendered pages */
.sggm-card .sbs-badges {
  display: inline-flex !important;
  align-items: center;
  gap: 2px;
  margin-left: 2px;
  vertical-align: middle;
}

.sggm-card .sbs-badge {
  display: inline-flex;
  width: 17px;
  height: 17px;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  color: inherit;
}

.sggm-card .sbs-badge i {
  font-size: 13px;
  line-height: 1;
}

@media (max-width: 991.98px) {
  .sggm-layout.sggm-layout-gig-detail .sggm-main-col {
    order: 1;
  }

  .sggm-layout.sggm-layout-gig-detail .sggm-right-col {
    order: 2;
    margin-top: 12px;
  }
}
