/* Common Christmas Landing Page Styles */

/* Base Resets */
html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #000 !important;
}

body,
.content, article, .article,
main, #main, #content {
    margin: 0 !important;
    padding: 0 !important;
}

body > *:not(.xmas-page) {
    margin: 0 !important;
    padding: 0 !important;
}

/* Main Page Wrapper */
.xmas-page {
    width: 100vw !important;
    max-width: 100vw !important;
    margin: 0 !important;
    padding: 0 !important;
    margin-left: calc(-50vw + 50%) !important;
    margin-right: calc(-50vw + 50%) !important;
    box-sizing: border-box !important;
    background: #0a0a0a !important;
    font-family: 'Gabarito', sans-serif !important;
    overflow-x: hidden !important;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
}

.xmas-page * {
    font-family: 'Gabarito', sans-serif;
    box-sizing: border-box !important;
}

.xmas-page .tw-max-w-7xl,
.xmas-page .tw-max-w-5xl,
.xmas-page .tw-max-w-4xl {
    max-width: 80rem !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

@media (max-width: 767px) {
    .xmas-page .tw-max-w-7xl,
    .xmas-page .tw-max-w-5xl,
    .xmas-page .tw-max-w-4xl {
        max-width: 100% !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

.xmas-page img {
    max-width: 100% !important;
    height: auto !important;
}

.xmas-page a {
    text-decoration: none;
}

/* WCAG-Compliant Snow Animation */
.snow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.snowflake {
    position: absolute;
    top: -10px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1em;
    user-select: none;
    pointer-events: none;
    animation: snowfall linear infinite;
}

@keyframes snowfall {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) translateX(50px) rotate(360deg);
        opacity: 0.3;
    }
}

/* Respect prefers-reduced-motion - WCAG 2.2.2 */
@media (prefers-reduced-motion: reduce) {
    .snow-container {
        display: none !important;
    }
    .snow-toggle {
        display: none !important;
    }
}

/* Snow toggle button - WCAG compliant */
.snow-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px; /* Default right position */
    z-index: 10000;
    background: rgba(232, 201, 160, 0.95);
    border: 2px solid #E8C9A0;
    border-radius: 20px;
    padding: 12px 24px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    pointer-events: auto;
    font-weight: 600;
    font-size: 14px;
    color: #1a1a1a;
    font-family: 'Gabarito', sans-serif;
    white-space: nowrap;
    line-height: 1;
    box-sizing: border-box !important;
}

/* When competition button is present (on julesalg page), move snow toggle to the left */
.snow-toggle.with-competition-button {
    right: calc(20px + 200px + 6px);
}

.snow-toggle span {
    display: inline-block;
}

.snow-toggle:hover {
    background: rgba(232, 201, 160, 1);
    transform: scale(1.05);
}

.snow-toggle:focus {
    outline: 3px solid #E8C9A0;
    outline-offset: 4px;
}

.snow-paused .snowflake {
    animation-play-state: paused;
}

/* Competition button (always visible) */
.competition-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    background: rgba(232, 201, 160, 0.95);
    border: 2px solid #E8C9A0;
    border-radius: 20px;
    padding: 12px 24px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    pointer-events: auto;
    font-weight: 600;
    font-size: 14px;
    color: #1a1a1a;
    font-family: 'Gabarito', sans-serif;
    white-space: nowrap;
    line-height: 1;
    box-sizing: border-box !important;
    text-decoration: none !important;
}

.competition-button:hover {
    background: rgba(232, 201, 160, 1);
    transform: scale(1.05);
}

.competition-button:focus {
    outline: 3px solid #E8C9A0;
    outline-offset: 4px;
}

@media (max-width: 767px) {
    .snow-toggle {
        right: 20px;
        bottom: 20px; /* Default position on mobile */
    }

    /* On pages with competition button, move snow toggle up */
    .snow-toggle.with-competition-button {
        right: 20px;
        bottom: 80px;
    }

    .competition-button {
        right: 20px;
        bottom: 20px;
    }
}

