/*
Theme Name:   Hello Elementor Child
Theme URI:    https://militum.se/
Description:  Child theme of Hello Elementor for the Militum Respons site.
              Holds custom code (shortcodes, single-offer template, scroll-to-top,
              partners grid) and overrides for the WP migration of militum.se.
Author:       Militum Respons
Author URI:   https://militum.se/
Template:     hello-elementor
Version:      1.0.0
License:      GNU General Public License v2 or later
License URI:  http://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  hello-elementor-child
*/

/*  Custom CSS layout:
    - style.css (this file)   → component-specific styles (Site Header, HFE nav)
    - assets/css/militum.css  → site-wide typography (Open Sans / Gunplay)
                                + CF7 form styling on /kontakt/
    Both are enqueued by functions.php (style.css first, militum.css on top
    so it can override when needed). */

/* ======================================================================
   1. Site Header — actions column (search + CTAs)
   ----------------------------------------------------------------------
   The cream top bar built by militum-build-header.php places the actions
   on the RIGHT of the bar: a search input on top, and three CTA buttons
   (shop / Inloggning / Bli medlem) below on ONE row. Layout is achieved
   here so the build script holds no inline <style>.
   ====================================================================== */
@import url("https://fonts.googleapis.com/css2?family=Roboto+Condensed:ital,wght@0,100..900;1,100..900&display=swap");

.ctm_gunplay_font :is(.elementor-heading-title) {
  font-family: "Gunplay", "Open Sans" !important;
}

/* Custom styles for the home page */
.ctm_home_member_section .elementor-icon-list-item:not(:last-child):after {
  width: 85%;
  margin-left: auto;
}

.ctm_graph_icon_list .elementor-icon-box-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* The whole right column of the cream bar. */
.militum-header-actions {
  text-align: right;
}

/* ---- Search box ------------------------------------------------------ */

.militum-header-search {
  margin-bottom: 10px;
}

/* Keep the form to a sensible width on the right side of the bar. */
.militum-header-search form {
  display: inline-block;
  width: 100%;
  max-width: 360px;
  margin: 0;
}

/* Real search-input styling, with an inline SVG magnifying-glass icon
   on the left and a clear focus state. The icon's stroke colour is the
   same #1f2937 ink used elsewhere; it's URL-encoded right in the
   background URL so no separate asset file is needed. */
