@import url('http://fonts.googleapis.com/css?family=Roboto');
@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@400;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,700&display=swap');

:root {
    --primary-color: #333333;
    --primary-color-opacity: #333333f5;
    --secondary-color: #fff;
    --highlight-color: #f89f45;
    --highlight-color-opacity-medium: #f89f45c9;
    --highlight-color-opacity: #f89f4540;
    --secondary-highlight-color: #87CDED;
    --secondary-highlight-color-opacity: #87cded38;
    --tertiary-highlight-color: #29B6F6;
    --türkis-blau--türkisblau: #73b5b578;
    --success-color: #60ffba;
    --text-highlight-color: #002e1a;
    --background-color: #fdfdfa;
    --card-bg: #fff;
    --card-border-color: #eaeaea;
    --input-placeholder-color: #adadad;
}

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

html {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow-y: auto; /* Allow vertical scroll, prevent horizontal */
    overflow-x: hidden;
}

body {
    margin: 0;
    padding: 0;
    color: var(--primary-color);
    font-size: 16px;
    height: 100%; /* Can be min-height: 100vh if content is short */
    overflow-x: hidden; /* Prevent horizontal scroll on body */
    /* scrollbar-gutter: stable; /* This was commented out, can be considered */
    /* overflow: hidden; /* This was the problematic line */
}

/* Apply to the entire site */
body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
a,
span,
div {
    font-family: 'Archivo', sans-serif !important;
    /* color: var(--primary-color); */
}

.highlight-font,
.highlight-font * {
    font-family: 'Fraunces', sans-serif !important;
    font-size: 1.4rem !important;
    font-style: italic !important;
    font-weight: 900 !important;
    color: var(--text-highlight-color);
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}


.btn {
    text-decoration: none !important;
}

a:not(.btn) {
    text-decoration: none !important;
}

.btn:hover {
    text-decoration: none !important;
}

body a:not(.btn):hover {
    text-decoration: none !important;
  }
  

/* Custom Default Style Begin */

/* 1) Outer container: 20px padding around the edges */
#container-main {
    width: 100%;
    margin: 0;
    padding: 10px;
    box-sizing: border-box;
    /* Include padding in the width calculation */
}

/* 2) Make .row into a flex container with no gap */
.row {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    /* Remove gap to avoid extra spacing */
    margin: 0;
    /* Remove Bootstrap's negative margin */
    height: calc(100vh - 20px);
    /* Full height minus top and bottom padding */
}

/* 3) Sidebar styling */
#side-nav {
    flex: 0 0 auto;
    /* Do not grow or shrink */
    width: 250px;
    /* Set a fixed width for the sidebar */
    height: 100%;
    /* Full height of the row */
    margin-right: 10px;
    /* 20px margin between sidebar and main content */
    border-radius: 16px;
    border: 1px solid var(--card-border-color);
    background-color: #fdfdfa !important;
    overflow-y: auto;
    /* Make sidebar scrollable if content overflows */
    padding-right: 15px;
    padding-left: 15px;
}

/* 4) Main content styling */
#main-content {
    flex: 1;
    /* Grow to fill remaining space */
    height: 100%;
    /* Full height of the row */
    border-radius: 16px;
    border: 1px solid var(--card-border-color);
    /* background-color: #fdfdfa; */
    background-color: var(--background-color);
    overflow-y: auto;
    /* Make main content scrollable */
}

.remove-margin {
    margin: 0;
}

.main-content-row {
    display: flex;
    flex-direction: row;
    gap: 20px;
    /* space between the two columns */
    /* height: 100%; */
    margin: 0 auto;
    max-width: 880px;
}

/* Navbar CSS from content snippet */
#sidebar-navigation-top-section .sub-section-logo img {
    padding-bottom: 5px;
}

/* Navigation icons styling */
.nav-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-right: 10px;
    vertical-align: middle;
}

/* Fix vertical alignment of text and icon */
#side-nav a {
    display: flex;
    align-items: center;
    padding-right: 5px;
    text-decoration: none;
}

#side-nav a:hover {
    text-decoration: none !important;
}

#side-nav svg {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    vertical-align: middle;
}

