/* =========================================================
   GIFT CARD
   ========================================================= */

.gm-result-card {
    --gm-result-card-body-height: 158px;
    --gm-result-card-stage-height: clamp(500px, calc(100vw + 107px), 588px);
    position: relative;
    display: grid;
    border: 8px solid rgba(205, 205, 205, 0.34);
    border-radius: 22px;
    background: rgba(255, 253, 249, 0.82);
    overflow: hidden;
    isolation: isolate;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.58) inset,
        0 6px 20px rgba(44, 24, 8, 0.04);
}

.gm-result-card__admin-tip-target {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 6;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 999px;
    background: rgba(36, 28, 22, 0.62);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(44, 24, 8, 0.18);
    /*cursor: help;*/
    backdrop-filter: blur(6px);
}

.gm-result-card__admin-tip-target:hover,
.gm-result-card__admin-tip-target:focus-visible {
    background: rgba(36, 28, 22, 0.82);
    outline: none;
}

.gm-result-card__admin-tip {
    max-width: min(360px, calc(100vw - 32px));
    color: var(--gm-text);
    font-size: 0.86rem;
    line-height: 1.35;
}

.gm-result-card__admin-tip-content {
    display: grid;
    gap: 10px;
}

.gm-result-card__admin-tip-header,
.gm-result-card__admin-tip-label {
    color: #6f6257;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.gm-result-card__admin-tip-meta {
    display: grid;
    gap: 6px;
    margin: 0;
}

.gm-result-card__admin-tip-meta div {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 10px;
}

.gm-result-card__admin-tip-meta dt {
    color: #8d7e70;
    font-weight: 700;
}

.gm-result-card__admin-tip-meta dd {
    margin: 0;
    min-width: 0;
    color: var(--gm-text);
    font-weight: 700;
    overflow-wrap: anywhere;
}

.gm-result-card__admin-tip-section {
    display: grid;
    gap: 6px;
}

.gm-result-card__admin-tags {
    display: grid;
    gap: 5px;
    max-height: 260px;
    overflow: auto;
}

.gm-result-card__admin-tag {
    display: grid;
    grid-template-columns: minmax(82px, 0.8fr) minmax(96px, 1.2fr) auto;
    gap: 8px;
    align-items: center;
    padding: 6px 8px;
    border: 1px solid rgba(216, 195, 172, 0.7);
    border-radius: 6px;
    background: #fffdf9;
}

.gm-result-card__admin-tag--ranking-match {
    border-color: rgba(25, 112, 94, 0.56);
    background: #fff3c4;
    box-shadow: 0 0 0 1px rgba(25, 112, 94, 0.12) inset;
}

.gm-result-card__admin-tag--baseline-score {
    border-color: rgba(58, 112, 153, 0.44);
    background: #eaf4ff;
    box-shadow: 0 0 0 1px rgba(58, 112, 153, 0.12) inset;
}

.gm-result-card__admin-tag span,
.gm-result-card__admin-tag strong {
    min-width: 0;
    overflow-wrap: anywhere;
}

.gm-result-card__admin-tag span {
    color: #8d7e70;
}

.gm-result-card__admin-tag strong {
    color: var(--gm-text);
    font-weight: 800;
}

.gm-result-card__admin-empty {
    color: #8d7e70;
    font-style: italic;
}

.gm-result-card__admin-edit-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 6px;
    background: var(--gm-accent);
    color: #ffffff;
    font-weight: 800;
    text-decoration: none;
}

.gm-result-card__admin-edit-link:hover {
    color: #ffffff;
    text-decoration: none;
    filter: brightness(0.96);
}

/* klikbart område (IKKE footer) */
.gm-result-card__variant-stage {
    position: relative;
    min-width: 0;
    height: var(--gm-result-card-stage-height);
    z-index: 1;
}

.gm-result-card__variant-stage--stacked {
    padding-right: 18px;
}

.gm-result-card__stack-card {
    overflow: hidden;
    border: 1px solid rgba(91, 75, 62, 0.28);
    border-radius: 14px;
    background: #fffdf9;
}

.gm-result-card__stack-card--next {
    position: absolute;
    top: 4px;
    right: 0;
    bottom: 4px;
    left: 16px;
    z-index: 1;
    box-shadow: 0 5px 14px rgba(44, 24, 8, 0.09);
    pointer-events: none;
    transition: transform 0.24s ease;
}

.gm-result-card__stack-card--next[hidden] {
    display: none;
}

.gm-result-card__main-link {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-rows: minmax(0, 1fr) var(--gm-result-card-body-height);
    height: 100%;
    background: #fffdf9;
    color: inherit;
    text-decoration: none;
    touch-action: pan-y;
    transition: transform 0.24s ease, box-shadow 0.18s ease;
    user-select: none;
    -webkit-user-drag: none;
}

.gm-result-card__stack-card--active {
    box-shadow:
        0 2px 5px rgba(44, 24, 8, 0.08),
        0 8px 18px rgba(44, 24, 8, 0.08);
}

.gm-result-card__variant-stage--stacked .gm-result-card__main-link {
    cursor: grab;
}

.gm-result-card__variant-stage--dragging .gm-result-card__main-link {
    cursor: grabbing;
    transition: none;
}

.gm-result-card__variant-stage--dragging .gm-result-card__stack-card--next {
    transition: none;
}

.gm-result-card__variant-stage--settling .gm-result-card__main-link,
.gm-result-card__variant-stage--settling .gm-result-card__stack-card--next {
    transition: transform 0.26s cubic-bezier(0.22, 0.72, 0.22, 1);
}

.gm-result-card__variant-stage--nudge .gm-result-card__main-link {
    animation: gm-result-card-variant-nudge 0.7s ease;
}

