@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&family=DM+Sans:wght@300;400;500&display=swap');

:root {
    --bg: #0e0e0f;
    --bg2: #141416;
    --bg3: #1c1c1f;
    --card: #18181b;
    --border: #2a2a2e;
    --accent: #c9a96e;
    --accent2: #e8c98a;
    --text: #f0ece4;
    --muted: #8a8680;
    --muted2: #5a5754;
    --red: #c25c5c;
    --radius: 4px;
    --radius-lg: 12px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-weight: 300;
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
}

.page { display: flex; flex-direction: column; min-height: 100vh; }
.content { flex: 1 1 auto; padding: 0 0 80px; }

h1, h2, h3, h4 {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 400;
    line-height: 1.2;
    color: var(--text);
}

h1 { font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.2rem; }

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent2); }

/* Header */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(14,14,15,0.96);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    max-width: 1280px; margin: 0 auto; padding: 0 32px;
    height: 68px; display: flex; align-items: center; gap: 32px;
}

.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.logo img { width: 34px; height: 30px; object-fit: contain; }
.logo-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.5rem; font-weight: 600; letter-spacing: 0.08em; color: var(--text);
}

.header-nav { display: flex; gap: 2px; flex: 1; }
.header-nav a {
    padding: 6px 12px; border-radius: var(--radius);
    color: var(--muted); font-size: 12px; font-weight: 400;
    letter-spacing: 0.08em; text-transform: uppercase; transition: color 0.2s, background 0.2s;
}
.header-nav a:hover { color: var(--text); background: var(--bg3); }
.header-nav a.active { color: var(--accent); }

.header-search { position: relative; width: 200px; }
.header-search input {
    width: 100%; background: var(--bg3); border: 1px solid var(--border);
    color: var(--text); padding: 8px 16px 8px 34px; border-radius: 100px;
    font-size: 13px; font-family: 'DM Sans', sans-serif; outline: none;
    transition: border-color 0.2s;
}
.header-search input::placeholder { color: var(--muted2); }
.header-search input:focus { border-color: var(--accent); }
.header-search .search-icon {
    position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
    color: var(--muted2); pointer-events: none;
}