#side-nav li a,
#side-nav a {
    color: #373e1d;
    display: block;
    width: 100%;
    font-weight: 500;
    font-size: 1rem;
}

.selected {
    background-color: var(--highlight-color-opacity);
    border-radius: 10px;
    color: var(--highlight-color) !important;
}

.selected:hover {
    color: var(--highlight-color) !important;
}

#sidebar-navigation-top-section {
    padding-top: 20px;
    padding-bottom: 20px;
}

#sidebar-navigation-top-section .sub-section {
    padding-bottom: 4px;
    padding-top: 4px;
}

.sub-section a,
.sub-section li {
    padding-left: 10px;
    padding-bottom: 10px;
    padding-top: 10px;
}

/* Ensure text doesn't wrap in desktop view */
.sub-section a span {
    vertical-align: middle;
    white-space: nowrap;
}

.sub-section-logo {
    padding: 10px;
    margin: 0 auto 30px;
}

/* Custom Default Style End */

.content-container {
    /* position: relative;  */
    /* Added to establish positioning context */
    flex: 1;
    padding: 20px 0px 20px;
    /* bottom padding for pinned bars */
    box-sizing: border-box;
    max-width: 700px;
    margin: 0 auto;
}

/* Headings & text styles */
.content-container h2 {
    font-size: 14px;
    margin-top: 0;
    margin-bottom: 8px;
    font-weight: 600;
}

.content-container h3 {
    font-size: 1.2rem;
    margin: 28px 0 20px 0;
}

.content-container p {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
}

/* Justified text modifier for legal/privacy content */
.content-container--justified {
    text-align: justify !important;
    text-justify: inter-word;
}

/* Spacing between consent bars and next button */
.next-btn-bar {
    margin-top: 8px;
}

#narrowContenContainer {
    padding-top: 0px;
    max-width: 600px;
}

/* #narrowContenContainer {
  padding-bottom: 0px;
} */

#moreNarrowContentContainer {
    max-width: 550px;
}

#medicationBottomnInner {
    max-width: 600px;
}

#centerHeaderTitle {
    text-align: center;
    margin: 20px 30px 40px;
    font-size: 1.3rem;
}

#centerSubtitle {
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 20px 96px 20px;
    text-align: center;
}

#subtitleHeader {
    font-size: 1.2rem;
    margin: 40px 0px 60px;
}

/* Wrapper for the product image so we can position buds & container together */
.product-wrapper {
    position: relative;
    display: inline-block;
    width: 200px;
    height: 200px;
    margin-bottom: 1.5rem;
}

.container-img {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: auto;
}

.buds-img {
    position: absolute;
    top: 30px;
    left: 10px;
    width: 80px;
    height: auto;
}

/* Bottom Wrapper Style */
/* .bottom-wrapper {
position: fixed;
bottom: 0;
left: 0;
right: 0;
z-index: 999;
display: flex;
justify-content: center;
padding: 20px 0;
box-sizing: border-box;
background-color: #fdfdfa;
} */

.transparent-background {
    background-color: transparent;
}

/* Consent Card style */
.consent-bar {
    background-color: #f7f0e9;
    border-radius: 6px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background-color 0.3s;
}

.consent-bar.on {
    background-color: var(--highlight-color-opacity);
}

.consent-text {
    flex: 1;
    font-size: 12px;
    font-weight: 500;
    margin-right: 10px;
}

/* Next Button style */
.next-btn-bar {
    background-color: #d9dce3;
    border-radius: 6px;
    text-align: center;
    transition: background-color 0.3s, color 0.3s;
}

.next-btn-bar.on {
    background-color: var(--primary-color);
}

.next-btn-bar button {
    width: 100%;
    border: none;
    font-weight: 600;
    font-size: 16px;
    padding: 16px;
    border-radius: 4px;
    cursor: pointer;
    background-color: transparent;
    transition: color 0.3s, opacity 0.3s;
}

.next-btn-bar button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.next-btn-bar button:hover {
    opacity: 0.9;
}

.next-btn-bar.on button:not(:disabled) {
    color: var(--secondary-color);
}

[id^="WebFormControl_"] {
    display: none;
}

