/* ===== ShelfStalk design tokens ===== */
:root {
    --paper: #FAFAF9;
    --card: #FFFFFF;
    --ink: #18181B;
    --ink-soft: #6B6B68;
    --line: #E7E5E1;
    --accent: #00A86C;
    --accent-soft: #DBF3EA;
    --sticker-red: #E11D48;
    --sticker-red-soft: #FDE4E9;
    /* Deliberately equal to --accent/--accent-soft, not just a similar
       shade -- the brand color is green now, so "highlighted/brand action"
       and "confirmed/positive" collapsing into one green reads as
       intentional rather than a clash. Kept as separate variables anyway
       so call sites stay self-documenting about which meaning they're using. */
    --confirm-green: #00A86C;
    --confirm-green-soft: #DBF3EA;

    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'Inter', sans-serif;

    --shadow-sm: 0 1px 2px rgba(24,24,27,0.06);
    --shadow-md: 0 4px 16px rgba(24,24,27,0.08);
}

* { box-sizing: border-box; }

body {
    font-family: var(--font-body);
    background: var(--paper);
    color: var(--ink);
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0 0 12px 0;
}

h1 { font-size: 26px; }
h3 { font-size: 17px; }

a { color: var(--ink); }

/* ===== Nav ===== */
nav {
    background: var(--card);
    border-bottom: 1px solid var(--line);
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 20;
}

.brand {
    display: flex;
    align-items: center;
}

.brand a { display: flex; text-decoration: none; }

.brand-logo {
    height: 34px;
    width: auto;
    display: block;
}

nav > div:last-child {
    display: flex;
    align-items: center;
    gap: 20px;
}

nav a, nav button {
    color: var(--ink-soft);
    text-decoration: none;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 14px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s ease;
}

nav a:hover, nav button:hover {
    color: var(--accent);
}

nav span {
    color: var(--ink-soft);
    font-size: 14px;
}

/* ===== Layout ===== */
.container {
    max-width: 1100px;
    margin: 36px auto;
    padding: 0 24px;
}

/* ===== Buttons ===== */
button, input[type="submit"] {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 14px;
    background: var(--accent);
    color: #FFFFFF;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

button:hover, input[type="submit"]:hover {
    background: #D9531F;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

button:active, input[type="submit"]:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--card);
    color: var(--ink);
    border: 1px solid var(--line);
    box-shadow: none;
}

.btn-secondary:hover {
    background: var(--paper);
    border-color: var(--ink-soft);
    box-shadow: none;
}

/* ===== Forms ===== */
form p { margin: 14px 0; }

label {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 13px;
    color: var(--ink-soft);
    display: block;
    margin-bottom: 4px;
}

input[type="text"], input[type="password"], input[type="email"],
input[type="datetime-local"], select, textarea {
    width: 100%;
    padding: 10px 12px;
    font-family: var(--font-body);
    font-size: 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--paper);
    color: var(--ink);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ===== Filter bar ===== */
.filter-form {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
}

.filter-form label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
    font-size: 12px;
}

.filter-form input[type="text"], .filter-form select {
    width: auto;
    min-width: 140px;
}

/* ===== Feed grid ===== */
.deal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

/* ===== Deal cards ===== */
.deal-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 0 0 18px 0;
    margin-bottom: 0;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.deal-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.deal-card img {
    max-width: 100%;
    display: block;
}

.deal-tag {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--card);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 5px 12px;
    border-radius: 999px;
    box-shadow: var(--shadow-sm);
    z-index: 2;
}

.deal-tag::before { content: none; }

.deal-card .deal-body {
    padding: 16px 18px 0 18px;
    position: relative;
}

.deal-card .deal-body::before { content: none; }

.deal-card h3 { margin-top: 4px; }

.deal-card p {
    margin: 6px 0;
    font-size: 14px;
    color: var(--ink-soft);
}

.deal-card p strong {
    color: var(--ink);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.discount-badge-overlay {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--accent);
    color: #FFFFFF;
    box-shadow: var(--shadow-sm);
    z-index: 2;
    margin: 0;
}

/* ===== Vote buttons ===== */
.vote-buttons {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    display: flex;
    gap: 16px;
}

.vote-buttons a {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-soft);
    text-decoration: none;
}

.vote-buttons a:hover {
    color: var(--confirm-green);
}