.militum-header-search input[type="search"] {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px 10px 38px; /* extra left padding for the icon */
  border: 1px solid #d4ccab;
  border-radius: 4px;
  font-size: 14px;
  color: #1f2937;
  background: #ffffff
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231f2937' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><path d='m20 20-3.5-3.5'/></svg>")
    no-repeat 12px center / 16px 16px;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
.militum-header-search input[type="search"]::placeholder {
  color: #6b7280;
}
.militum-header-search input[type="search"]:hover {
  border-color: #b9ad81;
}
.militum-header-search input[type="search"]:focus {
  outline: none;
  border-color: #5d8c3d;
  box-shadow: 0 0 0 3px rgba(93, 140, 61, 0.25);
}

/* ---- CTA buttons (shop / Inloggning / Bli medlem) -------------------- */
/* The three Elementor button widgets all live in ONE column
   (.militum-header-cta-col) inside an inner section. By default
   Elementor stacks widgets vertically — this turns that wrap into a
   right-aligned row so the three buttons sit side by side. */
.militum-header-cta-col > .elementor-widget-wrap {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}
/* Elementor sets each .elementor-widget to width:100% by default; the
   buttons need to shrink to their content so the row works. */
.militum-header-cta-col > .elementor-widget-wrap > .elementor-widget {
  width: auto !important;
  max-width: none !important;
}

/* ---- Responsive (tablet / phone) ------------------------------------ */
@media (max-width: 1024px) {
  .militum-header-actions {
    text-align: center;
  }
  .militum-header-search form {
    display: block;
    margin: 0 auto;
  }
  .militum-header-cta-col > .elementor-widget-wrap {
    justify-content: center;
  }
}

.ctm_militum-offer-partners {
  max-width: 1170px;
  margin: 0 auto;
}

/* ======================================================================
   2. Partner detail page (single militum_job, _zoo_item_type=customers)
   ----------------------------------------------------------------------
   Routed to templates/partner-detail.php via the template_include filter
   in functions.php. The layout is intentionally minimal — partner name,
   partner description, then a 2-column grid of the offers connected to
   this partner (rendered with the [militum_offers] card markup).
   ====================================================================== */
.militum-partner-detail {
  padding: 60px 15px;
}

.militum-partner-detail .militum-partner-wrap {
  max-width: 1140px;
  margin: 0 auto;
}

/* Joomla source uses `.floatbox { margin-bottom: 20px; }` between blocks. */
.militum-partner-wrap > * + * {
  margin-top: 20px;
}

.militum-partner-title {
  margin: 0;
  font-size: 24px;
  font-weight: bold;
  line-height: 24px;
  color: #000000;
  font-family: "Open Sans", sans-serif;
  text-transform: none;
}

.militum-partner-description {
  font-size: 14px;
  line-height: normal;
  color: #000;
  font-family: "Open Sans", sans-serif;
}
.militum-partner-description p {
  margin: 0 0 15px;
}
.militum-partner-description p:last-child {
  margin-bottom: 0;
}
/* The militum-offers card grid drops to one column on narrow screens
   naturally — these rules just give the partner page a sensible top gap
   above the grid. */
.militum-partner-offers {
  padding: 20px 0 60px !important;
  margin: 0 !important;
}

.militum-partner-offers .militum-offers-grid {
  width: fit-content;
  gap: 20px 10px;
}

.militum-partner-offers .militum-offer {
  max-width: 262px;
  width: 262px;
}
.militum-offer__related {
  margin: 0 0 60px;
}

.militum-offer__related--partners .militum-offers-loadmore__cta-wrap {
  display: none;
}

@media (max-width: 900px) {
  .militum-partner-detail {
    padding: 32px 16px 60px;
  }
  /* Title size unchanged on mobile — Joomla's 21px works at every width.
       Header reflows naturally because of flex-wrap above. */
  .militum-partner-logo img {
    max-width: 140px;
  }
}

/* ======================================================================
   3. HFE navigation — sub-menu padding
   ====================================================================== */
.hfe-nav-menu .hfe-has-submenu .sub-menu {
  padding: 10px !important;
}

/* ======================================================================
   4. wp-admin — Erbjudanden (militum_job) edit screen
   ----------------------------------------------------------------------
   Restyles ACF tab fields to look like WordPress's native nav-tab UI
   (the horizontal tab strip used on Settings / Site Health pages).
   Loaded only on the post.php / post-new.php screens of militum_job —
   functions.php enqueues style.css there via admin_enqueue_scripts.
   ====================================================================== */

/* Strip ACF's own tab chrome */
.post-type-militum_job .acf-postbox .acf-tab-wrap,
.post-type-militum_job .acf-postbox .acf-tab-group {
  background: transparent;
  border: 0;
  box-shadow: none;
}

/* Tab strip (the row of tabs) — mirrors .nav-tab-wrapper */
.post-type-militum_job .acf-postbox .acf-tab-group {
  display: block;
  margin: 0 0 14px;
  padding: 9px 0 0;
  border-bottom: 1px solid #c3c4c7;
  overflow: hidden;
  list-style: none;
  line-height: inherit;
}
.post-type-militum_job .acf-postbox .acf-tab-group li {
  float: left;
  margin: 0 0 -1px 0.5em;
  padding: 0;
  background: none;
  border: 0;
}

/* Individual tabs — mirror .nav-tab */
.post-type-militum_job .acf-postbox .acf-tab-button {
  display: inline-block;
  padding: 6px 12px;
  background: #dcdcde;
  border: 1px solid #c3c4c7;
  border-bottom: none;
  border-radius: 3px 3px 0 0;
  color: #50575e;
  font-size: 14px;
  line-height: 1.71428571;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: none;
}
.post-type-militum_job .acf-postbox .acf-tab-button:hover {
  background: #e5e5e5;
  color: #1d2327;
}

/* Active tab — mirrors .nav-tab-active. ACF marks the current tab two
   ways depending on version (li.active OR .acf-tab-button.selected). */
.post-type-militum_job .acf-postbox .acf-tab-group li.active .acf-tab-button,
.post-type-militum_job .acf-postbox .acf-tab-button.selected,
.post-type-militum_job .acf-postbox .acf-tab-button:focus {
  background: #f0f0f1;
  color: #000;
  border-bottom: 1px solid #f0f0f1;
  outline: none;
  box-shadow: none;
}

/* ======================================================================
   5. [member_cards] shortcode
   ----------------------------------------------------------------------
   Layout: row of compact white cards with logo + discount + category
   label. Pulls from militum_job offers via the shortcode in functions.php.
   ====================================================================== */

.militum-member-cards__grid {
  display: grid;
  grid-template-columns: repeat(var(--mc-cols, 4), 1fr);
  gap: 20px;
  max-width: 1170px;
  margin: 0 auto;
}

.militum-member-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #fff;
  border: 1px solid #f0ede9;
  border-radius: 10px;
  padding: 20px 28px;
}