/* muss raus */
.private-mode-banner {
    display: none;
}

/* custom scrollbar */
/* ::-webkit-scrollbar {
    width: 20px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background-color: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: #f7f7f7;
    border-radius: 20px;
    border: 6px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #e7e7e7;
}
 */

/* ===============================
   Media Queries
   =============================== */

/* Extra small devices (phones) */
@media (max-width: 576px) {
    #side-nav .sub-section a {
        font-size: 0.55rem;
        padding: 5px 0;
    }

    #side-nav .sub-section a .nav-icon {
        width: 18px;
        height: 18px;
        margin-bottom: 3px;
    }
    
    #main-content {
        scrollbar-gutter: auto;
    }
}

/* Small devices (tablets and phones) */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    
    .content-container {
        /* Normal padding for mobile - no need for extra bottom padding since bottom-wrapper is not fixed */
        padding: 20px 20px 20px;
    }
    
    /* Override modifier classes on mobile - no extra padding needed since bottom-wrapper is not fixed */
    .content-container--with-fixed-bottom,
    .content-container--with-fixed-button {
        padding-bottom: 20px !important;
    }

    .main-content-row {
        flex-direction: column; /* Stack columns on mobile */
        max-width: 100%; 
        width: 100%; /* Ensure it uses full viewport width */
        /* Restore original margin for centering, but adapt for mobile */
        margin: 0 auto;
        /* Keep gap minimal for mobile stacking */
        gap: 0;
        box-sizing: border-box;
    }

    /* Ensure the bottom navbar stays at the bottom */
    #container-main {
        padding: 0;
        /* Remove padding on mobile */
    }

    /* Adjust icon and text size for smaller screens */
    #side-nav .sub-section a .nav-icon {
        width: 18px;
        height: 18px;
    }

    #side-nav .sub-section a {
        font-size: 0.6rem;
    }
    
    .bottom-wrapper {
        /* Remove fixed positioning on mobile - let it flow naturally */
        position: static;
        padding: 20px 0 20px;
        width: 100%;
        background: transparent;
        display: flex;
        justify-content: center;
    }

    .bottom-inner {
        gap: 12px;
        padding: 0 20px;
        max-width: 700px; /* Match content-container max-width */
        width: 100%;
        display: flex;
        flex-direction: column;
    }

    /* Ensure buttons in the bottom wrapper are clickable */
    .bottom-wrapper button,
    .bottom-wrapper a {
        position: relative;
        z-index: 1001;
    }
    
    .consent-bar {
        border-radius: 4px;
    }
    
    .next-btn-bar {
        border-radius: 4px;
    }

    .content-container,
    #moreNarrowContentContainer {
        /* On mobile, take full width with normal padding */
        max-width: 100%;
        width: 100%;
        padding: 0 0 0;
        margin: 0 auto;
        box-sizing: border-box;
    }

    #subtitleHeader {
        margin: 20px 0px 40px;
    }
}

/* @media (min-width: 768px) {
    .swiper-pagination {
        display: none;
    }
} */

