/* Component Styles */

/* Header */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 2000;
    background: rgba(8, 11, 17, 0.38);
    backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid var(--glass-border);
    transition: var(--transition-base);
}

@media (max-width: 1024px) {
    .main-header {
        background: rgba(8, 11, 17, 0.38);
        border-bottom-color: rgba(255, 255, 255, 0.10);
    }
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    padding: 0 var(--space-4);
    transition: height 0.3s ease;
    width: 100%;
    max-width: 1600px !important;
    /* Allows header to stretch closer to the corners on large screens */
    margin: 0 auto;
}

@media (max-width: 768px) {
    .nav-container {
        height: 64px;
    }
}

.brand {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: visible;
}

@media (max-width: 480px) {
    .brand {
        font-size: 0.85rem;
        max-width: none;
        flex-shrink: 0;
    }
}

.nav-menu {
    display: none !important;
}

.desktop-only {
    display: flex;
}

.mobile-only-actions {
    display: none;
    flex-direction: column;
    gap: var(--space-2);
    width: 100%;
    margin-top: var(--space-4);
}

.nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-dim);
    white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-white);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition-base);
    white-space: nowrap;
}

.btn-primary {
    background: var(--neon-green);
    color: #020617;
    box-shadow: 0 0 20px var(--accent-green-glow), inset 0 0 10px rgba(255, 255, 255, 0.3);
}

.btn-primary:hover {
    background: #10b981;
    transform: translateY(-2px);
    box-shadow: 0 0 35px var(--accent-green-glow), inset 0 0 15px rgba(255, 255, 255, 0.4);
}

.btn-secondary {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border-strong);
    color: var(--text-white);
    backdrop-filter: blur(var(--glass-blur));
    box-shadow: var(--glass-inner-glow);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Glass Cards */
.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(var(--glass-blur));
    border-radius: var(--radius-md);
    padding: var(--space-4);
    transition: var(--transition-base);
    box-shadow:
        0 10px 30px -10px rgba(0, 0, 0, 0.5),
        var(--glass-inner-glow);
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.glass-card:hover {
    border-color: var(--glass-border-strong);
    transform: translateY(-4px);
    background: rgba(15, 23, 42, 0.4);
}

/* Mobile Nav Toggle (Green Glass Theme) */
.mobile-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 8px;
    z-index: 2200;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(16, 185, 129, 0.3);
    box-shadow: 0 4px 15px var(--accent-green-glow);
    cursor: pointer;
    transition: var(--transition-base);
}

.mobile-toggle:hover {
    transform: scale(1.05);
    background: rgba(16, 185, 129, 0.25);
    border-color: rgba(16, 185, 129, 0.5);
    box-shadow: 0 6px 20px var(--accent-green-glow);
}

.mobile-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--neon-green);
    border-radius: 2px;
    transition: var(--transition-base);
}

@media (max-width: 1024px) {
    .desktop-only {
        display: none !important;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        background: rgba(5, 5, 8, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        align-items: flex-start;
        padding: 80px var(--space-4) var(--space-8);
        transition: var(--transition-slow);
        z-index: 2100;
        border-left: 1px solid var(--glass-border);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
        display: flex !important;
        overflow-y: auto;
        overflow-x: hidden;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        /* Force flex but hidden by right -100% until .open */
    }

    .nav-menu.open {
        right: 0;
    }

    .nav-link {
        font-size: 0.95rem;
        padding: 12px 0;
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .mobile-only-actions {
        display: flex;
    }

    .mobile-only-actions .btn {
        padding: 10px 16px;
        font-size: 0.85rem;
    }

    .nav-actions {
        margin-left: auto;
        /* Push the action group (including hamburger) to the far right */
        justify-content: flex-end;
    }

    .mobile-toggle {
        display: flex;
    }

    /* Close Button Style for Overlay */
    .mobile-toggle.open span:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    .mobile-toggle.open span:nth-child(2) {
        opacity: 0;
    }

    .mobile-toggle.open span:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }
}

@media (min-width: 768px) and (max-width: 1024px) and (hover: none) and (pointer: coarse) {
    .nav-menu {
        overflow-x: hidden;
        overflow-y: auto;
        touch-action: pan-y;
        overscroll-behavior: none;
        overscroll-behavior-y: none;
        -webkit-overflow-scrolling: touch;
    }

    body:has(.nav-menu.open) {
        overflow: hidden;
        overscroll-behavior: none;
        touch-action: none;
    }
}

/* Tablet Portrait - Use Mobile Hamburger Menu */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: portrait) {
    .desktop-only {
        display: none !important;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        background: rgba(5, 5, 8, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        align-items: flex-start;
        padding: 80px var(--space-4) var(--space-8);
        transition: var(--transition-slow);
        z-index: 2100;
        border-left: 1px solid var(--glass-border);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    }

    .nav-menu.open {
        right: 0;
    }

    .nav-link {
        font-size: 0.95rem;
        padding: 12px 0;
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .mobile-only-actions {
        display: flex;
    }

    .mobile-only-actions .btn {
        padding: 10px 16px;
        font-size: 0.85rem;
    }

    .nav-actions {
        margin-left: auto;
        justify-content: flex-end;
    }

    .mobile-toggle {
        display: flex;
    }

    .mobile-toggle.open span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .mobile-toggle.open span:nth-child(2) {
        opacity: 0;
    }

    .mobile-toggle.open span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
}

/* Footer */
footer {
    padding: var(--space-8) 0;
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(var(--glass-blur));
    border-top: 1px solid var(--glass-border);
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 1px;
    background: radial-gradient(circle, var(--accent-green-glow) 0%, transparent 70%);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-6);
}

.footer-brand h2 {
    margin-bottom: var(--space-2);
}

.footer-links h3 {
    font-size: 1rem;
    margin-bottom: var(--space-3);
}

.footer-links ul li {
    margin-bottom: var(--space-2);
}

.copyright {
    margin-top: var(--space-8);
    padding-top: var(--space-4);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* Checkout Page Layout */
.checkout-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: var(--space-6);
    margin-top: var(--space-4);
    align-items: start;
}

.checkout-inputs {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.checkout-row {
    display: flex;
    gap: var(--space-3);
}

.checkout-row>* {
    flex: 1;
    min-width: 0;
}

@media (max-width: 768px) {
    .checkout-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .checkout-row {
        flex-direction: column;
        gap: var(--space-3);
    }

    .checkout-container {
        padding-top: 100px !important;
    }
}

/* Floating Right Side Panel Toggle (Deprecated - Replaced by Top Right Hamburger) */
.floating-side-btn {
    display: none !important;
}

.side-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 30000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.side-panel-overlay.active {
    opacity: 1;
    visibility: visible;
}

.floating-side-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    max-width: 85vw;
    height: 100vh;
    background: rgba(10, 12, 18, 0.6);
    backdrop-filter: blur(25px);
    overflow: hidden;
    overscroll-behavior: none;
    -webkit-backdrop-filter: blur(25px);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    z-index: 30001;
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    padding: var(--space-8) var(--space-4) var(--space-4);
}

.floating-side-panel.open {
    right: 0;
}

.side-panel-close {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    background: none;
    border: none;
    color: var(--text-white);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

.side-panel-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-top: var(--space-4);
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    padding-bottom: 20px;
    overscroll-behavior: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

html.side-panel-open,
body.side-panel-open {
    overflow: hidden !important;
    overscroll-behavior: none;
    overscroll-behavior-y: none;
    touch-action: none;
    height: 100%;
}

body.side-panel-open .floating-side-panel,
body.side-panel-open .side-panel-content {
    touch-action: pan-y;
}

.side-panel-content::-webkit-scrollbar {
    width: 4px;
}

.side-panel-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.side-panel-link {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-white);
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: none;
    transition: all 0.2s ease;
}

.side-panel-link:hover,
.side-panel-link.active {
    background: rgba(255, 255, 255, 0.08);
    color: var(--neon-green);
    transform: translateX(4px);
}

/* --- Shared Modals & Toasts (from generator.html) --- */

.tg-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;
}