.militum-member-card__logo {
  margin-bottom: 18px;
}
.militum-member-card__logo img {
  max-width: 100%;
  height: 48px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
.militum-member-card__logo-fallback {
  font-weight: 700;
  font-size: 13px;
  color: #2b2b2b;
  text-align: center;
}

.militum-member-card__discount {
  margin: 0 0 20px;
  text-align: center;
  font-family: "Open Sans", "Roboto Condensed", sans-serif;
  display: flex;
  align-items: center;
  width: 100%;
  gap: 10px;
}

.militum-member-card__pct {
  display: inline;
  font-size: 24px;
  font-weight: 700;
  color: #000;
  line-height: 32px;
}

.militum-member-card__desc {
  display: inline;
  font-size: 14px;
  font-weight: 400;
  color: #000;
  line-height: normal;
  text-align: left;
}

.militum-member-card__title {
  margin: 0 0 20px;
  font-size: 14px;
  font-weight: 700;
  color: #000000;
  text-align: center;
  line-height: normal;
  font-family: "Open Sans", sans-serif;
}

.militum-member-card__cat {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  color: #eaad2a;
  text-align: center;
  font-family: "Open Sans", sans-serif;
  line-height: normal;
}

/* Responsive collapse */
@media (max-width: 1024px) {
  .militum-member-cards__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }
}
@media (max-width: 560px) {
  .militum-member-cards__grid {
    grid-template-columns: 1fr;
  }
  .militum-member-card {
    min-height: 0;
    padding: 22px 16px;
  }
  .militum-member-cards__heading {
    font-size: 17px;
    letter-spacing: 1.2px;
  }
}

/* ======================================================================
   6. [popular_categories] shortcode — round-icon grid of categories
   ====================================================================== */

.militum-popular-cats__grid {
  display: grid;
  grid-template-columns: repeat(var(--mpc-cols, 5), 1fr);
  gap: 22px;
}
.militum-popular-cat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  background: #f6f5f4;
  border: 1px solid #d8d8d8;
  border-radius: 10px;
  padding: 30px 20px;
  text-decoration: none;
  color: inherit;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.militum-popular-cat__circle {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: #303c19;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.militum-popular-cat__circle img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}
.militum-popular-cat__name {
  font-family: "Open Sans", sans-serif;
  font-weight: 600;
  font-size: 24px;
  color: #000;
  text-align: center;
  line-height: normal;
}

@media (max-width: 1024px) {
  .militum-popular-cats__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
  }
}
@media (max-width: 560px) {
  .militum-popular-cats__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .militum-popular-cat__circle {
    width: 64px;
    height: 64px;
  }
  .militum-popular-cat__circle img {
    width: 36px;
    height: 36px;
  }
  .militum-popular-cat__name {
    font-size: 13px;
  }
}

/* ======================================================================
   7. [offers_loadmore] shortcode — offer card grid + AJAX Load More
   ====================================================================== */
.militum_heading_wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-bottom: 30px;
}
.militum_heading {
  font-family: "Gunplay", "Open Sans" !important;
  font-weight: 400;
  font-size: 24px;
  line-height: normal;
  text-align: center;
  margin: 0;
}
/* "─── ★ ───" decoration that sits under the heading. The span has no
   children, so two flanking lines are drawn with ::before / ::after and
   the gold star in the centre is a URL-encoded SVG background. */
.militum_heading_shape {
  position: relative;
  display: block;
  width: 100%;
  max-width: 190px;
  height: 16px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23eaad2a'><polygon points='12,2 14.9,9 22,9.6 16.5,14.3 18,22 12,18.5 6,22 7.5,14.3 2,9.6 9.1,9'/></svg>")
    no-repeat center / 18px 18px;
}
.militum_heading_shape::before,
.militum_heading_shape::after {
  content: "";
  position: absolute;
  top: 50%;
  width: calc(50% - 22px);
  height: 1px;
  background: #EAAD2A;
  transform: translateY(-50%);
}
.militum_heading_shape::before {
  left: 0;
}
.militum_heading_shape::after {
  right: 0;
}
.militum-offers-loadmore__grid {
  display: grid;
  grid-template-columns: repeat(var(--mol-cols, 4), 1fr);
  gap: 20px;
  max-width: 1170px;
  margin: 0 auto;
}

.militum-loadmore-card {
  background: #f6f5f4;
  border: 1px solid #d8d8d8;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}
.militum-loadmore-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}
.militum-loadmore-card__media {
  display: block;
  height: 110px;
  overflow: hidden;
  background: #f6f5f4;
}
.militum-loadmore-card__img {
  display: block;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transition: transform 0.3s ease;
}
.militum-loadmore-card:hover .militum-loadmore-card__img {
  transform: scale(1.05);
}
.militum-loadmore-card__img--ph {
  background: linear-gradient(135deg, #3d4a26 0%, #5a6a3a 100%);
}

.militum-loadmore-card__body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: center;
  flex: 1;
}
.militum-loadmore-card__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #000;
  font-family: "Open Sans", sans-serif;
  line-height: normal;
}
.militum-loadmore-card__desc {
  margin: 0;
  font-size: 12.5px;
  color: #6b7280;
  line-height: 1.4;
}
.militum-loadmore-card__cta {
  display: inline-block;
  padding: 7px 22px;
  border: 1px solid #eaad2a;
  border-radius: 6px;
  background: transparent;
  color: #303c19;
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
  transition:
    background 0.15s ease,
    color 0.15s ease;
  align-self: center;
  line-height: normal;
  margin-top: auto;
}
.militum-loadmore-card__cta:hover {
  background: #eaad2a;
}

