:root {
    --bg-color: #131111;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --gold: #d4af37;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --font-main: "Myriad Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.4;
    padding-bottom: 40px;
    position: relative;
    overflow-x: hidden;
    overscroll-behavior-y: none; /* Disable native browser pull-to-refresh */
}

body::before,
body::after {
    content: "";
    position: fixed;
    width: 250px;
    height: 250px;
    background-image: url('assets/Background Icon.png');
    background-size: contain;
    background-repeat: no-repeat;
    z-index: -1;
    pointer-events: none;
}

body::before {
    top: 5%;
    left: -50px;
    transform: rotate(-15deg);
}

body::after {
    bottom: 10%;
    right: -50px;
    transform: rotate(15deg);
}

@media (max-width: 480px) {

    body::before,
    body::after {
        width: 150px;
        height: 150px;
    }

    .header {
        padding: 20px 10px;
    }

    .main-logo {
        max-width: 160px;
    }

    .dietary-key {
        gap: 15px;
        margin: 15px 0 25px;
    }

    .mini-icon {
        width: 28px;
        height: 28px;
    }

    .range-heading {
        font-size: 1.2rem;
        padding: 0 10px;
    }

    .info-link-container {
        margin: 5px 0 25px;
    }
}

.header {
    text-align: center;
    padding: 40px 20px 20px;
}

.logo-container {
    margin-bottom: 30px;
}

.main-logo {
    max-width: 200px;
    height: auto;
}

.dietary-key {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    margin: 20px 0 30px;
}

.dietary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.mini-icon {
    width: 32px;
    /* Increased from 24px */
    height: 32px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.abbr {
    font-size: 0.75rem;
    color: var(--gold);
    font-weight: 600;
    letter-spacing: 1px;
}

.filter-container {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.info-link-container {
    margin: 10px 0 30px;
    display: flex;
    justify-content: center;
}

.allergy-link {
    background: transparent;
    color: var(--gold);
    border: none;
    text-decoration: underline;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: var(--font-main);
    opacity: 0.8;
    transition: opacity 0.3s;
}

.allergy-link:hover {
    opacity: 1;
}

.range-heading-container {
    margin: 40px 0 20px;
    text-align: center;
}

.range-heading {
    font-size: 1.4rem;
    color: var(--text-primary);
    font-weight: 300;
    letter-spacing: 2px;
}

.custom-dropdown {
    position: relative;
    width: 220px;
    z-index: 1000;
}

.dropdown-selected {
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 12px 25px;
    border-radius: 30px;
    font-size: 0.95rem;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    background: transparent;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.dropdown-selected::after {
    content: "";
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23d4af37' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    transition: transform 0.3s ease;
}

.custom-dropdown.active .dropdown-selected::after {
    transform: translateY(-50%) rotate(180deg);
}

.dropdown-selected:hover {
    background: rgba(212, 175, 55, 0.05);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.15);
}

.dropdown-list {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 100%;
    background: #1a1a1a;
    border: 1px solid var(--card-border);
    border-radius: 20px;
    list-style: none;
    padding: 10px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.custom-dropdown.active .dropdown-list {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-list li {
    padding: 12px 20px;
    font-size: 0.9rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.dropdown-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.dropdown-list li:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--gold);
}

.menu-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 15px;
}

.flavor-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.flavor-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    cursor: pointer;
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.macaron-visual {
    width: 100%;
    aspect-ratio: 1;
    position: relative;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.macaron-img {
    width: 90%;
    height: 90%;
    object-fit: contain;
}

.flavor-meta {
    width: 100%;
}

.flavor-icons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}

.flavor-icons .mini-icon {
    height: 32px;
    /* Increased height */
    width: auto;
    /* Flexible width for non-square icons */
    max-width: 80px;
    object-fit: contain;
}

.flavor-icons .abbr {
    font-size: 0.9rem;
    /* Slightly larger text to match */
    font-weight: 600;
    color: var(--gold);
}

.flavor-name {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-primary);
    text-transform: capitalize;
}

.sold-out .macaron-img,
.sold-out .flavor-meta {
    opacity: 0.2;
}

.sold-out-stamp {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    object-fit: contain;
    z-index: 2;
    pointer-events: none;
    display: none;
}

.sold-out .sold-out-stamp {
    display: block;
}

.footer {
    text-align: center;
    padding: 40px 20px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.3);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #1a1a1a;
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 30px;
    max-width: 90%;
    width: 400px;
    position: relative;
    text-align: center;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-visual {
    width: 240px;
    height: 240px;
    margin: 0 auto 30px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-macaron-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 2.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
}

.modal-flavor-name {
    color: var(--gold);
    font-size: 1.8rem;
    margin-bottom: 10px;
    text-transform: capitalize;
}

.modal-icons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
    align-items: center;
}

.modal-icons img {
    height: 40px;
    /* Increased height for even better visibility in modal */
    width: auto;
    max-width: 100px;
    object-fit: contain;
}

.modal-icons .abbr {
    font-size: 0.9rem;
    color: var(--gold);
    border: 1px solid var(--gold);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-description {
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.6;
}

@media (max-width: 480px) {
    .dietary-key {
        gap: 20px;
    }
}

@media (max-width: 320px) {
    .flavor-grid {
        gap: 10px;
    }

    .flavor-name {
        font-size: 0.9rem;
    }
}

.allergy-modal {
    width: 500px;
    max-width: 95%;
}

.allergy-content {
    text-align: center;
    margin-top: 20px;
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.modal-dietary-key {
    margin: 25px 0;
    justify-content: center;
    gap: 15px;
}

.allergy-content p {
    margin-bottom: 15px;
}

.allergen-list {
    color: var(--gold);
    font-weight: 600;
    letter-spacing: 0.5px;
    display: block;
    margin-top: 10px;
}

.site-footer {
    padding: 60px 0 0;
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    width: 100%;
    margin: 0 auto;
}

.footer-img {
    height: auto;
    object-fit: contain;
}

.ig-plug {
    max-width: 280px;
}

.qr-code {
    width: 100%;
    max-width: 100%;
    border-radius: 0;
}

.footer-divider {
    width: 60px;
    height: 2px;
    background: var(--gold);
    opacity: 0.3;
}

@media (max-width: 480px) {
    .ig-plug {
        max-width: 220px;
    }
    
    .site-footer {
        padding: 40px 0 0;
    }
}

/* Pull to Refresh */
.refresh-indicator {
    position: fixed;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 60px;
    background: rgba(26, 26, 26, 0.95);
    border: 1px solid var(--card-border);
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    transition: transform 0.1s ease-out, opacity 0.2s;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    padding: 10px;
}

.macaron-loader {
    width: 80px;
    height: auto;
}

.macaron-svg {
    transform-origin: center;
}

/* Animations from test.html */
.refreshing .macaron-svg {
    animation: bounce 1.2s infinite ease-in-out;
}

.refreshing #p-1 { animation-delay: 0s; }
.refreshing #p-2 { animation-delay: 0.2s; }
.refreshing #p-3 { animation-delay: 0.4s; }

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Ready state - subtle jump */
.ready .macaron-svg {
    transform: translateY(-5px);
    transition: transform 0.2s;
}