:root {
    --primary: #7e4712;
    --primary-hover: #855738;
    --bg-main: #F7F6F4;
    --bg-hero: #F7F6F4;
    --text-main: #2A2A2A;
    --text-secondary: #6B6B6B;
    --border-card: #E5E5E5;
    --border-hover: #D6D3D1;
    --success: #22C55E;
    --error: #EF4444;
    --card-bg: #FFFFFF;
    --input-bg: #f9fafb;
    --surface-hover: #F1EFEC;
    --shadow-card: 0 2px 4px rgba(0,0,0,0.02);
    color-scheme: light;
}

html[data-theme="dark"] {
    --primary: #D69A5E;
    --primary-hover: #E3AD78;
    --bg-main: #171412;
    --bg-hero: #171412;
    --text-main: #F4EFE9;
    --text-secondary: #B8ADA4;
    --border-card: #3A332D;
    --border-hover: #51483F;
    --success: #3DDC84;
    --error: #FF6B6B;
    --card-bg: #211D19;
    --input-bg: #2A241F;
    --surface-hover: #302922;
    --shadow-card: 0 2px 8px rgba(0,0,0,0.28);
    color-scheme: dark;
}

*, *::before, *::after {
    box-sizing: border-box;
}

a,
button,
input,
textarea,
select,
.menu-item {
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    min-height: 100%;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-size: 15px;
    line-height: 1.5;
    min-height: 100vh;
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}

.layout-content {
    flex: 1 0 auto;
    min-width: 0;
}

button,
input,
textarea,
select,
option,
label {
    font-family: inherit;
}

h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1.25rem;
}

h2, h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.product-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-main);
}

.price {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
}

.text-secondary {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-secondary);
    opacity: 0.9;
}

.btn-primary, .btn-order {
    background-color: var(--primary) !important;
    border: none !important;
    color: #FFFFFF !important;
    font-size: 15px;
    font-weight: 500;
    padding: 12px 24px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
    width: 100%;
}

.btn-primary:hover, .btn-order:active {
    background-color: var(--primary-hover) !important;
}

.btn-primary:disabled,
.btn-primary.is-disabled {
    cursor: not-allowed;
    opacity: 0.62;
}

.card-custom {
    background-color: var(--card-bg);
    border: 1px solid var(--border-card);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: var(--shadow-card);
}

.breadcrumbs {
    align-items: center;
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    font-size: 0.84rem;
    gap: 6px;
    line-height: 1.35;
    margin: 0 0 14px;
}

.breadcrumbs a,
.breadcrumbs span {
    min-width: 0;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.breadcrumbs a {
    color: var(--text-secondary);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--primary);
}

.breadcrumbs a::after {
    color: var(--border-hover);
    content: "/";
    margin-left: 6px;
}

.form-label {
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 0.5rem;
}

.form-control, .form-select {
    background-color: var(--input-bg);
    border: 1px solid var(--border-card);
    color: var(--text-main);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 15px;
    box-sizing: border-box;
    font-family: inherit;
    line-height: 1.35;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
}

.form-control:hover, .form-select:hover {
    border-color: var(--border-hover);
}

.form-control:focus, .form-select:focus {
    background-color: var(--card-bg);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(126, 71, 18, 0.05);
    outline: none;
}

.form-control::placeholder,
.form-select::placeholder {
    color: var(--text-secondary);
}

.top-header {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-card);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 0 16px;
    max-width: 100%;
    min-height: 48px;
}

.site-brand,
.auth-brand {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    min-width: 0;
    text-decoration: none;
}

.site-brand {
    flex: 0 1 auto;
}

.site-brand-logo,
.auth-brand-logo {
    display: block;
    flex-shrink: 0;
    max-width: 100%;
    object-fit: contain;
    height: 38px;
    width: auto;
}

/* Logo toggling - Absolute visibility control */
.logo-dark {
    display: none !important;
}

.logo-light {
    display: inline-block !important;
}

html[data-theme="dark"] .logo-light {
    display: none !important;
}