.tg-modal {
    background: #0a0a0a;
    border: 1px solid var(--neon-green);
    padding: 40px;
    border-radius: 24px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 0 50px rgba(34, 197, 94, 0.3);
    animation: modalAppear 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.tg-modal h2 {
    font-family: 'Unbounded', sans-serif;
    font-size: 1.5rem;
    margin-bottom: 16px;
    background: linear-gradient(to right, #fff, var(--neon-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tg-modal p {
    color: var(--text-dim);
    margin-bottom: 32px;
    line-height: 1.6;
}

.tg-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tg-modal-actions .btn {
    padding: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.google-btn {
    background: #fff !important;
    color: #000 !important;
    border: none !important;
}

.google-btn:hover {
    background: #f0f0f0 !important;
    transform: translateY(-2px);
}

.tg-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 12px 20px;
    border-radius: 30px;
    font-size: 14px;
    z-index: 9999;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: none;
}

/* Phone portrait global nav alignment */

/* Toast Notification (Global Shared) */
.qe-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 9999;
    white-space: nowrap;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(4px);
}

.qe-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.tg-cookie-banner {
    position: fixed;
    right: 16px;
    bottom: 16px;
    width: min(460px, calc(100vw - 24px));
    z-index: 200450;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    background: rgba(4, 10, 20, 0.92);
    backdrop-filter: blur(12px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.tg-cookie-banner__body {
    padding: 12px;
}

.tg-cookie-banner__text {
    margin: 0 0 10px;
    color: var(--text-dim);
    font-size: 0.82rem;
    line-height: 1.45;
}

.tg-cookie-banner__text a {
    color: var(--neon-green);
    text-decoration: underline;
}

.tg-cookie-banner__actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.tg-cookie-btn {
    height: 32px;
    padding: 0 10px;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 8px;
}

.tg-cookie-prefs-overlay {
    position: fixed;
    inset: 0;
    z-index: 200470;
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.tg-cookie-prefs {
    width: min(540px, 100%);
    max-height: calc(100vh - 32px);
    overflow: auto;
    border: 1px solid var(--glass-border-strong);
    border-radius: 16px;
    background: rgba(4, 10, 20, 0.96);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    padding: 18px;
}

.tg-cookie-prefs h2 {
    margin: 0 0 14px;
    font-size: 1rem;
}

.tg-cookie-pref-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.tg-cookie-pref-row strong {
    display: block;
    margin-bottom: 4px;
}

.tg-cookie-pref-row p {
    margin: 0;
    color: var(--text-dim);
    font-size: 0.82rem;
}

.tg-cookie-switch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    white-space: nowrap;
}

.tg-cookie-prefs__actions {
    margin-top: 14px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.is-hidden {
    display: none !important;
}

@media (max-width: 480px),
(max-width: 480px) and (orientation: portrait) {

    /* Push nav items to the absolute edges of the screen */
    .nav-container.container {
        padding-left: 4px !important;
        padding-right: 4px !important;
    }

    /* Move Account Icon slightly away from Hamburger Menu */
    .nav-actions {
        gap: 8px !important;
    }
}