.militum-offers-loadmore__cta-wrap {
  text-align: center;
  margin-top: 30px;
}
.militum-offers-loadmore__btn {
  display: inline-block;
  padding: 14px 40px;
  border: 1px solid #303c19;
  border-radius: 8px;
  background: transparent;
  color: #303c19;
  font-size: 16px;
  font-weight: 700;
  line-height: normal;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
  font-family: "Open Sans", sans-serif;
}

.militum-offers-loadmore__btn:hover {
  background: #303c19;
  color: #fff;
  transform: translateY(-1px);
}
.militum-offers-loadmore__btn:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

@media (max-width: 1024px) {
  .militum-offers-loadmore__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 700px) {
  .militum-offers-loadmore__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .militum-loadmore-card__media {
    height: 110px;
  }
}
@media (max-width: 420px) {
  .militum-offers-loadmore__grid {
    grid-template-columns: 1fr;
  }
  .militum-loadmore-card__media {
    height: 150px;
  }
}

/* ----- 7a. Empty section — kept in the DOM for the drill-down JS to swap
   into, but visually removed when the query returns no cards.
   The drill JS toggles --empty on every AJAX swap so navigating from an
   empty category back to a populated one un-hides it automatically. */
.militum-offers-loadmore--empty,
.militum-popular-cats--empty {
  display: none;
}
/* Marker class set by JS on an Elementor container that's the title sibling
   of an empty Militum section — hides "Popular categories" / "Nya förmåner"
   heading + divider widgets so there's no orphan heading left dangling. */
.militum-section-title-hidden {
  display: none !important;
}

/* ======================================================================
   7. [militum_offers_hero] — hero band: title + subtitle + search + pills
   ----------------------------------------------------------------------
   Renders above an [offers_loadmore] section and live-filters its grid
   via the militum_offers_loadmore AJAX endpoint. The background image
   (set inline via the `bg=` attribute) is anchored to the bottom; the
   top of the section uses the cream brand colour so the title sits over
   a clean field even when no `bg` is set.

   Loading state: `.militum-offers-loadmore__grid.is-loading` is dimmed
   briefly during AJAX so the UI feels responsive.
   ====================================================================== */

.militum-offers-hero__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}

.militum-offers-hero__form {
  width: 100%;
  max-width: 760px;
}

.militum-offers-hero__search-wrap {
  position: relative;
}

.militum-offers-hero__search-btn {
  background: transparent !important;
  border: 0;
  padding: 0 !important;
  margin: 0;
  cursor: pointer;
  color: #000 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 0;
  transition: color 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 18px;
}

.militum-offers-hero__search-icon {
  display: block;
  pointer-events: none;
  width: 26px;
  height: 26px;
}

.militum-offers-hero__search {
  flex: 1;
  border: 1px solid #b7b7b7 !important;
  background-color: #ffffff !important;
  outline: 0;
  padding: 13px 18px 13px 58px !important;
  font-size: 20px;
  line-height: normal;
  color: #000;
  font-family: inherit;
  border-radius: 8px !important;
}
.militum-offers-hero__search::placeholder {
  color: #000;
  opacity: 1;
}
/* .militum-offers-hero__search::-webkit-search-cancel-button {
    -webkit-appearance: none;
    height: 16px; width: 16px;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M4 4l8 8M12 4l-8 8' stroke='%23999' stroke-width='2' stroke-linecap='round'/></svg>") center no-repeat;
    cursor: pointer;
} */

/* Pills row — gap 20px in Figma, 8px-rounded rectangles, #4E5838 fill. */
.militum-offers-hero__pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}
.militum-offers-hero__pill {
  background: #4e5838;
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 14px 20px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.2px;
  cursor: pointer;
  line-height: 1.2;
  transition:
    background 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
}
.militum-offers-hero__pill:hover {
  background: #5d6944;
  transform: translateY(-1px);
}
.militum-offers-hero__pill.is-active {
  background: #d8a23c;
  color: #1f240f;
  box-shadow: 0 0 0 2px rgba(216, 162, 60, 0.35);
}
.militum-offers-hero__pill:focus-visible {
  outline: 2px solid #d8a23c;
  outline-offset: 2px;
}

/* ----------------------------------------------------------------------
   Loading indicators for AJAX search / filter.

   Three places light up while a fetch is in flight:
     1. The search button's magnifying-glass swaps for a spinner.
        Triggered by `.militum-offers-hero.is-loading` on the section root,
        which targets the icon inside the submit button.
     2. The clicked pill shows a small spinner overlay.
     3. The offers grid dims and shows a centered spinner.
   The user sees feedback both at the action (button / pill) AND at the
   result location (grid), so cause and effect are obvious.
   ---------------------------------------------------------------------- */