/* Medium devices (tablets and small desktops) */
@media (max-width: 1024px) {
    /* CRITICAL: Remove position: relative from body - this breaks Safari scrolling */
    html {
        height: 100%;
        margin: 0;
        padding: 0;
        /* Fix for Safari viewport calculation */
        min-height: 100vh;
        /* Use small viewport for better Safari compatibility */
        min-height: 100svh;
    }
    
    /* Override with svh when supported */
    @supports (height: 100svh) {
        html {
            min-height: 100svh;
        }
    }
    
    body {
        margin: 0;
        padding: 0;
        height: 100%;
        /* REMOVED: position: relative - this was breaking Safari scrolling */
        /* REMOVED: -webkit-overflow-scrolling: touch - causes momentum conflicts */
        overflow: hidden; /* Prevent body scroll, let main content handle it */
        /* Note: padding-bottom removed because #main-content now handles the bottom spacing */
    }
    
    #main-content {
        /* Safari iOS Fix: Create a fixed scrolling wrapper */
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 70px; /* Leave space for bottom nav */
        width: 100%;
        height: calc(100vh - 70px);
        /* Use small viewport height for Safari compatibility */
        height: calc(100svh - 70px);
        margin: 0;
        order: 1;
        /* CRITICAL: Use scroll, not auto - Safari requirement */
        overflow-y: scroll;
        overflow-x: hidden;
        /* Safari iOS fix: Use -webkit-fill-available when appropriate */
        height: -webkit-fill-available;
        max-height: calc(100vh - 70px);
        border-radius: 0;
        border: none;
        /* Add momentum scrolling back, but in controlled way */
        -webkit-overflow-scrolling: touch;
    }
    
    /* Enhanced Safari support with svh */
    @supports (height: 100svh) {
        #main-content {
            height: calc(100svh - 70px);
            max-height: calc(100svh - 70px);
        }
    }
    
    #container-main {
        padding: 0;
        /* Remove padding on mobile */
    }
    
    .row {
        flex-direction: column;
        height: auto;
        position: relative;
    }

    #side-nav {
        width: 100%;
        margin: 0;
        order: 2;
        /* Display side nav second (at bottom) */
        height: 70px;
        /* Fixed height for bottom navbar */
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        border-radius: 0;
        /* Remove rounded corners on mobile */
        border: none;
        /* Remove border on mobile */
        border-top: 1px solid #eee;
        /* Add subtle top border */
        padding: 0;
        box-shadow: none;
        /* Remove shadow on mobile */
        overflow-x: auto;
        /* Allow horizontal scrolling if needed */
        overflow-y: hidden;
        /* Prevent vertical scrolling */
        background-color: #FFFFFF;
    }
    
    #side-nav svg {
        display: block;
        width: 18px;
        height: 18px;
        margin: 0 auto 4px;
    }

    /* Mobile navigation layout */
    #side-nav #sidebar-navigation-top-section {
        display: flex;
        flex-direction: row;
        width: 100%;
        padding: 0;
        margin: 0;
        justify-content: space-around;
        align-items: center;
    }

    /* Hide the logo on mobile bottom nav */
    #side-nav .sub-section-logo {
        display: none !important;
    }

    /* Style the main navigation items for mobile */
    #side-nav .sub-section {
        margin: 0;
        padding: 0;
        text-align: center;
        flex: 1;
    }

    #side-nav .sub-section a {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 5px 2px;
        font-size: 0.65rem;
        text-align: center;
        height: 70px;
        width: auto;
    }

    /* Reset text alignment for mobile */
    .sub-section a span {
        white-space: normal;
        display: block;
        text-align: center;
    }

    /* Adjust selected style for mobile - highlight only icon and text */
    #side-nav .sub-section a.selected {
        background-color: transparent;
        position: relative;
    }

    #side-nav .sub-section a.selected .nav-icon,
    #side-nav .sub-section a.selected span {
        position: relative;
        z-index: 1;
    }

    #side-nav .sub-section a.selected::after {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 60px;
        height: 50px;
        background-color: var(--highlight-color-opacity);
        border-radius: 18%;
        z-index: 0;
    }

    /* Style navigation icons for mobile */
    #side-nav .sub-section a .nav-icon {
        display: block;
        width: 18px;
        height: 18px;
        margin: 0 auto 4px;
    }
    
    /* Bottom wrapper for tablets - remove fixed positioning, use normal flow */
    .bottom-wrapper {
        position: static;
        padding: 20px 0 20px;
        width: 100%;
        background: transparent;
        display: flex;
        justify-content: center;
    }

    .bottom-inner {
        gap: 6px;
        padding: 0;
        max-width: 700px; /* Match content-container max-width */
        width: 100%;
        display: flex;
        flex-direction: column;
    }
    
    /* Override modifier classes on tablets - no extra padding needed since bottom-wrapper is not fixed */
    .content-container--with-fixed-bottom,
    .content-container--with-fixed-button {
        padding-bottom: 20px !important;
    }
}

