/* ==================================================
   SHARED.CSS
   ================================================== */

/* ==================================================
   SLIKSKOVEN — FÆLLES FUNDAMENT
   Denne fil erstatter style.css.
   Indlæs altid shared.css før sidens specifikke CSS.
   ================================================== */

:root {
    --candy-cream: #fff8e9;
    --candy-paper: #fffdf7;
    --candy-forest: #123f35;
    --candy-forest-dark: #082b25;
    --candy-pink: #ff5b8d;
    --candy-pink-dark: #dd356e;
    --candy-yellow: #ffd64f;
    --candy-mint: #78dfc0;
    --candy-purple: #8068f5;
    --candy-red: #f04c5f;
    --candy-text: #15342e;
    --candy-muted: #66756f;
    --candy-border: rgba(18, 63, 53, 0.12);
    --candy-shadow: 0 22px 55px rgba(18, 63, 53, 0.13);
    --focus-ring: 0 0 0 4px rgba(255, 91, 141, 0.15);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body,
h1,
h2,
h3,
h4,
p,
ol,
ul,
dl,
dd,
figure {
    margin: 0;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    background:
            radial-gradient(
                    circle at 8% 15%,
                    rgba(255, 91, 141, 0.09),
                    transparent 24%
            ),
            radial-gradient(
                    circle at 92% 35%,
                    rgba(120, 223, 192, 0.12),
                    transparent 25%
            ),
            var(--candy-cream);
    color: var(--candy-text);
    font-family:
            "Trebuchet MS",
            "Arial Rounded MT Bold",
            Arial,
            sans-serif;
    line-height: 1.6;
}

img,
svg {
    max-width: 100%;
}

img {
    height: auto;
}

button,
input,
textarea,
select {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid rgba(18, 63, 53, 0.16);
    border-radius: 16px;
    padding: 13px 15px;
    background: #fffdf9;
    color: var(--candy-text);
    outline: none;
    transition:
            border-color 160ms ease,
            box-shadow 160ms ease,
            background 160ms ease;
}

textarea {
    min-height: 130px;
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--candy-pink);
    background: white;
    box-shadow: var(--focus-ring);
}

label {
    color: var(--candy-forest);
    font-size: 13px;
    font-weight: 900;
}

::placeholder {
    color: #8a958f;
}


/* Fælles knapper */

button,
.button,
.primary-link,
.secondary-link,
.modal-close-btn {
    min-height: 44px;
    padding: 11px 17px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 9px;
    border: 1px solid transparent;
    border-radius: 14px;
    background: var(--candy-forest);
    color: white;
    font-size: 13px;
    font-weight: 900;
    text-decoration: none;
    box-shadow: 0 9px 21px rgba(18, 63, 53, 0.14);
    transition:
            transform 160ms ease,
            background 160ms ease,
            border-color 160ms ease,
            box-shadow 160ms ease;
}

button:hover,
.button:hover,
.primary-link:hover,
.modal-close-btn:hover {
    background: var(--candy-forest-dark);
    transform: translateY(-2px);
}

.secondary-link {
    border-color: var(--candy-border);
    background: white;
    color: var(--candy-forest);
    box-shadow: 0 8px 20px rgba(18, 63, 53, 0.07);
}

.secondary-link:hover {
    border-color: var(--candy-pink);
    background: #fff2f6;
    transform: translateY(-2px);
}


/* Standardheader til sider, der endnu ikke bruger .site-header */

body > header:not(.site-header) {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    padding: 15px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(18, 63, 53, 0.96);
    color: white;
    backdrop-filter: blur(18px);
}

body > header:not(.site-header) h1 {
    color: white;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: -0.8px;
}

body > header:not(.site-header) nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