@keyframes militum-spin {
  to {
    transform: rotate(360deg);
  }
}

/* 1. Search button — replace the icon with a spinner while loading. */
.militum-offers-hero.is-loading .militum-offers-hero__search-icon {
  display: none;
}
.militum-offers-hero.is-loading .militum-offers-hero__search-btn::after {
  content: "";
  display: inline-block;
  width: 22px;
  height: 22px;
  border: 2.5px solid rgba(48, 60, 25, 0.18);
  border-top-color: #303c19;
  border-radius: 50%;
  animation: militum-spin 0.7s linear infinite;
}
.militum-offers-hero.is-loading .militum-offers-hero__search-btn {
  cursor: progress;
}

/* 2. Pill in-flight — small inline spinner replaces a fraction of the
      label visually. Color matches text for legibility against both the
      default olive and the active gold. */
.militum-offers-hero__pill.is-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.85;
}
.militum-offers-hero__pill.is-loading::after {
  content: "";
  display: inline-block;
  margin-left: 10px;
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: militum-spin 0.7s linear infinite;
}

/* 3. Offers grid AND Popular-cats grid — dim + centered spinner overlay
      during AJAX. Same treatment whether the user submitted a search
      (offers grid only) or drilled into a category (both grids). */
.militum-offers-loadmore__grid.is-loading,
.militum-popular-cats__grid.is-loading {
  position: relative;
  min-height: 180px;
  transition: opacity 0.15s ease;
  pointer-events: none;
}
.militum-offers-loadmore__grid.is-loading > *,
.militum-popular-cats__grid.is-loading > * {
  opacity: 0.35;
  transition: opacity 0.15s ease;
  filter: blur(0.4px);
}
.militum-offers-loadmore__grid.is-loading::after,
.militum-popular-cats__grid.is-loading::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border: 3px solid rgba(48, 60, 25, 0.18);
  border-top-color: #303c19;
  border-radius: 50%;
  animation: militum-spin 0.7s linear infinite;
  z-index: 2;
  pointer-events: none;
}

/* 4. Clicked category card — no per-card spinner: the grid-level overlay
      (rule 3) is the only loader. The JS still toggles .is-loading on the
      source card so its double-click guard keeps working, but the class
      carries no visual state. */
.militum-popular-cat.is-loading {
  pointer-events: none;
}
.militum-offers-loadmore__empty {
  text-align: center;
  color: #4a5a3a;
  font-size: 15px;
  padding: 32px 16px;
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  .militum-offers-hero.is-loading .militum-offers-hero__search-btn::after,
  .militum-offers-hero__pill.is-loading::after,
  .militum-offers-loadmore__grid.is-loading::after,
  .militum-popular-cats__grid.is-loading::after {
    animation-duration: 1.4s;
  }
}

@media (max-width: 900px) {
  .militum-offers-hero__inner {
    gap: 18px;
  }
  .militum-offers-hero__search {
    font-size: 17px;
  }
  .militum-offers-hero__search-icon {
    width: 22px;
    height: 22px;
  }
  .militum-offers-hero__pills {
    gap: 12px;
  }
  .militum-offers-hero__pill {
    padding: 11px 16px;
    font-size: 14px;
  }
}
@media (max-width: 560px) {
  .militum-offers-hero__inner {
    gap: 14px;
  }
  .militum-offers-hero__search {
    font-size: 15px;
  }
  .militum-offers-hero__search-icon {
    width: 20px;
    height: 20px;
  }
  .militum-offers-hero__pills {
    gap: 8px;
  }
  .militum-offers-hero__pill {
    padding: 9px 14px;
    font-size: 13px;
  }
}

/* bli-medlem  by junior dev Jay */

#wppb-register-user {
  font-family: "Open Sans", sans-serif;
  max-width: 600px;
  margin: 0 auto;
  color: #000000;
}

#wppb-register-user > ul:first-of-type {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 40px;
  row-gap: 30px;
  list-style: none;
  padding: 0;
  margin: 0 !important;
}

.wppb-send-credentials-checkbox {
  display: none;
}

/* Left Column */
#wppb-form-element-20 {
  grid-column: 1;
  grid-row: 1;
} /* För-efternamn */
#wppb-form-element-12 {
  grid-column: 1;
  grid-row: 2;
} /* Lösenord */
#wppb-form-element-8 {
  grid-column: 1;
  grid-row: 3;
} /* E-postadress */
#wppb-form-element-14 {
  grid-column: 1;
  grid-row: 4;
} /* Vapenslag */
#wppb-form-element-15 {
  grid-column: 1;
  grid-row: 5;
} /* Välj län */