/* Large devices (desktops) */
@media (min-width: 1025px) {
    /* Reset mobile layout for desktop */
    html, body {
        height: auto;
        overflow: auto;
        position: static;
    }
    
    .content-container--with-fixed-bottom {
        padding-bottom: 220px !important;
    }
    
    .content-container--with-fixed-button {
        padding-bottom: 106px !important;
    }
    
    #main-content {
        /* Reset mobile fixed positioning for desktop */
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        bottom: auto;
        height: 100%;
        max-height: none;
        overflow-y: auto;
        scrollbar-gutter: stable;
    }
    
    .bottom-wrapper {
        position: fixed;
        bottom: -8px;
        left: calc(250px + -8px);
        right: 0;
        z-index: 999;
        padding: 15px 0;
        box-sizing: border-box;
        display: flex;
        justify-content: center;
    }
    
    .bottom-inner {
        display: flex;
        flex-direction: column;
        gap: 12px;
        width: 100%;
        max-width: 700px; /* Match content-container max-width */
        margin: 0 auto;
        box-sizing: border-box;
        justify-content: center;
        /* background-color: #fdfdfa;
        border-radius: 8px; 
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); */ 
        padding: 14px 0px;
        margin-bottom: 4px;
        background: var(--background-color);
    }
    
    /* custom scrollbar only for desktop */
    ::-webkit-scrollbar {
        width: 20px;
        height: 10px;
    }

    ::-webkit-scrollbar-track {
        background-color: transparent;
    }

    ::-webkit-scrollbar-thumb {
        background-color: #f7f7f7;
        border-radius: 20px;
        border: 6px solid transparent;
        background-clip: content-box;
    }

    ::-webkit-scrollbar-thumb:hover {
        background-color: #e7e7e7;
    }
    
/*     .swiper-pagination {
        display: none;
    } */
}

/* ===============================
   Safari iOS Scrolling JavaScript Fix
   =============================== */

/* This CSS provides the foundation, but we also need JavaScript to prevent 
   Safari from getting trapped at scroll boundaries. Add this to your JavaScript:

// Safari iOS scrolling fix - prevents scroll boundary trapping
function fixSafariScrolling() {
    const mainContent = document.getElementById('main-content');
    if (!mainContent) return;
    
    let isScrolling = false;
    
    mainContent.addEventListener('scroll', function() {
        if (isScrolling) return;
        
        requestAnimationFrame(() => {
            const { scrollTop, scrollHeight, clientHeight } = this;
            const atTop = scrollTop === 0;
            const atBottom = scrollTop === scrollHeight - clientHeight;
            
            if (atTop) {
                this.scrollTop = 1; // Move 1px from top
            } else if (atBottom) {
                this.scrollTop = scrollHeight - clientHeight - 1; // Move 1px from bottom
            }
            
            isScrolling = false;
        });
        
        isScrolling = true;
    });
}

// Initialize when DOM is ready
if (document.readyState === 'loading') {
    document.addEventListener('DOMContentLoaded', fixSafariScrolling);
} else {
    fixSafariScrolling();
}

*/

/* ===============================
   Skeleton Loading Animations
   =============================== */

/* Skeleton loading container */
.skeleton-container {
    opacity: 0.7;
}

/* Base skeleton element with shimmer animation */
.skeleton-text {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
    height: 1em;
    margin: 0.25em 0;
}

/* Skeleton text size variations */
.skeleton-text-long {
    width: 80%;
}

.skeleton-text-medium {
    width: 60%;
}

.skeleton-text-short {
    width: 40%;
}

.skeleton-text-price {
    width: 60px;
}

/* Skeleton image placeholder */
.skeleton-image {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 6px;
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}

/* Disable interactions on skeleton items */
.skeleton-item {
    pointer-events: none;
}

/* Skeleton card for full card components */
.skeleton-card {
    background: linear-gradient(90deg, #f8f8f8 25%, #e8e8e8 50%, #f8f8f8 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
    min-height: 200px;
    margin: 1rem 0;
    border: 1px solid #eee;
}

/* Shimmer animation keyframes */
@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Loading state management */
.loading-state .content {
    display: none;
}

.loading-state .skeleton {
    display: block;
}

.content-state .content {
    display: block;
}

.content-state .skeleton {
    display: none;
}

/* Hide skeleton when real data is loaded */
.order-items:not(.skeleton-container) .skeleton-item,
.order-total:not(.skeleton-container) .skeleton-text {
    display: none;
}
