/* =============================================================
   Dushi Marketplace — Global Stylesheet
   Aesthetic: dark, sleek, modern SaaS with Caribbean accent
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif&family=Inter+Tight:wght@300;400;500;600;700&display=swap');

:root {
    --bg:        #07080b;
    --bg-2:      #0d0f14;
    --bg-3:      #14171f;
    --line:      #1f2330;
    --line-2:    #2a3041;
    --text:      #e7eaf0;
    --text-dim:  #8b91a3;
    --text-mute: #565b6b;
    --accent:    #00d3a7;     /* Caribbean teal */
    --accent-2:  #ffb547;     /* tropical amber */
    --danger:    #ff5d6c;
    --radius:    14px;
    --radius-sm: 8px;
    --shadow:    0 10px 40px rgba(0,0,0,.5);
    --serif:     'Instrument Serif', Georgia, serif;
    --sans:      'Inter Tight', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html, body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* Atmospheric background */
body::before {
    content: '';
    position: fixed; inset: 0;
    background:
        radial-gradient(900px 500px at 12% -10%, rgba(0,211,167,.10), transparent 60%),
        radial-gradient(700px 500px at 95% 10%, rgba(255,181,71,.06), transparent 65%),
        radial-gradient(600px 600px at 80% 110%, rgba(0,211,167,.05), transparent 70%);
    pointer-events: none;
    z-index: -1;
}

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

img, video { max-width: 100%; display: block; }

h1,h2,h3,h4 { font-weight: 500; letter-spacing: -.02em; }
h1 { font-size: clamp(2.4rem, 5vw, 4rem); font-family: var(--serif); font-weight: 400; line-height: 1.05; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-family: var(--serif); font-weight: 400; }
h3 { font-size: 1.2rem; }

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

/* ---------------- Public navbar ---------------- */
.navbar {
    position: sticky; top: 0; z-index: 50;
    backdrop-filter: blur(18px);
    background: rgba(7,8,11,.7);
    border-bottom: 1px solid var(--line);
}
.nav-inner {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 24px; max-width: 1320px; margin: 0 auto;
}
.brand {
    display: flex; align-items: center; gap: 10px;
    font-family: var(--serif); font-size: 1.4rem; color: var(--text);
}
.brand-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--accent); box-shadow: 0 0 14px var(--accent);
}
.nav-links { display: flex; gap: 28px; }
.nav-links a {
    color: var(--text-dim); font-size: .92rem; font-weight: 400;
    position: relative;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: -6px;
    height: 1px; background: var(--accent);
}
.nav-actions { display: flex; gap: 10px; align-items: center; }

/* ---------------- Buttons ---------------- */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 18px; border-radius: var(--radius-sm);
    font-family: var(--sans); font-weight: 500; font-size: .9rem;
    border: 1px solid var(--line-2); background: transparent;
    color: var(--text); cursor: pointer; transition: all .18s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary {
    background: var(--accent); color: #00231b; border-color: var(--accent);
    font-weight: 600;
}
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: #2a1700; }
.btn-ghost { border-color: transparent; color: var(--text-dim); }
.btn-ghost:hover { color: var(--text); border-color: var(--line-2); }
.btn-danger { color: var(--danger); border-color: rgba(255,93,108,.3); }
.btn-danger:hover { background: rgba(255,93,108,.1); border-color: var(--danger); }
.btn-sm { padding: 6px 12px; font-size: .82rem; }

/* ---------------- Forms ---------------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: .82rem; color: var(--text-dim); letter-spacing: .02em; }
.input, .textarea, .select {
    background: var(--bg-2);
    border: 1px solid var(--line);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-family: var(--sans);
    font-size: .95rem;
    width: 100%;
    transition: border-color .18s, background .18s;
}
.input:focus, .textarea:focus, .select:focus {
    outline: none; border-color: var(--accent);
    background: var(--bg-3);
}
.textarea { resize: vertical; min-height: 100px; }
.checkbox { display: flex; align-items: flex-start; gap: 10px; font-size: .9rem; color: var(--text-dim); }
.checkbox input { margin-top: 3px; accent-color: var(--accent); }

/* ---------------- Auth panel ---------------- */
.auth-shell {
    min-height: 100vh; display: grid; place-items: center;
    padding: 40px 20px;
}
.auth-card {
    width: 100%; max-width: 460px;
    background: linear-gradient(180deg, rgba(20,23,31,.9), rgba(13,15,20,.9));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 42px 38px;
    box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 2rem; margin-bottom: 8px; }
.auth-card .sub { color: var(--text-dim); margin-bottom: 28px; }
.auth-card .alt { font-size: .88rem; color: var(--text-dim); margin-top: 16px; text-align: center; }