body > header:not(.site-header) nav a {
    padding: 9px 13px;
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

body > header:not(.site-header) nav a:hover {
    background: rgba(255, 255, 255, 0.11);
    color: white;
}

body > header:not(.site-header) nav button {
    min-height: 38px;
    padding: 8px 13px;
    border-color: rgba(255, 255, 255, 0.18);
    background: transparent;
    box-shadow: none;
}


/* Standardmain til simple sider */

body > main:not(.home-main):not(.catalog-main):not(.order-main):not(.news-main) {
    width: min(1120px, calc(100% - 32px));
    max-width: none;
    margin: 0 auto;
    padding: 58px 0 80px;
}

body > main:not(.home-main):not(.catalog-main):not(.order-main):not(.news-main) > h2 {
    margin-bottom: 28px;
    color: var(--candy-forest);
    font-size: clamp(38px, 6vw, 66px);
    line-height: 1;
    letter-spacing: -3px;
    text-align: left;
}

body > main:not(.home-main):not(.catalog-main):not(.order-main):not(.news-main) > section {
    margin-bottom: 26px;
    padding: 28px;
    border: 1px solid var(--candy-border);
    border-radius: 27px;
    background: rgba(255, 253, 247, 0.94);
    box-shadow: var(--candy-shadow);
}

body > main h3 {
    color: var(--candy-forest);
}

body > main p {
    color: var(--candy-muted);
}


/* Fælles modal */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    padding: 22px;
    overflow-y: auto;
    background: rgba(8, 43, 37, 0.68);
    backdrop-filter: blur(12px);
}

.modal-content {
    position: relative;
    width: min(680px, 100%);
    max-height: calc(100vh - 44px);
    overflow-y: auto;
    margin: max(20px, 5vh) auto;
    padding: 32px;
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 30px;
    background: var(--candy-paper);
    box-shadow: 0 35px 100px rgba(0, 0, 0, 0.3);
}

.close-btn {
    cursor: pointer;
}


/* Fælles toast */

.toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9999;
    max-width: min(370px, calc(100% - 30px));
    padding: 14px 19px;
    border-radius: 15px;
    background: var(--candy-forest-dark);
    color: white;
    font-size: 13px;
    font-weight: 900;
    box-shadow: 0 20px 50px rgba(8, 43, 37, 0.28);
    opacity: 0;
    pointer-events: none;
    transform: translateY(18px);
    transition:
            opacity 200ms ease,
            transform 200ms ease;
}

.toast.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}


/* Fælles hjælpeklasser */

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: -1px !important;
    border: 0 !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
}

.ingen-nyheder {
    padding: 35px 20px;
    color: var(--candy-muted);
    text-align: center;
}

.admin-only {
    margin-bottom: 22px;
    padding: 15px;
    border: 1px solid var(--candy-border);
    border-radius: 17px;
    background: #fff7d9;
}

.admin-only nav {
    display: flex;
    justify-content: center;
}

.auth-nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-user-name {
    color: inherit;
    font-size: 13px;
    font-weight: 900;
}

.checkbox-row {
    width: fit-content;
    margin: 8px 0 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--candy-forest);
    cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
    width: 21px;
    height: 21px;
    margin: 0;
    accent-color: var(--candy-forest);
}

.loading-state {
    padding: 42px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 4px solid rgba(18, 63, 53, 0.12);
    border-top-color: var(--candy-pink);
    border-radius: 50%;
    animation: shared-spin 750ms linear infinite;
}

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

@media (max-width: 760px) {
    body > header:not(.site-header) {
        padding: 14px 16px;
        flex-direction: column;
        gap: 13px;
        text-align: center;
    }

    body > header:not(.site-header) nav {
        justify-content: center;
    }

    body > header:not(.site-header) nav a {
        padding: 8px 10px;
        font-size: 12px;
    }

    body > main:not(.home-main):not(.catalog-main):not(.order-main):not(.news-main) {
        width: min(100% - 22px, 1120px);
        padding-top: 28px;
    }

    body > main:not(.home-main):not(.catalog-main):not(.order-main):not(.news-main) > h2 {
        font-size: 40px;
        letter-spacing: -2px;
    }

    body > main:not(.home-main):not(.catalog-main):not(.order-main):not(.news-main) > section {
        padding: 22px 17px;
        border-radius: 22px;
    }

    .modal {
        padding: 14px;
    }

    .modal-content {
        padding: 25px 17px;
        border-radius: 24px;
    }

    .toast {
        right: 15px;
        bottom: 15px;
        left: 15px;
        max-width: none;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==================================================
   REGLER FRA DET SENESTE GODKENDTE DESIGN
   ================================================== */

:root {
    --candy-cream: #fff8e9;
    --candy-paper: #fffdf7;
    --candy-forest: #123f35;
    --candy-forest-dark: #082b25;
    --candy-pink: #ff5b8d;
    --candy-pink-dark: #dd356e;
    --candy-yellow: #ffd64f;
    --candy-mint: #78dfc0;
    --candy-purple: #8068f5;
    --candy-red: #f04c5f;
    --candy-text: #15342e;
    --candy-muted: #66756f;
    --candy-border: rgba(18, 63, 53, 0.12);
    --candy-shadow: 0 22px 55px rgba(18, 63, 53, 0.13);
}

body.candy-home {
    min-height: 100vh;
    overflow-x: hidden;
    background:
            radial-gradient(
                    circle at 10% 15%,
                    rgba(255, 91, 141, 0.11),
                    transparent 24%
            ),
            radial-gradient(
                    circle at 92% 30%,
                    rgba(120, 223, 192, 0.14),
                    transparent 25%
            ),
            var(--candy-cream);
    color: var(--candy-text);
    font-family:
            "Trebuchet MS",
            "Arial Rounded MT Bold",
            Arial,
            sans-serif;
}

body.candy-home::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.3;
    background-image:
            radial-gradient(
                    rgba(18, 63, 53, 0.16) 1px,
                    transparent 1px
            );
    background-size: 24px 24px;
}

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 10000;
    padding: 12px 18px;
    border-radius: 12px;
    background: var(--candy-forest-dark);
    color: white;
    text-decoration: none;
    transform: translateY(-150%);
}

