/* Reset and Base Styles */
:root {
    --primary: #000000;
    --secondary: #2A7D8E;
    --text: #333333;
    --light-text: #666666;
    --background: #FFFFFF;
    --border: #E5E5E5;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
    line-height: 1.5;
    color: var(--text);
}

/* Heading Fonts - Montserrat */
h1,
h2,
h3,
h4,
h5,
h6,
.hero h1,
.section-header h2,
.filters-header h2,
.list-info h1,
.header-info h1,
.shoe-title,
.brand-name,
.page-title,
.auth-header h1,
.mission-title,
.footer-column h4 {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 600;
    /* SemiBold */
    letter-spacing: -0.01em;
}

/* Make h1 and h2 elements uppercase */
h1,
h2,
.hero h1,
.section-header h2,
.filters-header h2,
.list-info h1,
.header-info h1,
.page-title,
.auth-header h1 {
    text-transform: uppercase;
}

/* Use Bold weight for primary brand elements and main headings */
.logo,
.brand-logo,
.site-title,
.hero h1,
h1.main-title,
.page-header h1 {
    font-weight: 700;
    /* Bold */
    letter-spacing: -0.015em;
}

/* Navigation Styles */
.top-nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--background);
    border-bottom: 1px solid var(--border);
}

.nav-left {
    justify-self: start;
}

.nav-center {
    justify-self: center;
}

.nav-right {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.browse-button {
    display: none;
    background: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
    margin-left: 1rem;
}

.browse-button:hover {
    background: #333333;
    transform: translateY(-1px);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    transition: transform 0.3s ease;
}

.search-toggle {
    display: none;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--text);
}

/* Mobile Search Overlay */
.mobile-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.98);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

.mobile-search-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.mobile-search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
    margin-right: 0.5rem;
}

.mobile-search-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text);
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-search-results {
    flex: 1;
    overflow-y: auto;
}

.logo {
    font-size: 1.75rem;
    font-weight: 700;
    /* Use Bold weight for logo */
    text-decoration: none;
    color: var(--primary);
    letter-spacing: 0.02em;
    /* Adjust for regular Montserrat */
}

/* Logo image sizing */
.logo-img {
    height: 48px;
    width: auto;
    display: block;
}

.search-container {
    position: relative;
}

.search-container input {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    width: 200px;
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
}

.search-container input:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 2px rgba(42, 125, 142, 0.1);
}

/* Search Results Dropdown */
.search-results-container {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    width: 320px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    z-index: 100;
    max-height: 420px;
    overflow-y: auto;
    padding: 0.5rem;
}

.search-dropdown {
    display: flex;
    flex-direction: column;
}

.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}

.search-results-header span {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--light-text);
}

.view-all-results {
    font-size: 0.75rem;
    color: var(--secondary);
    text-decoration: none;
}

.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    text-decoration: none;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.search-result-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.10);
    background-color: #fff;
}

.search-result-image {
    width: 56px;
    height: 56px;
    border-radius: 6px;
    overflow: hidden;
    background: #f5f5f5;
    margin-right: 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    contain: layout style paint;
    /* Chrome optimization */
}

.search-result-image img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s linear 0.2s, opacity 0.2s ease;
    will-change: opacity, visibility;
    /* Chrome optimization */
    content-visibility: auto;
    /* Modern Chrome optimization */
}

.search-result-image img.loaded {
    visibility: visible;
    opacity: 1;
    transition: visibility 0s linear 0s, opacity 0.2s ease;
}

/* General SVG placeholder styling */
img[src$=".svg"][src*="placeholder"] {
    border-radius: 6px;
}

.search-image-placeholder {
    width: 100%;
    height: 100%;
    background: #f0f0f0;
}

.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-brand {
    font-size: 0.75rem;
    color: var(--light-text);
    margin-bottom: 0.25rem;
}

.search-result-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-price {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
}

.search-results-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

.see-more {
    font-size: 0.875rem;
    color: var(--secondary);
    text-decoration: none;
}

.no-search-results {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--light-text);
    font-size: 0.9rem;
}

.search-loading {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid rgba(42, 125, 142, 0.2);
    border-top-color: var(--secondary);
    border-radius: 50%;
    display: none;
}