/* Right Column */
#wppb-form-element-2 {
  grid-column: 2;
  grid-row: 1;
} /* Användarnamn */
#wppb-form-element-13 {
  grid-column: 2;
  grid-row: 2;
} /* Bekräfta lösenord */
#wppb-form-element-19 {
  grid-column: 2;
  grid-row: 4;
} /* Aktiveringskod */
#wppb-form-element-17 {
  grid-column: 2;
  grid-row: 5;
} /* Ort */

#wppb-form-element-18 {
  grid-column: 1 / -1 !important;

  margin-top: -10px !important;

  border-top: 1px solid #c3c3c3 !important;
  padding-top: 30px !important;

  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 16px !important;
}

#wppb-form-element-18 > label {
  margin-bottom: 0 !important;
}

/* 3. TYPOGRAPHY & LABELS */

#wppb-register-user label {
  width: 100% !important;
  display: block;
  font-size: 16px;
  font-weight: 400;
  color: #000000;
  line-height: 22px;
  margin-bottom: 10px;
}

#wppb-form-element-20 {
  margin: 0;
  padding: 0;
}

#wppb-register-user input[type="text"],
#wppb-register-user input[type="password"],
#wppb-register-user input[type="email"],
#wppb-register-user select {
  width: 100%;
  height: 60px;
  background: #ffffff;
  border: 1px solid #d5d5d5;
  border-radius: 6px;
  box-sizing: border-box;
  padding: 0 16px;
  font-family: "Open Sans", sans-serif;
  font-size: 16px;
  color: #000000;
  outline: none;
  transition: border-color 0.3s ease;
}

#wppb-register-user select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23134563' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  cursor: pointer;
}

/* Container (Rectangle 51) */
#wppb-register-user .wppb-radios {
  position: relative !important;
  width: 200px !important;
  height: 60px !important;
  background: #d9d9d9 !important;
  border-radius: 6px !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  display: block !important;
}

#wppb-register-user .wppb-radios li {
  position: absolute !important;
  top: 5px !important;
  height: 50px !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

#wppb-register-user .wppb-radios li:first-child {
  left: 8px !important;
  width: 90px !important;
}

#wppb-register-user .wppb-radios li:last-child {
  left: 106px !important;
  width: 86px !important;
}

#wppb-register-user .wppb-radios input[type="radio"] {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  opacity: 0 !important;
  cursor: pointer !important;
  z-index: 3 !important;
  margin: 0 !important;
  padding: 0 !important;
}

#wppb-register-user .wppb-radios label.wppb-rc-value {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 0 !important;
  font-family: "Open Sans", sans-serif !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  color: #000000 !important;
  border-radius: 6px !important;
  z-index: 2 !important;
  box-sizing: border-box !important;
  background: transparent;
  transition: background 0.2s ease-in-out;
}

#wppb-register-user
  .wppb-radios
  input[type="radio"]:checked
  + label.wppb-rc-value {
  background: #ffffff !important;
}
#wppb-register-user > ul:not(:first-of-type) {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  height: 0 !important;
}

#wppb-register-user .form-submit {
  margin-top: 20px !important;
  margin-bottom: 0 !important;
  padding: 0 !important;
  display: flex !important;
  justify-content: start !important;
  width: 100% !important;
}

#wppb-register-user input#register {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 170px;
  height: 50px;
  background: transparent;
  border: 1px solid #303c19;
  border-radius: 8px;
  color: #303c19;
  font-family: "Open Sans", sans-serif;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.wppb-user-forms ul li {
  margin: 0 !important;
}

#wppb-register-user input#register:hover {
  background: #303c19;
  color: #ffffff;
}

#wppb-form-element-12 .wppb-password-group .wppb-password-field-container {
  width: 100% !important;
}
#wppb-form-element-13 .wppb-password-field-container {
  width: 100% !important;
}

@media screen and (max-width: 768px) {
  #wppb-register-user {
    padding: 0 15px;
  }

  #wppb-register-user > ul:first-of-type {
    grid-template-columns: 1fr;
    row-gap: 20px;
  }

  #wppb-form-element-20,
  #wppb-form-element-12,
  #wppb-form-element-8,
  #wppb-form-element-14,
  #wppb-form-element-15,
  #wppb-form-element-2,
  #wppb-form-element-13,
  #wppb-form-element-19,
  #wppb-form-element-17,
  #wppb-form-element-18 {
    grid-column: 1 !important;
    grid-row: auto !important;
  }

  #wppb-form-element-20 {
    order: 1;
  } /* För-efternamn */
  #wppb-form-element-2 {
    order: 2;
  } /* Användarnamn */
  #wppb-form-element-8 {
    order: 3;
  } /* E-postadress */
  #wppb-form-element-12 {
    order: 4;
  } /* Lösenord */
  #wppb-form-element-13 {
    order: 5;
  } /* Bekräfta lösenord */
  #wppb-form-element-14 {
    order: 6;
  } /* Vapenslag */
  #wppb-form-element-19 {
    order: 7;
  } /* Aktiveringskod */
  #wppb-form-element-15 {
    order: 8;
  } /* Välj län */
  #wppb-form-element-17 {
    order: 9;
  } /* Ort */

  #wppb-form-element-18 {
    order: 10;
    margin-top: 10px !important;
  }

  #wppb-register-user input#register {
    width: 100%;
  }
}