/* Container */
.container { max-width: 1280px; margin: 0 auto; padding: 0 32px; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 22px; border-radius: var(--radius);
    font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 500;
    letter-spacing: 0.06em; text-transform: uppercase;
    border: none; cursor: pointer; transition: all 0.2s; text-decoration: none;
}
.btn-primary { background: var(--accent); color: #0e0e0f; }
.btn-primary:hover { background: var(--accent2); color: #0e0e0f; transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn-outline:hover { background: var(--accent); color: #0e0e0f; }
.btn-ghost { background: var(--bg3); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* Forms */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
    font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--muted); font-weight: 500;
}
.form-control {
    background: var(--bg3); border: 1px solid var(--border); color: var(--text);
    padding: 12px 16px; border-radius: var(--radius);
    font-family: 'DM Sans', sans-serif; font-size: 14px;
    outline: none; width: 100%; transition: border-color 0.2s;
}
.form-control::placeholder { color: var(--muted2); }
.form-control:focus { border-color: var(--accent); }

/* Size chips */
.size-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.size-chip {
    padding: 4px 10px; border: 1px solid var(--border);
    border-radius: var(--radius); font-size: 12px; color: var(--muted);
    transition: all 0.2s;
}
.size-chip.active { border-color: var(--accent); color: var(--accent); background: rgba(201,169,110,0.1); }

/* Badge */
.badge {
    display: inline-block; padding: 3px 10px; border-radius: 100px;
    font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
}
.badge-accent { background: var(--accent); color: #0e0e0f; }
.badge-red { background: var(--red); color: #fff; }
.badge-muted { border: 1px solid var(--border); color: var(--muted); }

/* Divider */
.divider { height: 1px; background: var(--border); margin: 24px 0; }

/* Utilities */
.text-accent { color: var(--accent); }
.text-muted { color: var(--muted); }

/* Footer */
.site-footer {
    background: var(--bg2);
    border-top: 1px solid var(--border);
    padding: 48px 32px 28px;
}
.footer-inner {
    max-width: 1280px; margin: 0 auto;
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 40px; flex-wrap: wrap;
}
.footer-brand p { color: var(--muted); font-size: 13px; max-width: 220px; margin-top: 8px; }
.footer-bottom {
    max-width: 1280px; margin: 32px auto 0;
    padding-top: 20px; border-top: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
    color: var(--muted2); font-size: 12px;
}

/* Header actions */

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-logout-form { margin: 0; }
.header-logout-form button { font-family: inherit; cursor: pointer; }

.auth-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-btn {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 15px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    border: 1px solid transparent;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
    white-space: nowrap;
}

.header-btn:hover {
    transform: translateY(-1px);
}

.header-btn-primary {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
}

.header-btn-primary:hover,
.header-btn-primary.active {
    background: var(--accent2);
    color: var(--bg);
    border-color: var(--accent2);
}

.header-btn-ghost {
    background: var(--bg3);
    color: var(--text);
    border-color: var(--border);
}

.header-btn-ghost:hover,
.header-btn-ghost.active {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(201, 169, 110, 0.08);
}

/* Cart button */

.cart-button {
    position: relative;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 0 14px 0 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg3);
    color: var(--text);
    text-decoration: none;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
    white-space: nowrap;
}

.cart-button:hover,
.cart-button.active {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(201, 169, 110, 0.08);
    transform: translateY(-1px);
}

.cart-button-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cart-button-text {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.cart-badge {
    position: absolute;
    top: -9px;
    right: -10px;
    background: var(--accent);
    color: var(--bg);
    font-size: 10px;
    font-weight: 700;
    min-width: 17px;
    height: 17px;
    border-radius: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    line-height: 1;
}

/* Theme toggle */

.theme-toggle {
    width: 54px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg3);
    cursor: pointer;
    padding: 5px;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.theme-toggle-track {
    position: relative;
    width: 100%;
    height: 100%;
}

.theme-toggle-dot {
    position: absolute;
    top: 50%;
    left: 1px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent);
    transform: translateY(-50%);
    transition: transform 0.2s ease;
}

html[data-theme="light"] .theme-toggle-dot {
    transform: translate(18px, -50%);
}

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

@media (max-width: 820px) {
    .header-inner {
        height: auto;
        min-height: 68px;
        padding: 12px 18px;
        gap: 14px;
        flex-wrap: wrap;
    }

    .header-nav {
        order: 3;
        width: 100%;
        flex: none;
    }

    .header-right {
        margin-left: auto;
        gap: 8px;
    }

    .header-btn {
        min-height: 36px;
        padding: 0 12px;
        font-size: 10px;
    }

    .cart-button {
        min-height: 36px;
        padding: 0 11px;
    }

    .cart-button-text {
        display: none;
    }

    .theme-toggle {
        width: 48px;
        height: 36px;
    }
}

@media (max-width: 520px) {
    .header-logout-form { margin: 0; }
.header-logout-form button { font-family: inherit; cursor: pointer; }

.auth-actions {
        order: 4;
        width: 100%;
        justify-content: stretch;
    }

    .auth-actions .header-btn {
        flex: 1;
    }
}

.alert {
    width: min(100% - 32px, 1180px);
    margin: 18px auto 0;
    padding: 13px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg2);
    color: var(--text);
    font-size: 14px;
}

.alert-success {
    border-color: rgba(98, 181, 128, 0.45);
    background: rgba(98, 181, 128, 0.10);
}

.alert-danger,
.alert-error {
    border-color: rgba(194, 92, 92, 0.45);
    background: rgba(194, 92, 92, 0.10);
}

.alert-warning {
    border-color: rgba(201, 169, 110, 0.45);
    background: rgba(201, 169, 110, 0.10);
}