/* CG3 scoped exceptions - loaded with filemtime() versioning so edits bust
   browser and CDN caches. Divi enqueues style.css with the parent theme
   version, which never changes, so CSS edits there are invisible until the
   cache expires. */

/* CG3 exception #3a - all breakpoints.
   FlexSlider writes its own inline pixel height on .flex-viewport and does not
   commit the taller value when a portrait slide becomes active, so the image is
   cut by overflow:hidden. !important is required to beat that inline style.
   Not desktop-specific - applies at every breakpoint. */
.cg3-pcard .woocommerce-product-gallery .flex-viewport {
  height: auto !important;
}

/* CG3 exception #3b - consistent media canvas, all breakpoints.
   The slide is the only element FlexSlider never writes a height on, so it is
   safe as a fixed-height canvas; its horizontal maths is width-based only.
   The flex centring goes on the anchor because the slide carries an inline
   display:block. The image is never resized or cropped - only the space it is
   presented in is normalised. */
.cg3-pcard .woocommerce-product-gallery__image {
  height: 320px;
}
.cg3-pcard .woocommerce-product-gallery__image > a {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}
.cg3-pcard .woocommerce-product-gallery__image img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  margin: 0 auto;
}

/* ===== CG3 CSS exception #3 - product overview cards only =====
   The Woo/FlexSlider thumbnail row is internal markup inside
   divi/woocommerce-product-images and cannot be targeted by any
   native Divi setting. Desktop pointer devices only; touch keeps
   the native Woo layout untouched. */
@media (hover: hover) and (pointer: fine) {
  .cg3-pcard .woocommerce-product-gallery .flex-control-thumbs {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 0;
    width: auto;
    opacity: 0;
    visibility: hidden;
    transition: opacity 220ms ease, visibility 220ms ease;
  }
  .cg3-pcard:hover .woocommerce-product-gallery .flex-control-thumbs,
  .cg3-pcard:focus-within .woocommerce-product-gallery .flex-control-thumbs {
    opacity: 1;
    visibility: visible;
  }
}

/* CG3 exception #5 - form placeholder colour.
   Divi renders the field label inside the placeholder (the real <label> is
   display:none), so the browser default placeholder grey washes the labels out.
   field.advanced.placeholder.font.font exists in the module schema but emits
   nothing on this install, so the colour is set here instead. */
.cg3-form ::placeholder {
  color: var(--gcid-cg3-color-text-muted);
  opacity: 1;
}

/* CG3 exception #6 - real flag images instead of emoji.
   Windows has no font for regional-indicator flag emoji, so they fall back to
   two letters (DK, IS, NO). The country terms already carry flag images; they
   are injected as <img class='cg3-flag'> in the module content. Fixed box plus
   object-fit:cover so sources with different aspect ratios all match. */
.cg3-flag {
  width: 20px;
  height: 13px;
  object-fit: contain;
  display: inline-block;
  vertical-align: -2px;
  margin-right: 8px;
  border-radius: 2px;
}

/* Flag position on the country pills. Divi's background image position token
   was not honoured (it fell back to 50% 50%), so the offset is set here. */
.cg3-pilloff,
.cg3-pillon {
  background-position: 16px center !important;
}


/* --- cg-navnerum (dynamisk distributoerside) ---
   Samme undtagelser som cg3-*, gentaget for det nye navnerum.
   Divis background-position-token rammer ikke, saa flaget placeres her. */
.cg-pilloff,
.cg-pillon { background-position: 16px center !important; }

.cg-flag { width:20px; height:13px; object-fit:contain; display:inline-block;
           vertical-align:-2px; margin-right:8px; border-radius:2px; }

/* Label/vaerdi-raekker inde i et loop.
   Divi-grupper kan ikke ligge i grupper, saa raekkerne er ren HTML i eet
   tekstmodul. Samme visuelle resultat som .cg-dist-info-row-grupperne. */
.cg-inforow { display:flex; align-items:flex-start; gap:10px;
              margin:0 0 12px; font-size:13px; line-height:1.7; }
.cg-inforow strong { min-width:80px; font-weight:500;
                     color:var(--gcid-cg-color-text); }
.cg-inforow span, .cg-inforow a { color:var(--gcid-cg-color-text-muted); }
.cg-inforow .cg-ok { color:var(--gcid-cg-color-accent); font-weight:500; }
.cg-inforow a { color:var(--gcid-cg-color-accent); text-decoration:none; }

/* Skjul en info-raekke hvis dens vaerdi er tom.
   Divi har ingen betinget visning pr. loop-element, saa raekken
   skjuler sig selv naar ACF-feltet ikke er udfyldt. */
.cg-inforow:has(> span:empty),
.cg-inforow:has(> a:empty) { display:none; }


/* Sociale links i footerens foerste kolonne */
.cg-footer-social { display:flex; gap:14px; align-items:center; margin:20px 0 0; }
.cg-footer-social a { display:inline-flex; line-height:0; opacity:.8;
                       transition:opacity .15s ease, transform .15s ease; }
.cg-footer-social a:hover { opacity:1; transform:translateY(-1px); }
.cg-footer-social img { width:22px; height:22px; display:block; }

/* Kilde-links paa testimonial-kortene */
.cg-sociallink { color:inherit; text-decoration:none; }
.cg-sociallink:hover { text-decoration:underline; }


/* Kontinuerlig carousel: konstant pixelhastighed i stedet for ease-in-out.
   Divi saetter timing-function inline i JS, derfor !important.
   Bemaerk: transition-duration maa IKKE overskrives her - wrap-around-resettet
   bruger inline 'transition: none', og en !important-duration ville gore
   tilbagehoppet til en synlig animation. */
.cg-carousel-slow .et_pb_group_carousel_track {
  transition-timing-function: linear !important;
}