/* ===== Location picker ===== */
.location-picker {
    background: var(--card);
    border: 1px solid var(--line);
    padding: 18px;
    border-radius: 14px;
    margin-bottom: 18px;
    position: relative;
}

.location-picker input[type="text"] {
    margin-top: 6px;
}

.suggestions-box {
    position: relative;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
    margin-top: 4px;
}

.suggestion-item {
    padding: 9px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
}

.suggestion-item:last-child { border-bottom: none; }

.suggestion-item:hover {
    background: var(--paper);
}

#selected-location {
    background: var(--confirm-green-soft);
    border: 1px solid var(--confirm-green);
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
}

#selected-location a { color: var(--confirm-green); font-weight: 600; }

#show-map-fallback {
    display: inline-block;
    margin-top: 8px;
    font-size: 13px;
    color: var(--ink-soft);
}

/* ===== Extra photos gallery ===== */
.extra-photos {
    display: flex;
    gap: 8px;
    margin: 10px 0;
    flex-wrap: wrap;
}

.extra-photo-thumb {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--line);
    cursor: zoom-in;
}

/* ===== Error / status messages ===== */
.error-message {
    background: var(--sticker-red-soft);
    border: 1px solid var(--sticker-red);
    color: #A3123B;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 16px;
}

.success-message {
    background: var(--confirm-green-soft);
    border: 1px solid var(--confirm-green);
    color: #0F5C2E;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 16px;
}

/* ===== Password strength checklist (signup form) ===== */
.password-checklist {
    list-style: none;
    margin: 6px 0 14px;
    padding: 0;
    font-size: 13px;
    color: var(--ink-soft);
}

.password-checklist li {
    padding: 2px 0;
}

.password-checklist li::before {
    content: "○";
    display: inline-block;
    width: 18px;
    color: var(--ink-soft);
}

.password-checklist li.met {
    color: var(--confirm-green);
}

.password-checklist li.met::before {
    content: "●";
    color: var(--confirm-green);
}

/* ===== Lightbox ===== */
#lightbox-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(24, 24, 27, 0.9);
    z-index: 100;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    padding: 30px;
}

#lightbox-overlay img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}

/* ===== Carousel ===== */
.carousel {
    position: relative;
    overflow: hidden;
}

.carousel-track {
    display: flex;
    overflow-x: hidden;
    scroll-snap-type: x mandatory;
}

.carousel-track img {
    flex: 0 0 100%;
    width: 100%;
    height: 220px;
    object-fit: cover;
    scroll-snap-align: start;
    cursor: zoom-in;
    display: block;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(24, 24, 27, 0.55);
    color: #FFFFFF;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    z-index: 3;
    box-shadow: none;
}

.carousel-btn:hover { background: rgba(24, 24, 27, 0.8); box-shadow: none; transform: translateY(-50%); }
.carousel-btn.prev { left: 8px; }
.carousel-btn.next { right: 8px; }

/* ===== Directions link ===== */
.directions-link {
    display: inline-block;
    margin: 8px 8px 8px 0;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    color: var(--confirm-green);
    text-decoration: none;
}

.directions-link:hover { text-decoration: underline; }

/* ===== Comments ===== */
.comments-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.comments-section h3 { font-size: 14px; margin-bottom: 10px; }

.comment-form textarea {
    width: 100%;
    padding: 10px 12px;
    font-family: var(--font-body);
    font-size: 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    resize: vertical;
    margin-bottom: 8px;
}

.comment {
    background: var(--paper);
    border-radius: 10px;
    padding: 10px 12px;
    margin-top: 10px;
}

.comment-meta {
    font-family: var(--font-body);
    font-size: 12px;
    color: var(--ink-soft);
    margin: 0 0 4px 0;
}

.comment p:last-child {
    margin: 0;
    font-size: 14px;
}

/* ===== Save picker ===== */
.save-picker {
    margin-top: 10px;
}

.save-picker select, .save-picker .new-list-input {
    padding: 8px 10px;
    font-size: 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    width: auto;
}

.tier-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: var(--ink-soft);
    background: var(--paper);
    border: 1px solid var(--line);
    padding: 2px 8px;
    border-radius: 999px;
    margin-left: 4px;
}

.leaderboard-me {
    background: var(--accent-soft) !important;
    border: 1px solid var(--accent);
}