.gm-result-card__variant-hint {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    padding: 0 11px;
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 999px;
    background: rgba(36, 28, 22, 0.76);
    color: #ffffff;
    font-size: 0.76rem;
    font-weight: 800;
    box-shadow: 0 7px 18px rgba(44, 24, 8, 0.18);
    backdrop-filter: blur(6px);
    pointer-events: none;
}

.gm-result-card__variant-hint-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.gm-result-card__variant-hint[hidden] {
    display: none;
}

.gm-result-card--admin .gm-result-card__badge {
    top: 56px;
}

@keyframes gm-result-card-variant-nudge {
    0%,
    100% {
        transform: translateX(0);
    }

    38% {
        transform: translateX(-14px);
    }

    68% {
        transform: translateX(3px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .gm-result-card__variant-stage--nudge .gm-result-card__main-link {
        animation: none;
    }
}

/* =========================
   IMAGE
   ========================= */

.gm-result-card__image-wrap {
    position: relative;
    min-height: 0;
    background: #ffffff;
    overflow: hidden;
    transition: box-shadow 0.18s ease;
}

.gm-result-card__image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.22s ease, filter 0.22s ease;
}

.gm-result-card__badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--gm-accent);
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 700;
}

/* hover kun på billede */
@media (hover: hover) and (pointer: fine) {
    .gm-result-card__main-link:hover .gm-result-card__image {
        transform: scale(1.02);
        filter: saturate(1.03);
    }

    .gm-result-card__main-link:hover .gm-result-card__image-wrap {
        box-shadow: inset 0 0 0 1px rgba(216, 195, 172, 0.35);
    }
}

/* =========================
   BODY
   ========================= */

.gm-result-card__body {
    display: grid;
    gap: 7px;
    align-content: start;
    padding: 14px 16px 16px;
    height: var(--gm-result-card-body-height);
    overflow: hidden;
}

.gm-result-card__brand {
    display: grid;
    grid-template-columns: minmax(18px, 1fr) auto auto minmax(18px, 1fr);
    align-items: center;
    gap: 6px;
    min-height: 18px;
    max-width: 100%;
    color: #927b55;
    font-size: 0.74rem;
    line-height: 1.2;
}

.gm-result-card__brand-rule {
    height: 1px;
    min-width: 18px;
    background: linear-gradient(
        90deg,
        rgba(203, 171, 104, 0),
        rgba(203, 171, 104, 0.72)
    );
}

.gm-result-card__brand-rule:last-child {
    background: linear-gradient(
        90deg,
        rgba(203, 171, 104, 0.72),
        rgba(203, 171, 104, 0)
    );
}

.gm-result-card__brand-prefix {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.gm-result-card__brand-logo {
    display: block;
    width: auto;
    max-width: 42px;
    height: 17px;
    object-fit: contain;
    object-position: center;
}

.gm-result-card__brand-name {
    max-width: 120px;
    overflow: hidden;
    color: var(--gm-text);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.gm-result-card__title {
    margin: 0;
    color: var(--gm-text);
    font-size: 1.16rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.18;

    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.gm-result-card__reason {
    margin: 0;
    color: var(--gf-text-soft);
    font-size: 0.96rem;
    line-height: 1.58;

    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.gm-result-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
    align-items: center;
}

.gm-result-card__price {
    color: var(--gm-text);
    font-size: 1rem;
    font-weight: 800;
}

.gm-result-card__store {
    color: #8d7e70;
    font-size: 0.9rem;
}

/* =========================
   FOOTER
   ========================= */

.gm-result-card__footer {
    position: relative;
    z-index: 3;
    display: grid;
    gap: 6px;
    min-width: 0;
    margin-top: -1px;
    padding: 12px 14px 14px;
    border-top: 1px solid rgba(216, 195, 172, 0.72);
    background: linear-gradient(
        180deg,
        #fffdf9,
        #fcf6f0
    );
    box-shadow: 0 -1px 0 rgba(255, 253, 249, 0.92);
}

/* header row */
.gm-result-card__footer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}

/* label */
.gm-result-card__related-label {
    min-width: 0;
    font-size: 0.82rem;
    font-weight: 700;
    color: #8d7e70;
}

/* thumbnails row */
.gm-result-card__related-items {
    display: flex;
    gap: 8px;
    align-items: center;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
    scrollbar-width: none;
}

.gm-result-card__related-items::-webkit-scrollbar {
    display: none;
}

/* thumbnails */
.gm-result-card__related-item {
    width: 56px;
    height: 56px;
    flex: 0 0 56px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0;
    border: 1px solid rgba(216, 195, 172, 0.88);
    border-radius: 12px;
    overflow: hidden;
    background: #fffdf9;

    box-shadow: 0 2px 8px rgba(44, 24, 8, 0.04);

    transition: transform 0.16s ease,
                box-shadow 0.16s ease,
                border-color 0.16s ease;

    cursor: pointer;
}

.gm-result-card__related-item:hover {
    transform: translateY(-1px);
    border-color: var(--gm-border-strong);
    box-shadow: 0 8px 18px rgba(44, 24, 8, 0.10);
}

.gm-result-card__related-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* "Se alle" link */
.gm-result-card__related-link {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    color: var(--gm-text);
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.gm-result-card__related-link:hover {
    text-decoration: underline;
}


/* =========================
   UTILITIES (swap support)
   ========================= */

.gm-result-card__badge[hidden],
.gm-result-card__brand[hidden],
.gm-result-card__brand-logo[hidden],
.gm-result-card__brand-name[hidden],
.gm-result-card__reason[hidden],
.gm-result-card__price[hidden],
.gm-result-card__store[hidden] {
    display: none !important;
}