/* ---------------- Hero ---------------- */
.hero {
    padding: 100px 0 60px;
    text-align: left;
    position: relative;
}
.hero .eyebrow {
    display: inline-block; padding: 6px 12px;
    border: 1px solid var(--line-2); border-radius: 100px;
    font-size: .78rem; color: var(--text-dim);
    margin-bottom: 24px; letter-spacing: .08em; text-transform: uppercase;
}
.hero h1 .accent { font-style: italic; color: var(--accent); }
.hero p.lead {
    margin-top: 22px; max-width: 540px;
    color: var(--text-dim); font-size: 1.08rem;
}
.hero-actions { margin-top: 32px; display: flex; gap: 12px; }

/* ---------------- Section ---------------- */
.section { padding: 70px 0; }
.section-head { display: flex; justify-content: space-between; align-items: end; margin-bottom: 30px; }
.section-head h2 { max-width: 600px; }
.section-head .sub { color: var(--text-dim); font-size: .9rem; }

/* ---------------- Cards ---------------- */
.grid { display: grid; gap: 22px; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

.card {
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform .25s, border-color .25s;
}
.card:hover { transform: translateY(-3px); border-color: var(--line-2); }
.card-media {
    aspect-ratio: 4 / 3;
    background: var(--bg-3);
    overflow: hidden; position: relative;
}
.card-media img, .card-media video {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform .4s;
}
.card:hover .card-media img { transform: scale(1.05); }
.card-body { padding: 18px 20px 22px; }
.card-title { font-size: 1.05rem; font-weight: 500; margin-bottom: 6px; }
.card-meta { font-size: .82rem; color: var(--text-mute); }
.price { color: var(--accent); font-weight: 600; font-family: var(--serif); font-size: 1.4rem; }
.price small { color: var(--text-dim); font-family: var(--sans); font-size: .7rem; margin-left: 4px; }
.tag {
    display: inline-block; padding: 4px 10px;
    background: rgba(0,211,167,.1); color: var(--accent);
    border-radius: 100px; font-size: .72rem; letter-spacing: .04em;
}

/* ---------------- Quote block ---------------- */
.quote-block {
    padding: 80px 0;
    text-align: center;
}
.quote-block blockquote {
    font-family: var(--serif); font-size: clamp(1.6rem, 3vw, 2.6rem);
    font-style: italic; color: var(--text); max-width: 800px; margin: 0 auto;
    line-height: 1.3;
}
.quote-block .cite { color: var(--text-dim); margin-top: 18px; font-size: .9rem; letter-spacing: .15em; text-transform: uppercase; }

/* ---------------- Footer ---------------- */
.footer {
    border-top: 1px solid var(--line);
    padding: 40px 0;
    color: var(--text-mute);
    font-size: .85rem;
    margin-top: 80px;
}
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px; }

/* ---------------- Alerts ---------------- */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid; margin-bottom: 18px; font-size: .9rem; }
.alert-success { background: rgba(0,211,167,.08); border-color: rgba(0,211,167,.3); color: var(--accent); }
.alert-error   { background: rgba(255,93,108,.08); border-color: rgba(255,93,108,.3); color: var(--danger); }

/* ---------------- Rich-text content (from admin editor) ---------------- */
.rt-content {
    color: var(--text-dim);
    font-size: 1.05rem;
    line-height: 1.75;
}
.rt-content > *:first-child { margin-top: 0; }
.rt-content > *:last-child  { margin-bottom: 0; }
.rt-content h1, .rt-content h2, .rt-content h3 {
    font-family: var(--serif);
    color: var(--text);
    margin: 1.4em 0 0.6em;
    line-height: 1.2;
}
.rt-content h1 { font-size: 1.8rem; }
.rt-content h2 { font-size: 1.45rem; }
.rt-content h3 { font-size: 1.2rem; }
.rt-content p { margin: 0 0 1em; }
.rt-content a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: rgba(0,211,167,.3);
    text-underline-offset: 3px;
}
.rt-content a:hover { text-decoration-color: var(--accent); }
.rt-content ul, .rt-content ol { margin: 0 0 1em; padding-left: 1.4em; }
.rt-content li { margin-bottom: 0.4em; }
.rt-content blockquote {
    margin: 1.4em 0;
    padding: 12px 18px;
    border-left: 3px solid var(--accent);
    background: rgba(0,211,167,.04);
    color: var(--text);
    font-style: italic;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.rt-content code {
    background: var(--bg-3);
    color: var(--accent);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .92em;
}
.rt-content pre {
    background: var(--bg-3);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    overflow-x: auto;
    margin: 1em 0;
}
.rt-content pre code { background: transparent; padding: 0; }
.rt-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    margin: 1em 0;
    border: 1px solid var(--line);
}
.rt-content strong, .rt-content b { color: var(--text); font-weight: 600; }
.rt-content hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 2em 0;
}
.rt-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.rt-content th, .rt-content td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}
.rt-content th {
    background: var(--bg-3);
    color: var(--text);
    font-weight: 500;
}
/* Quill alignment classes */
.rt-content .ql-align-center { text-align: center; }
.rt-content .ql-align-right  { text-align: right;  }
.rt-content .ql-align-justify { text-align: justify; }