.skip-link:focus {
    transform: translateY(0);
}

.announcement-bar {
    min-height: 38px;
    padding: 8px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    background: var(--candy-yellow);
    color: var(--candy-forest-dark);
    font-size: 14px;
    font-weight: 800;
    text-align: center;
}

.announcement-bar p {
    color: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    padding: 15px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(18, 63, 53, 0.96);
    backdrop-filter: blur(18px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 13px;
    color: white;
    text-decoration: none;
}

.brand-icon {
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border: 3px solid rgba(255, 255, 255, 0.7);
    border-radius: 17px 17px 17px 6px;
    background:
            linear-gradient(
                    145deg,
                    var(--candy-pink),
                    var(--candy-purple)
            );
    color: white;
    font-size: 27px;
    font-weight: 900;
    box-shadow: 0 8px 20px rgba(8, 43, 37, 0.25);
    transform: rotate(-4deg);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.brand-text strong {
    font-size: 24px;
    letter-spacing: -0.8px;
}

.brand-text small {
    margin-top: 5px;
    color: rgba(255, 255, 255, 0.68);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.3px;
    text-transform: uppercase;
}

.site-header nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.site-header nav a {
    padding: 10px 15px;
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
}

.site-header nav a:hover,
.site-header nav a.active {
    background: rgba(255, 255, 255, 0.12);
    color: white;
}

.site-header nav .bag-nav-link {
    margin-left: 5px;
    padding-inline: 19px;
    background: var(--candy-pink);
    color: white;
    box-shadow: 0 8px 22px rgba(255, 91, 141, 0.27);
}

.site-header nav .bag-nav-link:hover {
    background: var(--candy-pink-dark);
}

.site-header .auth-nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.site-header .auth-nav-links button {
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    color: white;
    box-shadow: none;
}

.site-header .nav-user-name {
    color: white;
}

.candy-button {
    min-height: 52px;
    padding: 14px 22px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 900;
    text-decoration: none;
    transition:
            transform 180ms ease,
            box-shadow 180ms ease,
            background 180ms ease;
}

.candy-button:hover {
    transform: translateY(-3px) rotate(-1deg);
}

.candy-button-primary {
    background: var(--candy-pink);
    color: white;
    box-shadow: 0 14px 28px rgba(255, 91, 141, 0.26);
}

.candy-button-primary:hover {
    background: var(--candy-pink-dark);
}

.candy-button-secondary {
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.candy-button-dark {
    background: var(--candy-forest);
    color: white;
    box-shadow: 0 13px 28px rgba(18, 63, 53, 0.2);
}

.section-kicker {
    margin-bottom: 10px;
    color: var(--candy-pink-dark);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.site-footer {
    padding: 40px 5%;
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 35px;
    background: var(--candy-forest-dark);
    color: white;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.footer-brand .brand-icon {
    width: 43px;
    height: 43px;
    font-size: 23px;
}

.footer-brand strong {
    font-size: 20px;
}

.footer-brand p,
.footer-copy {
    color: rgba(255, 255, 255, 0.55);
    font-size: 13px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--candy-yellow);
}

@media (max-width: 760px) {
    .announcement-bar {
        font-size: 12px;
    }

    .site-header {
        padding: 14px 16px;
        flex-direction: column;
        gap: 14px;
    }

    .brand-text strong {
        font-size: 21px;
    }

    .site-header nav {
        justify-content: center;
    }

    .site-header nav a {
        padding: 8px 11px;
        font-size: 12px;
    }

    .site-header nav .bag-nav-link {
        margin-left: 0;
    }

    .candy-button {
        width: 100%;
    }

    .site-footer {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-brand,
    .footer-links {
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

body.candy-page {
    min-height: 100vh;
    overflow-x: hidden;
    background:
            radial-gradient(circle at 8% 18%, rgba(255, 91, 141, 0.11), transparent 23%),
            radial-gradient(circle at 92% 40%, rgba(120, 223, 192, 0.14), transparent 25%),
            var(--candy-cream);
    color: var(--candy-text);
    font-family: "Trebuchet MS", "Arial Rounded MT Bold", Arial, sans-serif;
}

body.candy-page::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.25;
    background-image:
            radial-gradient(rgba(18, 63, 53, 0.16) 1px, transparent 1px);
    background-size: 24px 24px;
}

.announcement-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border: 2px solid var(--candy-forest-dark);
    border-radius: 50%;
}

.announcement-dot:last-child {
    background: var(--candy-forest-dark);
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: -1px !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.order-kicker {
    width: fit-content;
    margin-bottom: 18px;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--candy-yellow);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

.order-section-heading {
    margin-bottom: 31px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 30px;
}

.order-section-heading h2 {
    margin: 0 0 10px;
    color: var(--candy-forest);
    font-size: clamp(38px, 5vw, 58px);
    line-height: 1;
    letter-spacing: -3px;
    text-align: left;
}

.order-section-heading p:not(.section-kicker) {
    color: var(--candy-muted);
    font-size: 16px;
}

.order-back-link {
    flex: 0 0 auto;
    padding: 12px 18px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--candy-border);
    border-radius: 999px;
    background: white;
    color: var(--candy-forest);
    font-size: 14px;
    font-weight: 900;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(18, 63, 53, 0.08);
}

.order-back-link:hover {
    border-color: var(--candy-pink);
    transform: translateY(-2px);
}

.order-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.72fr);
    gap: 24px;
    align-items: start;
}

.order-details-column {
    min-width: 0;
    display: grid;
    gap: 21px;
}

.order-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.order-modal-heading {
    margin-bottom: 24px;
    padding-right: 55px;
}

.order-modal-heading h3 {
    margin: 0 0 8px;
    color: var(--candy-forest);
    font-size: clamp(30px, 5vw, 44px);
    line-height: 1;
    letter-spacing: -2px;
}

.order-modal-heading > p:not(.section-kicker) {
    color: var(--candy-muted);
    font-size: 13px;
}

@media (max-width: 1000px) {
    .order-kicker {
        margin-inline: auto;
    }

    .order-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .order-section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .order-section-heading h2 {
        font-size: 40px;
        letter-spacing: -2px;
    }

    .order-back-link {
        width: 100%;
        justify-content: center;
    }

    .order-form-grid {
        grid-template-columns: 1fr;
    }
}

/* ==================================================
   AUTH-NAVIGATION OG LOGUD
   Fælles regler, fordi api.js indsætter disse elementer
   dynamisk på alle offentlige sider.
   ================================================== */

.site-header .auth-nav-links,
body > header:not(.site-header) .auth-nav-links {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.site-header .auth-nav-links a,
body > header:not(.site-header) .auth-nav-links a {
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.07);
}

.site-header .auth-nav-links a:hover,
body > header:not(.site-header) .auth-nav-links a:hover {
    border-color: rgba(255, 214, 79, 0.55);
    background: rgba(255, 214, 79, 0.11);
}

.site-header .auth-nav-links button,
body > header:not(.site-header) .auth-nav-links button {
    min-height: 38px;
    padding: 8px 13px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    font-weight: 900;
    box-shadow: none;
}

.site-header .auth-nav-links button:hover,
body > header:not(.site-header) .auth-nav-links button:hover {
    border-color: rgba(255, 91, 141, 0.55);
    background: rgba(255, 91, 141, 0.15);
    color: white;
    transform: translateY(-1px);
}

.site-header .nav-user-name,
body > header:not(.site-header) .nav-user-name {
    max-width: 160px;
    overflow: hidden;
    padding: 8px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.74);
    font-size: 11px;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 760px) {
    .site-header .auth-nav-links,
    body > header:not(.site-header) .auth-nav-links {
        width: 100%;
        justify-content: center;
    }

    .site-header .nav-user-name,
    body > header:not(.site-header) .nav-user-name {
        max-width: 130px;
    }
}