.search-loading.htmx-request {
    display: block;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

[x-cloak] {
    display: none !important;
}

@media (max-width: 1024px) {
    .search-container {
        display: none;
    }
}

.sign-in {
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
}

/* User Menu */
.user-menu {
    position: relative;
}

.user-button {
    background: none;
    border: none;
    color: var(--text);
    font-weight: 500;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
}

.user-button:hover {
    color: var(--secondary);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    min-width: 150px;
    z-index: 1000;
    margin-top: 0.5rem;
}

.user-dropdown a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text);
    text-decoration: none;
    font-size: 0.875rem;
}

.user-dropdown a:hover {
    background: #f8f9fa;
    color: var(--secondary);
}

/* Desktop Category Navigation */
.category-nav.desktop-nav {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1rem;
    background: var(--background);
    border-bottom: 1px solid var(--border);
}

.category-link {
    text-decoration: none;
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    transition: color 0.2s;
}

.category-link:hover {
    color: var(--secondary);
}

/* Mobile Category Navigation */
.category-nav.mobile-nav {
    display: none;
    padding: 1rem 0;
    background: var(--background);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}

.scroll-container {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding: 0 1rem 0.25rem 1rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
    padding-bottom: 0.5rem;
}

.scroll-container::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
}

.category-chip {
    display: inline-block;
    padding: 0.75rem 1.25rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 50px;
    text-decoration: none;
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s ease;
    flex: 0 0 auto;
}

.category-chip:hover {
    background: var(--secondary);
    color: white;
    border-color: var(--secondary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(42, 125, 142, 0.15);
}

.category-chip:active {
    transform: translateY(0);
}


/* Main Content Area */
main {
    min-height: calc(100vh - 200px);
}

/* Responsive Design */
@media (min-width: 1025px) {
    .browse-button {
        display: inline-block;
    }
}

@media (max-width: 1024px) {
    .category-nav.desktop-nav {
        display: none;
    }

    .category-nav.mobile-nav {
        display: block;
    }

    .menu-toggle,
    .search-toggle {
        display: flex;
    }

    .browse-button,
    .search-container {
        display: none;
    }

    .top-nav {
        padding: 1rem;
    }

    .logo {
        font-size: 1.5rem;
    }

    .logo-img {
        height: 40px;
    }
}

@media (max-width: 480px) {
    .top-nav {
        padding: 0.75rem;
    }

    .nav-right {
        gap: 1rem;
    }

    .logo {
        font-size: 1.25rem;
    }

    .logo-img {
        height: 36px;
    }

    .sign-in {
        font-size: 0.75rem;
    }
}

/* Footer Styling */
footer {
    background: linear-gradient(135deg, var(--primary) 0%, #1a1a1a 100%);
    color: white;
    margin-top: 6rem;
}

/* Mission band above footer */
.mission-section {
    margin: 4rem 0 2rem;
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
}

.mission-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.mission-title {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
    color: var(--primary);
}

.mission-text {
    color: var(--light-text);
    line-height: 1.7;
    font-size: 0.98rem;
    max-width: 900px;
}

.mission-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

.mission-btn {
    display: inline-block;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.2s ease, color 0.2s ease;
}

.mission-btn-primary {
    background: var(--secondary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(42, 125, 142, 0.18);
}

.mission-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(42, 125, 142, 0.22);
}

.mission-btn-secondary {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--border);
}

.mission-btn-secondary:hover {
    background: #f8f9fa;
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .mission-container {
        padding: 1.25rem;
    }

    .mission-title {
        font-size: 1.1rem;
    }

    .mission-text {
        font-size: 0.95rem;
    }
}

.footer-main {
    padding: 4rem 0 2rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    align-items: start;
}

.footer-brand h3 {
    font-size: 1.5rem;
    font-weight: 700;
    /* Use Bold weight for footer brand */
    letter-spacing: 0.1px;
    /* Adjust for regular Montserrat */
    margin-bottom: 1rem;
    color: white;
}

.footer-brand p {
    color: #bdc3c7;
    line-height: 1.6;
    font-size: 0.95rem;
    max-width: 300px;
}

.footer-links-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.footer-column h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-column li {
    margin-bottom: 0.75rem;
}

.footer-column a {
    color: #ecf0f1;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    position: relative;
}

.footer-column a:hover {
    color: var(--secondary);
    padding-left: 0.5rem;
}

.footer-column a.coming-soon {
    color: #95a5a6;
    cursor: not-allowed;
}

.footer-column a.coming-soon:hover {
    color: #95a5a6;
    padding-left: 0;
}

.footer-bottom {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 1.5rem 0;
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-bottom p {
    margin: 0;
    color: #bdc3c7;
    font-size: 0.9rem;
}

.footer-social span {
    color: #95a5a6;
    font-size: 0.85rem;
    font-style: italic;
}

/* Responsive Footer */
@media (max-width: 1024px) {
    .footer-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .footer-links-section {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-brand p {
        max-width: none;
    }
}

@media (max-width: 768px) {
    .footer-main {
        padding: 3rem 0 1.5rem 0;
    }

    .footer-container {
        padding: 0 1rem;
        gap: 2rem;
    }

    .footer-links-section {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: left;
    }

    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .footer-main {
        padding: 2rem 0 1rem 0;
    }

    .footer-container {
        padding: 0 1rem;
    }

    .footer-brand h3 {
        font-size: 1.25rem;
    }

    .footer-column h4 {
        font-size: 0.9rem;
    }
}

/* Cookie Banner Styling */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--primary) 0%, #1a1a1a 100%);
    color: white;
    z-index: 10000;
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
}

.cookie-banner.cookie-banner-visible {
    transform: translateY(0);
}

.cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.cookie-banner-text h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
}

