:root {
    --h2m-blue: #0099FF;
    --h2m-blue-dark: #0086E6;
    --h2m-dark: #1a1a2e;
    --h2m-gray-900: #111827;
    --h2m-gray-700: #374151;
    --h2m-gray-500: #6b7280;
    --h2m-gray-400: #9ca3af;
    --h2m-gray-200: #e5e7eb;
    --h2m-white: #ffffff;
}

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

body {
    font-family: 'Mulish', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #1e293b;
    background: #ffffff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.h2m-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

.h2m-top-bar {
    background: var(--h2m-blue);
    height: 30px;
    display: flex;
    align-items: center;
}

.h2m-top-bar .h2m-container {
    display: flex;
    justify-content: flex-end;
    width: 100%;
}

.h2m-top-links {
    display: flex;
    gap: 20px;
}

.h2m-top-links a {
    color: var(--h2m-white);
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.h2m-top-links a:hover {
    opacity: 1;
}

.h2m-header {
    background: var(--h2m-white);
    border-bottom: 1px solid var(--h2m-gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
}

.h2m-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.h2m-logo img {
    display: block;
}

.h2m-nav {
    display: flex;
    gap: 32px;
}

.h2m-nav a {
    color: var(--h2m-gray-700);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

.h2m-nav a:hover,
.h2m-nav a.active {
    color: var(--h2m-blue);
}

.h2m-header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.h2m-cart-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    color: var(--h2m-gray-500);
    transition: background 0.2s, color 0.2s;
}

.h2m-cart-icon:hover {
    background: #f1f5f9;
    color: var(--h2m-blue);
}

.h2m-cart-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--h2m-blue);
    color: var(--h2m-white);
    font-size: 11px;
    font-weight: 600;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.h2m-login-btn {
    background-color: var(--h2m-blue);
    color: var(--h2m-white);
    border: none;
    outline: none;
    box-shadow: none;
    border-radius: 6px;
    padding: 10px 16px;
    font-weight: 400;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.2s;
}

.h2m-login-btn:hover {
    background-color: var(--h2m-blue-dark);
}

.h2m-login-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 153, 255, 0.35);
}

.h2m-login-btn:focus:not(:focus-visible) {
    outline: none;
    box-shadow: none;
}

.h2m-wallet {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #166534;
}

.h2m-user-dropdown {
    position: relative;
}

.h2m-user-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid var(--h2m-gray-200);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--h2m-gray-700);
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.h2m-user-trigger:hover {
    border-color: var(--h2m-blue);
    color: var(--h2m-blue);
}

.h2m-user-trigger .caret {
    transition: transform 0.2s;
}

.h2m-user-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 200px;
    background: var(--h2m-white);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    border: 1px solid var(--h2m-gray-200);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
    overflow: hidden;
}

.h2m-user-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.h2m-user-menu a {
    display: block;
    padding: 10px 16px;
    font-size: 14px;
    color: var(--h2m-gray-700);
    text-decoration: none;
    transition: background 0.15s;
}

.h2m-user-menu a:hover {
    background: #f8fafc;
    color: var(--h2m-blue);
}

.h2m-user-menu .menu-divider {
    height: 1px;
    background: var(--h2m-gray-200);
    margin: 4px 0;
}

.h2m-user-menu .logout-link {
    color: #dc2626;
}

.h2m-user-menu .logout-link:hover {
    background: #fef2f2;
}

.h2m-auth-dropdown-wrapper {
    position: relative;
}

.h2m-auth-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    background: var(--h2m-white);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    border: 1px solid var(--h2m-gray-200);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}

.h2m-auth-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.h2m-auth-dropdown-header {
    padding: 20px 20px 0;
}

.h2m-auth-dropdown-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 4px;
}

.h2m-auth-dropdown-header p {
    font-size: 13px;
    color: var(--h2m-gray-500);
    margin: 0;
}

.h2m-auth-dropdown-body {
    padding: 20px;
}

.h2m-auth-dropdown .form-group {
    margin-bottom: 16px;
}