/* Hero logo */
.hero-logo {
    width: auto;
    height: 40px;
}

@media (min-width: 768px) {
    .hero-logo {
        height: 50px;
    }
}

/* FAQ */
.faq-item {
    transition: all 0.3s ease;
}

.faq-answer {
    max-height: 500px;
    overflow: visible;
    transition: max-height 0.3s ease;
}

.faq-icon {
    display: none;
}

/* FAQ box paragraph line height */
.tw-grid .tw-rounded-lg p {
    line-height: 150%;
}

/* Category section styling */
.category-section {
    background: rgba(178, 34, 34, 0.08);
    border: 2px solid rgba(178, 34, 34, 0.3);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 3rem;
}

@media (max-width: 767px) {
    .category-section {
        padding: 1.5rem;
        margin-bottom: 2rem;
    }
}

/* Hide disabled navigation buttons */
.swiper-button-disabled {
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Product card image fix */
.xmas-page .swiper-slide img {
    max-height: 250px !important;
    width: auto !important;
    object-fit: contain !important;
}

/* Julekonkurrence Modal */
.competition-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.competition-modal.show {
    display: flex;
    opacity: 1;
}

.competition-modal-content {
    background: #1a1a1a;
    border: 2px solid rgba(232, 201, 160, 0.5);
    border-radius: 16px;
    padding: 32px;
    max-width: 600px;
    width: 100%;
    position: relative;
    animation: modalSlideIn 0.3s ease;
    font-family: 'Gabarito', sans-serif;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.competition-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(232, 201, 160, 0.2);
    border: none;
    color: #E8C9A0;
    font-size: 24px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.competition-modal-close:hover {
    background: rgba(232, 201, 160, 0.3);
    transform: scale(1.1);
}

@media (max-width: 640px) {
    .competition-modal {
        padding: 24px;
    }

    .competition-modal-content {
        padding: 24px 20px;
        max-width: 100%;
        margin: 0 8px;
    }

    .competition-modal-content h3 {
        font-size: 1.5rem !important;
    }

    .competition-modal-content .tw-text-xl {
        font-size: 1.125rem !important;
    }

    .competition-modal-content .tw-w-\[140px\] {
        width: 120px !important;
    }

    .competition-modal-content .tw-mb-6 {
        margin-bottom: 1.5rem !important;
    }

    .competition-modal-content .tw-px-8 {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }

    /* Force mobile buttons to stay within bounds */
    .competition-modal-content .sm\:tw-hidden button,
    .competition-modal-content .sm\:tw-hidden a {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
}

/* Hero section wrapper for julesalg */
.hero-section-wrapper {
    background: #1a1a1a;
}

/* Hero background with Christmas village image for julesalg */
.hero-gradient.julesalg {
    background-image: url('https://www.itlagersalg.dk/images/Jul%20slider%202025.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    max-width: 1750px;
    margin: 0 auto;
    border-radius: 16px;
    overflow: hidden;
}

/* Hero gradient background for competition */
.hero-gradient.competition {
    background: linear-gradient(135deg, #B22222 0%, #165B33 100%);
}

@media (max-width: 767px) {
    .hero-gradient {
        border-radius: 12px;
    }
    .hero-section-wrapper {
        padding-top: 1rem;
    }
}

/* Terms Sidebar (for competition page) */
.terms-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 90%;
    max-width: 600px;
    height: 100%;
    background: #1a1a1a;
    border-left: 2px solid rgba(232, 201, 160, 0.3);
    z-index: 10002;
    overflow-y: auto;
    transition: right 0.3s ease;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.5);
}

.terms-sidebar.show {
    right: 0;
}

.terms-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10001;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.terms-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.terms-content {
    padding: 2rem;
}

.terms-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(232, 201, 160, 0.3);
}

.terms-close {
    background: rgba(232, 201, 160, 0.2);
    border: none;
    color: #E8C9A0;
    font-size: 28px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.terms-close:hover {
    background: rgba(232, 201, 160, 0.3);
    transform: scale(1.1);
}