html[data-theme="dark"] .logo-dark {
    display: inline-block !important;
}

/* Icon filters for dark theme */
html[data-theme="dark"] .icon-btn img,
html[data-theme="dark"] .desktop-header-nav-link img,
html[data-theme="dark"] .back-btn img,
html[data-theme="dark"] .alert img,
html[data-theme="dark"] .flash-icon,
html[data-theme="dark"] .listing-image-placeholder img,
html[data-theme="dark"] .listing-selector-image img[src*=".svg"],
html[data-theme="dark"] .top-listings-icon,
html[data-theme="dark"] .input-icon,
html[data-theme="dark"] .eyeIcon {
    filter: brightness(0) saturate(100%) invert(95%) sepia(5%) saturate(150%) hue-rotate(330deg);
}

/* Logos should NEVER be filtered/inverted */
.logo-light,
.logo-dark,
.site-brand-logo,
.auth-brand-logo,
.site-footer__logo img {
    filter: none !important;
}

/* Preserve original colors for specific icons if needed */
html[data-theme="dark"] .listing-action-promote svg {
    filter: none;
}

.auth-brand {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-bottom: 24px;
}

.icon-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    text-decoration: none;
}

.count-badge {
    align-items: center;
    background-color: #E6762D;
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 999px;
    display: inline-flex;
    justify-content: center;
    line-height: 1;
    padding: 0 4px;
    flex-shrink: 0;
    white-space: nowrap;
}

.count-badge[hidden],
.count-badge.is-hidden {
    display: none !important;
}

.review-stars {
    align-items: center;
    color: var(--primary);
    display: inline-flex;
    font-size: 0.92rem;
    font-weight: 800;
    gap: 5px;
    white-space: nowrap;
}

.review-stars-symbols {
    letter-spacing: 1px;
}

.review-stars-number {
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.notification-badge,
.notifications-badge {
    position: absolute;
    top: 4px;
    right: 4px;
}

.icon-btn:focus {
    outline: none;
    box-shadow: none;
}

.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: var(--card-bg);
    border-top: 1px solid var(--border-card);
    z-index: 1000;
    display: flex;
}

.desktop-header-nav {
    display: none;
}

.site-footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border-card);
    margin-top: 40px;
    padding: 28px 16px 24px;
    flex-shrink: 0;
}

.site-footer__inner {
    margin: 0 auto;
    max-width: 1200px;
}

.site-footer__brand {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.site-footer__logo {
    align-items: center;
    display: inline-flex;
    max-width: max-content;
    text-decoration: none;
}

.site-footer__logo img {
    display: block;
    height: 38px;
    max-width: 180px;
    object-fit: contain;
    width: auto;
}

.site-footer__description {
    color: var(--text-secondary);
    display: none;
    line-height: 1.6;
    margin: 0;
    max-width: 320px;
}

.site-footer__compact-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
}

.site-footer__compact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-top: 18px;
}

.site-footer__compact-links a,
.site-footer__links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-footer__compact-links a:hover,
.site-footer__compact-links a:focus-visible,
.site-footer__links a:hover,
.site-footer__links a:focus-visible {
    color: var(--primary);
    outline: none;
}

.site-footer__grid {
    display: none;
}

.site-footer__title {
    color: var(--text-main);
    font-size: 0.92rem;
    font-weight: 700;
    margin: 0 0 12px;
}