.h2m-auth-dropdown .form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--h2m-gray-700);
    margin-bottom: 6px;
}

.h2m-auth-dropdown .form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}

.h2m-auth-dropdown .form-group input:focus {
    outline: none;
    border-color: var(--h2m-blue);
    box-shadow: 0 0 0 3px rgba(0, 153, 255, 0.1);
}

.h2m-auth-dropdown .btn-submit {
    width: 100%;
    padding: 12px 16px;
    background: var(--h2m-blue);
    color: var(--h2m-white);
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.h2m-auth-dropdown .btn-submit:hover {
    background: var(--h2m-blue-dark);
}

.h2m-auth-dropdown .btn-submit:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

.h2m-auth-dropdown .btn-submit .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.h2m-auth-dropdown .dropdown-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 16px;
    display: none;
}

.h2m-auth-dropdown .dropdown-error.show {
    display: block;
}

.h2m-auth-dropdown-footer {
    padding: 16px 20px;
    background: #f8fafc;
    border-top: 1px solid var(--h2m-gray-200);
    border-radius: 0 0 12px 12px;
}

.h2m-auth-dropdown-footer a {
    font-size: 13px;
    color: var(--h2m-blue);
    text-decoration: none;
}

.h2m-auth-dropdown-footer a:hover {
    text-decoration: underline;
}

.h2m-auth-dropdown-footer .signup-link {
    display: block;
    text-align: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--h2m-gray-200);
}

.h2m-mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.h2m-mobile-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--h2m-gray-700);
    border-radius: 1px;
    transition: all 0.3s;
}

.h2m-mobile-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.h2m-mobile-toggle.active span:nth-child(2) {
    opacity: 0;
}

.h2m-mobile-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.h2m-mobile-nav {
    display: none;
    background: var(--h2m-white);
    border-bottom: 1px solid var(--h2m-gray-200);
    padding: 16px 24px;
}

.h2m-mobile-nav.open {
    display: block;
}

.h2m-mobile-nav a {
    display: block;
    padding: 12px 0;
    color: var(--h2m-gray-700);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    border-bottom: 1px solid var(--h2m-gray-200);
}

.h2m-mobile-nav a:last-child {
    border-bottom: none;
}

.h2m-mobile-nav a:hover {
    color: var(--h2m-blue);
}

.h2m-footer {
    background: var(--h2m-gray-900);
    color: var(--h2m-gray-400);
    padding: 60px 0 0;
    margin-top: auto;
}

.h2m-footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
}

.h2m-footer-brand img {
    margin-bottom: 20px;
}

.h2m-footer-brand p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--h2m-gray-400);
    max-width: 280px;
}

.h2m-footer-col h4 {
    color: var(--h2m-white);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
}

.h2m-footer-col a {
    display: block;
    color: var(--h2m-gray-400);
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 12px;
    transition: color 0.2s;
}

.h2m-footer-col a:hover {
    color: var(--h2m-white);
}

.h2m-footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0;
    margin-top: 48px;
    border-top: 1px solid #374151;
    font-size: 13px;
}

@media (max-width: 1024px) {
    .h2m-footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }
    
    .h2m-footer-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .h2m-top-bar {
        display: none;
    }
    
    .h2m-nav {
        display: none;
    }
    
    .h2m-mobile-toggle {
        display: flex;
    }
    
    .h2m-header-actions {
        gap: 12px;
    }
    
    .h2m-header-actions .h2m-wallet,
    .h2m-header-actions .h2m-user-dropdown {
        display: none;
    }
    
    .h2m-auth-dropdown {
        position: fixed;
        top: 80px;
        left: 50%;
        transform: translateX(-50%);
        width: 90%;
        max-width: 360px;
        right: auto;
    }
    
    .h2m-auth-dropdown.open {
        transform: translateX(-50%);
    }
    
    .h2m-footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
        text-align: center;
    }
    
    .h2m-footer-brand {
        text-align: center;
    }
    
    .h2m-footer-brand p {
        max-width: 100%;
    }
    
    .h2m-footer-bottom {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}

main {
    flex: 1;
}