/* ---------------- Responsive ---------------- */
@media (max-width: 720px) {
    .nav-links { display: none; }
    .hero { padding: 60px 0 30px; }
    .section-head { flex-direction: column; align-items: start; gap: 12px; }
}

/* ---------------- Quick-view modal ---------------- */
.qv-backdrop {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(7,8,11,.85); backdrop-filter: blur(6px);
    display: none; align-items: center; justify-content: center;
    padding: 20px; overflow-y: auto;
}
.qv-backdrop.open { display: flex; }
.qv-modal {
    background: var(--bg-2); border: 1px solid var(--line);
    border-radius: var(--radius); width: 100%; max-width: 1000px;
    max-height: 92vh; overflow-y: auto; position: relative;
    box-shadow: 0 24px 80px rgba(0,0,0,.6);
    animation: qvIn .2s ease-out;
}
@keyframes qvIn { from { transform: scale(.96); opacity: 0 } to { transform: none; opacity: 1 } }
.qv-close {
    position: absolute; top: 14px; right: 14px; z-index: 2;
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(0,0,0,.6); color: var(--text);
    border: 1px solid var(--line-2);
    cursor: pointer; font-size: 22px; line-height: 1;
    display: grid; place-items: center;
}
.qv-close:hover { background: var(--accent); color: #00231b; }
.qv-spinner, .qv-error { padding: 80px 40px; text-align: center; color: var(--text-dim); }
.qv-grid {
    display: grid; grid-template-columns: 1.2fr 1fr; gap: 0;
    min-height: 480px;
}
.qv-media {
    background: #000; position: relative;
    display: flex; align-items: center; justify-content: center;
    min-height: 380px;
}
.qv-media > img, .qv-media > video {
    width: 100%; height: 100%; max-height: 70vh;
    object-fit: contain; display: block;
}
.qv-empty {
    color: var(--text-mute); font-size: .9rem;
}
.qv-thumbs {
    position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 6px; padding: 6px; background: rgba(0,0,0,.6);
    border-radius: 100px; max-width: 90%; overflow-x: auto;
}
.qv-thumb {
    width: 44px; height: 44px; border-radius: 50%; overflow: hidden;
    border: 2px solid transparent; cursor: pointer; padding: 0; flex-shrink: 0;
    background: var(--bg-3);
}
.qv-thumb img, .qv-thumb video { width: 100%; height: 100%; object-fit: cover; }
.qv-thumb.active { border-color: var(--accent); }

.qv-info {
    padding: 36px 32px;
    display: flex; flex-direction: column; gap: 14px;
}
.qv-tag {
    display: inline-block;
    background: rgba(0,211,167,.1); color: var(--accent);
    border: 1px solid rgba(0,211,167,.3);
    padding: 4px 12px; border-radius: 100px;
    font-size: .76rem; align-self: flex-start;
}
.qv-info h2 {
    font-family: var(--serif); font-size: 1.8rem; line-height: 1.15;
    margin: 0; color: var(--text);
}
.qv-price {
    font-family: var(--serif); font-size: 2.2rem;
    color: var(--accent); font-weight: 500;
}
.qv-price small { font-size: 1rem; color: var(--text-mute); }
.qv-meta { color: var(--text-mute); font-size: .86rem; margin: 0; }
.qv-desc {
    color: var(--text-dim); line-height: 1.6;
    max-height: 200px; overflow-y: auto; margin: 0;
}
.qv-quote {
    border-left: 3px solid var(--accent); padding: 8px 14px;
    color: var(--text); font-style: italic;
    background: rgba(0,211,167,.04); margin: 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.qv-seller {
    display: flex; align-items: center; gap: 10px;
    color: var(--text); text-decoration: none;
    padding: 10px; border-radius: var(--radius-sm);
    background: var(--bg-3); border: 1px solid var(--line);
}
.qv-seller:hover { background: var(--bg-3); border-color: var(--accent); }
.qv-seller img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.qv-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; }
.qv-socials { display: flex; gap: 14px; flex-wrap: wrap; padding-top: 6px; }
.qv-socials a { color: var(--accent); font-size: .9rem; }

@media (max-width: 760px) {
    .qv-grid { grid-template-columns: 1fr; }
    .qv-media { min-height: 280px; }
    .qv-info { padding: 24px 20px; }
    .qv-info h2 { font-size: 1.4rem; }
    .qv-price { font-size: 1.6rem; }
}

/* Make cards with data-quickview show pointer cursor */
[data-quickview] { cursor: pointer; }

/* Make any card with data-quickview clearly clickable */
[data-quickview] {
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
[data-quickview]:hover {
    transform: translateY(-2px);
    border-color: var(--accent) !important;
    box-shadow: 0 8px 24px rgba(0, 211, 167, .12);
}
/* Don't lift cards when hovering on inner buttons/links */
[data-quickview] a:hover ~ * { transform: none !important; }

/* Subtle "tap for more" hint that auto-fades on hover */
.promo-card { position: relative; }
.promo-card::after {
    content: "👁 Click for details";
    position: absolute;
    top: 12px; right: 12px;
    background: rgba(7,8,11,.75);
    color: #fff;
    padding: 5px 10px;
    border-radius: 100px;
    font-size: .72rem;
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity .15s;
    pointer-events: none;
}
.promo-card:hover::after {
    opacity: 1;
}

/* ---------- Image save deterrents (mobile + desktop) ----------
   Disable the iOS/Android long-press "Save Image" menu and the
   default drag-image behavior. Combined with the JS contextmenu
   block in app.js, this stops casual right-click/long-press save.
   Does NOT apply inside admin/ or user/ pages (handled in JS by
   path check). Pure CSS can't do that, so we apply globally
   except where explicitly opted out. */
img, video, picture, source {
    -webkit-touch-callout: none;       /* iOS long-press */
    -webkit-user-drag: none;           /* old Safari */
    user-select: none;                 /* prevent select-then-drag */
    -webkit-user-select: none;
}
/* Re-enable inside admin / user dashboards so previews work normally */
.dash img, .dash video, .dash picture {
    -webkit-touch-callout: default;
    -webkit-user-drag: auto;
    user-select: auto;
    -webkit-user-select: auto;
}

/* ---------- Card "Contact seller" floating button ---------- */
.card-media { position: relative; }    /* ensure absolute child anchors correctly */
.card-msg-btn {
    position: absolute;
    bottom: 10px; right: 10px;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--accent);
    color: #00231b;
    border: 0;
    cursor: pointer;
    display: grid; place-items: center;
    box-shadow: 0 4px 12px rgba(0, 211, 167, .25), 0 0 0 1px rgba(0, 0, 0, .15);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .18s ease, transform .18s ease, background .12s ease;
    z-index: 2;
}
/* Show on card hover (desktop) */
.card:hover .card-msg-btn {
    opacity: 1;
    transform: translateY(0);
}
/* Always visible on touch devices (no hover) */
@media (hover: none) {
    .card-msg-btn { opacity: 1; transform: none; }
}
.card-msg-btn:hover {
    background: #00b893;
    transform: scale(1.06);
}
.card-msg-btn:active { transform: scale(.95); }
.card-msg-btn svg { display: block; }

/* ---------- Card "Share" floating button ---------- */
.card-share-btn {
    position: absolute;
    bottom: 10px; right: 56px;     /* sits to the left of the message button */
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color: #14171f;
    border: 0;
    cursor: pointer;
    display: grid; place-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .18s ease, transform .18s ease, background .12s ease;
    z-index: 2;
}
.card:hover .card-share-btn {
    opacity: 1;
    transform: translateY(0);
}
@media (hover: none) {
    .card-share-btn { opacity: 1; transform: none; }
}
.card-share-btn:hover {
    background: #fff;
    transform: scale(1.06);
}
.card-share-btn:active { transform: scale(.95); }
.card-share-btn svg { display: block; }

/* On promo cards (no message icon) move it to the right edge */
.promo-card .card-share-btn { right: 10px; }

/* ---------- Desktop share popover (fallback when no navigator.share) ---------- */
.card-share-pop {
    position: absolute;
    width: 180px;
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: 0 14px 38px rgba(0, 0, 0, .45);
    padding: 6px;
    z-index: 1000;
    animation: cspIn .14s ease-out;
}
@keyframes cspIn { from { opacity: 0; transform: translateY(-4px) } to { opacity: 1; transform: none } }
.card-share-pop .csp-row {
    display: flex; align-items: center; gap: 10px;
    width: 100%; box-sizing: border-box;
    padding: 8px 10px;
    background: none; border: 0;
    color: var(--text); text-decoration: none;
    font-size: .86rem; text-align: left;
    border-radius: 6px;
    cursor: pointer;
}
.card-share-pop .csp-row:hover { background: var(--bg-3); }
.card-share-pop .csp-ico {
    width: 24px; height: 24px;
    border-radius: 50%;
    display: grid; place-items: center;
    font-weight: bold;
    font-size: .82rem;
    flex-shrink: 0;
}