/* ========================================================
   Login and reset password
   ======================================================== */
.wppb-user-forms {
  font-family: "Open Sans", sans-serif;
  max-width: 600px;
  margin: 0 auto;
  color: #000000;
}

#wppb-loginform,
#wppb-recover-password ul {
  display: flex;
  flex-direction: column;
  gap: 25px;
  margin: 0;
  padding: 0;
  list-style: none;
}

#wppb-loginform p.wppb-form-field,
#wppb-recover-password li.wppb-form-field {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin: 0;
  padding: 0;
  width: 100%;
}

#wppb-recover-password > p:first-of-type {
  font-size: 16px;
  line-height: 24px;
  margin-bottom: 25px;
  color: #000000;
}
/* 
#wppb-recover-password > p:first-of-type {
    font-size: 15px;
    line-height: 1.6;
    color: #444444; 
    margin-bottom: 25px;
    padding: 12px 16px;
    background-color: #f8f9fa; 
    border-left: 4px solid #134563; 
    border-radius: 0 4px 4px 0; 
} */

#wppb-loginform label,
#wppb-recover-password label {
  display: block;
  width: 100%;
  font-size: 16px;
  font-weight: 400;
  color: #000000;
  line-height: 22px;
  margin-bottom: 10px;
  text-align: left;
}

#wppb-loginform input[type="text"],
#wppb-loginform input[type="password"],
#wppb-recover-password input[type="text"] {
  width: 100% !important;
  max-width: 100%;
  height: 60px;
  background: #ffffff;
  border: 1px solid #d5d5d5;
  border-radius: 6px;
  box-sizing: border-box;
  padding: 0 16px;
  font-family: "Open Sans", sans-serif;
  font-size: 16px;
  color: #000000;
  outline: none;
  transition: border-color 0.3s ease;
}

#wppb-loginform input[type="text"]:focus,
#wppb-loginform input[type="password"]:focus,
#wppb-recover-password input[type="text"]:focus {
  border-color: #134563;
}

#wppb-loginform .wppb-password-field-container {
  width: 100%;
  display: block;
}

#wppb-loginform p.login-remember {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

#wppb-loginform p.login-remember input[type="checkbox"] {
  margin: 0;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

#wppb-loginform p.login-remember label {
  width: auto;
  margin-bottom: 0;
  cursor: pointer;
}

#wppb-loginform p.form-submit,
#wppb-recover-password p.form-submit {
  display: flex;
  flex-direction: row;
  justify-content: start;
  margin: 15px 0 0 0;
  padding: 0;
  width: 100%;
}

#wppb-loginform input[type="submit"],
#wppb-recover-password input[type="submit"] {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 170px;
  height: 50px;
  background: transparent;
  border: 1px solid #303c19;
  border-radius: 8px;
  color: #303c19;
  font-family: "Open Sans", sans-serif;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-sizing: border-box;
  padding: 0;
}

#wppb-loginform input[type="submit"]:hover,
#wppb-recover-password input[type="submit"]:hover {
  background: #303c19;
  color: #ffffff;
}

/* ========================================================
                        Contact Us
   ======================================================== */
.elementor-shortcode .militum-fabrik-form {
  background-color: #ffffff;
  width: 100%;
  padding: 0px !important;
  box-sizing: border-box;
  border-radius: 8px;
  border: none !important;
  display: flex;
  flex-direction: column;
  margin: 0 auto;
}

.militum-fabrik-form form {
  border: none !important;
  box-shadow: none !important;
  padding: 0px;
  border-radius: 0px;
}

.elementor-shortcode .militum-fabrik-form fieldset {
  border: none;
  padding: 0;
  margin: 0;
  min-width: 0;
}

.elementor-shortcode .militum-fabrik-form legend {
  display: none;
}

.elementor-shortcode .militum-fabrik-form .militum-fabrik-row {
  margin-bottom: 20px;
  width: 100%;
}

.elementor-shortcode .militum-fabrik-form label {
  display: block;
  margin-bottom: 6px;
  font-size: 16px;
  color: #000;
  font-weight: 400;
}

.elementor-shortcode .militum-fabrik-form .mf-req {
  color: #ff0000;
}

.elementor-shortcode .militum-fabrik-form input[type="text"],
.elementor-shortcode .militum-fabrik-form input[type="email"],
.elementor-shortcode .militum-fabrik-form textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #dcdcdc;
  border-radius: 4px !important;
  background-color: #ffffff;
  font-family: sans-serif;
  font-size: 14px;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.3s ease;
  box-shadow: none;
}