.site-footer__links {
    display: flex;
    flex-direction: column;
    gap: 9px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-footer__bottom {
    border-top: 1px solid var(--border-card);
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    font-size: 0.86rem;
    gap: 4px;
    margin-top: 22px;
    padding-top: 16px;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    text-decoration: none;
    color: var(--text-main);
    transition: color 0.2s ease;
}

.nav-unread-badge {
    border: 2px solid var(--card-bg);
    font-size: 0.68rem;
    margin-top: 0;
    min-width: 19px;
    padding: 3px 5px;
    position: absolute;
    right: 10px;
    top: -2px;
}

.mobile-bottom-nav .container {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding: 0 10px;
}

.nav-item span {
    font-size: 15px;
    margin-top: 2px;
    font-weight: 400;
}

.nav-item .nav-unread-badge {
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    margin-top: 0;
}

.nav-item.active span{
    color: var(--primary);
}

.nav-item.active .nav-unread-badge {
    color: #fff;
}

.nav-item img {
    width: 24px;
    height: 24px;
}

html[data-theme="dark"] .mobile-bottom-nav .nav-item img {
    filter: brightness(0) saturate(100%) invert(78%) sepia(8%) saturate(399%) hue-rotate(342deg) brightness(91%) contrast(86%);
}

html[data-theme="dark"] .mobile-bottom-nav .nav-item.active img {
    filter: brightness(0) saturate(100%) invert(75%) sepia(31%) saturate(619%) hue-rotate(344deg) brightness(91%) contrast(84%);
}

@media (min-width: 1024px) {
    .mobile-bottom-nav {
        display: none;
    }

    .top-header {
        padding: 0;
    }

    .header-container {
        display: flex;
        gap: 18px;
        justify-content: space-between;
        margin: 0 auto;
        max-width: 1200px;
        min-height: 68px;
        padding: 0 24px;
        width: 100%;
    }

    .site-brand {
        flex: 0 0 auto;
        justify-self: auto;
    }

    .desktop-header-nav {
        align-items: center;
        display: flex;
        flex: 1 1 auto;
        flex-wrap: nowrap;
        gap: 6px;
        justify-content: center;
        margin: 0;
        min-width: 0;
        padding: 0;
    }

    .header-actions {
        align-items: center;
        display: flex;
        flex: 0 0 auto;
        justify-content: flex-end;
    }

    .desktop-header-nav-link {
        align-items: center;
        background: transparent;
        border: 1px solid transparent;
        border-radius: 999px;
        color: var(--text-main);
        display: inline-flex;
        gap: 8px;
        font-size: 0.92rem;
        min-height: 38px;
        padding: 7px 11px;
        text-decoration: none;
        transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
        white-space: nowrap;
    }

    .desktop-header-nav-link img {
        display: block;
        height: 18px;
        width: 18px;
        flex-shrink: 0;
    }

    .desktop-header-nav-link:hover,
    .desktop-header-nav-link:focus-visible {
        background: var(--surface-hover);
        border-color: var(--border-card);
        color: var(--primary);
        outline: none;
        transform: translateY(-1px);
    }

    .desktop-header-nav-link.active {
        background: rgba(126, 71, 18, 0.08);
        border-color: rgba(126, 71, 18, 0.18);
        color: var(--primary);
    }

    .site-footer {
        margin-top: 64px;
        padding: 42px 24px 24px;
    }

    .site-footer__inner {
        display: grid;
        gap: 32px;
        grid-template-columns: minmax(220px, 1.15fr) minmax(0, 3fr);
    }

    .site-footer__description {
        display: block;
    }

    .site-footer__compact-text,
    .site-footer__compact-links {
        display: none;
    }

    .site-footer__grid {
        display: grid;
        gap: 24px;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .site-footer__bottom {
        align-items: center;
        flex-direction: row;
        grid-column: 1 / -1;
        justify-content: space-between;
        margin-top: 4px;
    }
}

@media (max-width: 1023px) {
    .site-footer {
        padding-bottom: calc(92px + env(safe-area-inset-bottom));
    }
}

.back-btn {
    background-color: var(--card-bg);
    border: 1px solid var(--border-card);
    border-radius: 12px;
    width: 40px;
    height: 40px;
    box-shadow: var(--shadow-card);
}

.back-btn img {
    width: 12px;
}

.header-back-control img {
    display: block;
}

.relative {
    position: relative;
}

.password-requirements {
    background-color: var(--input-bg);
    border: 1px solid var(--border-card);
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 8px;
    font-size: 13px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    animation: fadeIn 0.2s ease-in-out;
}

.password-requirements p {
    margin: 0 0 8px 0;
    font-weight: 600;
    color: var(--text-main);
}

.password-requirements ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.password-requirements li {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.password-requirements li span {
    color: var(--error);
    font-weight: bold;
    display: inline-block;
    width: 14px;
    text-align: center;
}

.password-requirements li.valid {
    color: var(--success);
}

.password-requirements li.valid span {
    color: var(--success);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert{
    color: var(--error);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.alert img {
    width: 20px;
    margin-right: 10px;
}

.flash-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: 90%;
    max-width: 500px;
    pointer-events: none;
}

.flash-message {
    pointer-events: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    animation: slideDown 0.4s ease-out;
}

.flash-error {
    background-color: var(--card-bg);
    border-left: 5px solid #f05252;
    color: var(--text-main);
}

.flash-success {
    background-color: var(--card-bg);
    border-left: 5px solid #0e9f6e;
    color: var(--text-main);
}

.flash-content {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.flash-icon {
    width: 20px;
    height: 20px;
}

.flash-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #9ca3af;
    cursor: pointer;
    line-height: 1;
    padding: 0 0 0 15px;
    transition: color 0.2s;
}

.flash-close:hover {
    color: var(--text-main);
}

@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.verify-page {
    align-items: stretch;
    display: flex;
    justify-content: center;
    min-height: calc(100vh - 64px);
    padding: 18px 16px 96px;
}

.verify-card {
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-width: 100%;
    overflow: hidden;
    position: relative;
    width: 100%;
}

.verify-card::before {
    background: var(--primary);
    content: "";
    height: 4px;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
}

.verify-card--success::before {
    background: var(--success);
}

.verify-card--error::before {
    background: var(--error);
}

.verify-icon {
    align-items: center;
    background: var(--bg-main);
    border: 1px solid var(--border-card);
    border-radius: 999px;
    color: var(--primary);
    display: flex;
    flex: 0 0 auto;
    font-size: 26px;
    font-weight: 800;
    height: 54px;
    justify-content: center;
    line-height: 1;
    width: 54px;
}

.verify-card--success .verify-icon {
    color: var(--success);
}

.verify-card--error .verify-icon {
    color: var(--error);
}

.verify-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.verify-kicker {
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
    margin: 0;
    text-transform: uppercase;
}

.verify-content h1 {
    font-size: 1.45rem;
    line-height: 1.18;
    margin: 0;
}

.verify-message {
    color: var(--text-secondary);
    font-size: 0.96rem;
    line-height: 1.5;
    margin: 0;
    overflow-wrap: anywhere;
}

.verify-actions {
    display: grid;
    gap: 10px;
    width: 100%;
}

.verify-actions .btn-primary {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    min-height: 46px;
    text-decoration: none;
}

.header-actions {
    justify-self: end;
}

@media (max-width: 380px) {
    .auth-brand-logo-full {
        display: none;
    }

    .auth-brand-logo-mark {
        display: block;
    }
}

@media (min-width: 560px) {
    .verify-page {
        align-items: center;
        padding: 32px 24px 112px;
    }

    .verify-card {
        max-width: 520px;
        padding: 1.5rem;
    }

    .verify-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 768px) {
    .header-container {
        grid-template-columns: 48px minmax(0, 1fr) 48px;
    }


    .verify-page {
        min-height: calc(100vh - 76px);
        padding: 48px 28px;
    }

    .verify-card {
        align-items: flex-start;
        max-width: 640px;
        padding: 1.75rem;
    }

    .verify-content h1 {
        font-size: 1.8rem;
    }

    .verify-message {
        font-size: 1rem;
    }
}

@media (min-width: 1024px) {
    .verify-card {
        display: grid;
        grid-template-columns: 64px minmax(0, 1fr);
        max-width: 720px;
    }

    .verify-icon {
        grid-row: span 2;
        height: 64px;
        width: 64px;
    }

    .verify-actions {
        grid-column: 2;
        justify-content: flex-start;
        width: auto;
    }
}

@media (min-width: 768px) {
    h1 { font-size: 22px; }
    .price { font-size: 18px; }
    .btn-primary { width: auto; }
}
