:root {
    --background-surface: #EFEFEF;
    --primaryColor: #43281C;
    --primaryColor: #f2e9d2;
    --secondaryColor: #333D29;
    --color3: #7F4F24;
    --color4: #B08968;
    --color5: #DDB892;
    --color6: #EDE0D4;
    --highlight: #FBF2C6;
    --highlight: #2d2707;
}

:root {
    --background-color-primary: #ebebeb;
    --background-color-secondary: #fafafa;
    --accent-color: #cacaca;
    --text-color-primary: #222222;
    --element-size: 4rem;
}

:root {
    /* --background-color-primary: #FCFBF4; */
    /* --background-color-secondary: #f7f9f9; */
    --background-color-tertiary: #ffffff;
    --background-color-danger: #ff0000;
    --background-color-success: #008000;
    --drop-shadow-primary: #646cffaa;
    --accent-color: #3f3f3f;
    --text-color-primary: #222222;
    --input-background-color-primary: #f6f6f7;
    --button-background-color-primary: #0f1419;
    /* #0f1419 #1d9bf0 #1d9bf0; #0040ff*/
    --button-text-color-primary: #ebebeb;
    /* background-color: #000000; */
}

*,
::after,
::before {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.container,
html,
body {
  height: 100%;
  width: 100%;
  font-size: 1rem;
  /* font-size: 1rem!important; */
}

html, body {
    padding: 0;
    margin: 0;
    font-family: 'Open Sans', sans-serif;
    height: 100%;
    width: 100%;
}

/* Header positioning is handled in .header class */

.header {
    background-color: var(--primaryColor);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 1rem;
    min-height: 80px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 100%;
    box-sizing: border-box;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: height 300ms ease-in-out, 
                box-shadow 300ms ease-in-out,
                min-height 300ms ease-in-out;
    will-change: height, box-shadow, min-height;
}

/* Scrolled state for header */
.header.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    min-height: 60px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 960px;
}

.header nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.logo-item {
    position: relative;
}

body>main {
    margin: auto;
    margin-top: 80px;
    max-width: 850px;
    padding: 0 1rem;
    transition: margin-top 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Adjust main content margin when header is scrolled */
.header.scrolled ~ main {
    margin-top: 60px;
}

/* Fallback for browsers that support :has() */
body:has(.header.scrolled) main {
    margin-top: 60px;
}

h1 {
    background-color: var(--primaryColor);
    color: white;
    margin: 0;
    text-align: center;
    padding: 10px 0 5px 0;
    font-size: 20px;
    font-weight: normal;
}

ul {
    display: none;
    padding: 0;
}

a.logo-link {
    position: absolute;
    top: -20px;
    transition: top 300ms ease-in-out;
    will-change: top;
}

.logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--highlight);
    transition: transform 300ms ease-in-out,
                border-color 300ms ease-in-out,
                box-shadow 300ms ease-in-out;
    cursor: pointer;
    padding: 0;
    will-change: transform;
    transform-origin: center center;
}

/* Shrunk state for logo */
.logo.shrunk {
    transform: scale(0.6);
}

.logo:hover {
    transform: scale(1.15) rotate(5deg);
    border-color: #ffffff;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.logo.shrunk:hover {
    transform: scale(0.69) rotate(5deg); /* 0.6 * 1.15 = 0.69 */
    border-color: #ffffff;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.logo:active {
    transform: scale(1.05) rotate(2deg);
    transition: all 0.1s ease;
}

.logo.shrunk:active {
    transform: scale(0.63) rotate(2deg); /* 0.6 * 1.05 = 0.63 */
    transition: all 0.1s ease;
}

/* Scroll-based logo scaling is now handled by JavaScript */

a.nav-link {
    color: var(--highlight);
    padding: 0.75rem 1rem;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-weight: 500;
}

a.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

#linkHome {
    display: block;
    position: absolute;
    top: 5px;
    left: 5px;
}

#linkOrder {
    display: block;
    position: absolute;
    top: 5px;
    right: 5px;
}

section.page {
    display: none;
}

#badge {
    padding: 4px;
    background-color: red;
    border-radius: 15px;
    width: 10px;
    text-align: center;
    font-size: x-small;
    color: white;
    position: absolute;
    right: 5px;
    top: 6px;
}

.footer {
    text-align: center;
    padding: 1rem;
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: 2px solid var(--highlight);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin-left: 0.25rem;
    flex-shrink: 0;
}

.theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: white;
    transform: scale(1.05);
}

.theme-icon {
    width: 18px;
    height: 18px;
    transition: all 0.3s ease;
    fill: currentColor;
}

.sun-icon {
    display: none;
}

.moon-icon {
    display: block;
}

.theme-toggle:hover .theme-icon {
    transform: rotate(180deg);
}

/* Show sun icon when dark theme is active */
body:has(#dark-theme-style) .sun-icon {
    display: block;
}

body:has(#dark-theme-style) .moon-icon {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        padding: 0 0.75rem;
        min-height: 70px;
    }
    
    .header.scrolled {
        min-height: 50px;
    }
    
    .header-content {
        max-width: 100%;
    }
    
    .header nav {
        gap: 0.5rem;
    }
    
    a.nav-link {
        padding: 0.5rem 0.6rem;
        font-size: 0.9rem;
    }
    
    .theme-toggle {
        width: 35px;
        height: 35px;
        margin-left: 0.1rem;
    }
    
    .theme-icon {
        width: 16px;
        height: 16px;
    }
    
    .logo {
        width: 70px;
        height: 70px;
    }
    
    a.logo-link {
        position: relative;
        top: 0;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 0.5rem 1rem;
        min-height: 60px;
    }
    
    .header.scrolled {
        min-height: 45px;
    }
    
    .header-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 0.5rem;
    }
    
    .header nav {
        gap: 0.25rem;
    }
    
    a.nav-link {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
    }
    
    .logo {
        width: 60px;
        height: 60px;
    }
    
    a.logo-link {
        position: relative;
        top: 0;
    }
}

/* Offline Page Styles */
.offline-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    padding: 2rem;
}

.offline-content {
    text-align: center;
    color: white;
    max-width: 600px;
    padding: 3rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.offline-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: pulse 2s infinite;
}

.offline-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.offline-message {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    line-height: 1.6;
}

.offline-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.retry-button {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.retry-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.home-link {
    display: inline-block;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    font-weight: 600;
}

.home-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.offline-tips {
    text-align: left;
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 10px;
    margin-top: 1rem;
}

.offline-tips h3 {
    margin-bottom: 1rem;
    text-align: center;
    font-size: 1.3rem;
}

.offline-tips ul {
    list-style: none;
    padding: 0;
}

.offline-tips li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.offline-tips li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #4CAF50;
    font-weight: bold;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}