.cookie-banner-text p {
    margin: 0;
    color: #bdc3c7;
    font-size: 0.9rem;
    line-height: 1.4;
    max-width: 600px;
}

.cookie-banner-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

.cookie-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.cookie-btn-primary {
    background-color: var(--secondary);
    color: white;
}

.cookie-btn-primary:hover {
    background-color: #238a9b;
    transform: translateY(-1px);
}

.cookie-btn-secondary {
    background-color: transparent;
    color: #ecf0f1;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.cookie-btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Cookie Settings Panel */
.cookie-settings {
    background-color: rgba(0, 0, 0, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cookie-settings-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.cookie-settings h4 {
    margin: 0 0 1.5rem 0;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
}

.cookie-category {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cookie-category-header {
    margin-bottom: 0.5rem;
}

.cookie-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 0.75rem;
}

.cookie-toggle input[type="checkbox"] {
    display: none;
}

.cookie-toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background-color: #495057;
    border-radius: 12px;
    transition: background-color 0.3s ease;
}

.cookie-toggle-switch::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.cookie-toggle input[type="checkbox"]:checked+.cookie-toggle-switch {
    background-color: var(--secondary);
}

.cookie-toggle input[type="checkbox"]:checked+.cookie-toggle-switch::before {
    transform: translateX(20px);
}

.cookie-toggle input[type="checkbox"]:disabled+.cookie-toggle-switch {
    background-color: var(--secondary);
    opacity: 0.7;
    cursor: not-allowed;
}

.cookie-toggle-label {
    font-weight: 500;
    color: white;
    font-size: 0.95rem;
}

.cookie-category-desc {
    color: #bdc3c7;
    font-size: 0.85rem;
    line-height: 1.4;
    margin: 0;
    padding-left: 3.5rem;
}

.cookie-settings-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cookie-policy-link {
    color: var(--secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.cookie-policy-link:hover {
    color: #238a9b;
    text-decoration: underline;
}

/* Responsive Cookie Banner */
@media (max-width: 768px) {
    .cookie-banner-content {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 1.5rem;
        padding: 1.5rem 1rem;
    }

    .cookie-banner-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .cookie-btn {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }

    .cookie-settings-content {
        padding: 1.5rem 1rem;
    }

    .cookie-settings-actions {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .cookie-category-desc {
        padding-left: 0;
        margin-top: 0.5rem;
    }
}

@media (max-width: 480px) {
    .cookie-banner-text h3 {
        font-size: 1rem;
    }

    .cookie-banner-text p {
        font-size: 0.85rem;
    }

    .cookie-btn {
        padding: 0.65rem 0.85rem;
        font-size: 0.8rem;
    }
}