.elementor-shortcode .militum-fabrik-form input[type="text"]:focus,
.elementor-shortcode .militum-fabrik-form input[type="email"]:focus,
.elementor-shortcode .militum-fabrik-form textarea:focus {
  border-color: #888888;
}

.elementor-shortcode .militum-fabrik-form textarea {
  height: 120px;
  resize: none;
}

.elementor-shortcode .militum-fabrik-form .militum-fabrik-actions {
  border-top: 1px solid #dcdcdc;
  padding-top: 30px;
  margin-top: 10px;
  width: 100%;
}

.elementor-shortcode .militum-fabrik-form button.militum-fabrik-submit {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 232px !important;
  height: 50px !important;
  box-sizing: border-box;
  padding: 0;
  font-family: "Open Sans", sans-serif;
  font-weight: 700;
  background: transparent !important;
  background-image: none !important;
  font-size: 16px;
  line-height: 22px;
  color: #303c19 !important;
  text-align: center;
  background-color: transparent !important;
  border: 1px solid #303c19 !important;
  border-radius: 8px !important;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: none !important;
}

.elementor-shortcode .militum-fabrik-form button.militum-fabrik-submit:hover {
  background-color: #303c19 !important;
  color: #ffffff !important;
}

.elementor-shortcode .militum-fabrik-intro h3 {
  font-size: 14px;
  font-weight: normal;
  line-height: 1.5;
  margin-bottom: 25px;
}
/* --- Wrapper and General Styling --- */
.custom-cf7-wrapper {
  display: flex;
  flex-direction: column;
  gap: 30px; 
  box-sizing: border-box;


}

/* --- Form Groups (Label + Input) --- */
.cf7-form-group {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.custom-cf7-wrapper label {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-weight: 400;
  font-size: 16px;
  line-height: 22px;
  color: #000000;
  width: 100%;
  margin-bottom: 0 !important; /* Stops theme from adding extra bottom margins */
}

/* --- Input Fields Styling --- */
.custom-cf7-wrapper input[type="text"],
.custom-cf7-wrapper input[type="email"],
.custom-cf7-wrapper input[type="number"],
.custom-cf7-wrapper textarea {
  width: 100%;
  background: #ffffff !important; /* Force white background */
  border: 1px solid #d5d5d5 !important; /* Force the grey border */
  border-radius: 6px !important;
  box-sizing: border-box;
  padding: 0 16px;
  font-family: "Open Sans", sans-serif;
  font-size: 16px;
  color: #000000;
  outline: none;
  transition: border-color 0.3s ease;
  box-shadow: none !important; /* Removes default theme shadows */
}

/* Specific heights for inputs vs textarea */
.custom-cf7-wrapper input[type="text"],
.custom-cf7-wrapper input[type="email"],
.custom-cf7-wrapper input[type="number"] {
  height: 60px !important;
}

.custom-cf7-wrapper textarea {
  height: 114px !important;
  padding: 20px 16px;
  resize: vertical;
}

/* Focus state for inputs */
.custom-cf7-wrapper input:focus,
.custom-cf7-wrapper textarea:focus {
  border-color: #303c19 !important;
}

/* --- Submit Button Styling (Theme Override) --- */
.cf7-submit-group {
  width: 100%;
  display: flex;
  justify-content: flex-start;
}

/* Strip ALL default margins from CF7 auto-generated paragraph tags */
.custom-cf7-wrapper p {
  margin: 0 !important;
  padding: 0;
}

/* Ensure the wrapper doesn't have an artificial minimum height */
.custom-cf7-wrapper {
  height: auto;
}

.custom-cf7-wrapper input[type="submit"] {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 14px 44px;
  width: 200px !important;
  height: 50px !important;
  background: transparent !important; /* Overrides the theme's bright green */
  border: 1px solid #303c19 !important; /* Forces the olive border */
  border-radius: 8px !important;
  font-family: "Open Sans", sans-serif !important;
  font-weight: 700 !important;
  font-size: 16px !important;
  line-height: 22px;
  color: #303c19 !important; /* Forces the olive text */
  cursor: pointer;
  transition: all 0.3s ease;
}

.custom-cf7-wrapper input[type="submit"]:hover {
  background: #303c19 !important;
  color: #ffffff !important;
}

/* --- Bottom Text --- */
.cf7-response-text {
  font-family: "Open Sans", sans-serif;
  font-style: italic;
  font-weight: 400;
  font-size: 16px;
  line-height: 22px;
  color: #000000;
  padding-bottom: 30px !important;
}
.wpcf7-spinner {
  display: none;
}

/* --- Mobile Responsiveness --- */
@media screen and (max-width: 768px) {
  .custom-cf7-wrapper {
    padding: 30px 20px;
  }

  .custom-cf7-wrapper input[type="submit"] {
    width: 100% !important;
  }
}
