/* Sellmaadi core components. Colours come from the theme via CSS variables;
   the fallbacks below keep things usable with any theme. */
:root {
	--sm-brand: #0a7a55;
	--sm-brand-dark: #07603f;
	--sm-brand-tint: #e8f4ef;
	--sm-ink: #1c2024;
	--sm-muted: #5e6670;
	--sm-line: #e6e8eb;
	--sm-bg: #ffffff;
	--sm-surface: #f5f6f7;
	--sm-card: #ffffff;
	--sm-accent: #f2b705;
	--sm-wa: #1fa855;
	--sm-danger: #c42b2b;
	--sm-radius: 12px;
}

[hidden] { display: none !important; }

/* Buttons */
.sm-btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; padding: .7em 1.2em; border: 1.5px solid var(--sm-brand); border-radius: 10px; background: var(--sm-brand); color: #fff !important; font: inherit; font-weight: 600; line-height: 1.15; text-decoration: none !important; cursor: pointer; transition: background-color .15s, border-color .15s; }
.sm-btn:hover { background: var(--sm-brand-dark); border-color: var(--sm-brand-dark); }
.sm-btn:focus-visible, .sm-link:focus-visible, .sm-save:focus-visible { outline: 3px solid rgba(10, 122, 85, .35); outline-offset: 2px; }
.sm-btn:disabled, .sm-btn.is-busy { opacity: .6; cursor: progress; }
.sm-btn--ghost { background: #fff; color: var(--sm-ink) !important; border-color: var(--sm-line); }
.sm-btn--ghost:hover { background: var(--sm-surface); border-color: #cfd3d8; }
.sm-btn--wa { background: var(--sm-wa); border-color: var(--sm-wa); }
.sm-btn--wa:hover { background: #178a45; border-color: #178a45; }
.sm-btn--danger { background: #fff; color: var(--sm-danger) !important; border-color: #f1d0d0; }
.sm-btn--danger:hover { background: #fdf2f2; border-color: var(--sm-danger); }
.sm-btn--block { display: flex; width: 100%; }
.sm-btn--sm { padding: .45em .85em; font-size: .875rem; border-radius: 8px; }
.sm-btn--lg { padding: .9em 1.5em; font-size: 1.05rem; }
.sm-link { background: none; border: 0; padding: 0; color: var(--sm-brand); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* Boxes & notices */
.sm-box, .sm-card { background: var(--sm-card); border: 1px solid var(--sm-line); border-radius: var(--sm-radius); padding: 1.4rem; }
.sm-box { max-width: 440px; margin: 2rem auto; }
.sm-card { margin: 0 0 1rem; }
fieldset.sm-card { min-width: 0; padding-top: 1.1rem; }
.sm-card legend { float: left; width: 100%; padding: 0; margin: 0 0 1rem; font-size: 1.05rem; font-weight: 700; color: var(--sm-ink); }
.sm-card legend + * { clear: both; }
.sm-center { text-align: center; }
.sm-muted { color: var(--sm-muted); }
.sm-small { font-size: .875rem; }
.sm-notice { padding: .8rem 1rem; border-radius: 10px; margin: 0 0 1rem; border-left: 4px solid; background: var(--sm-surface); }
.sm-notice--success { background: #edf7f2; border-color: var(--sm-brand); color: #0d4a35; }
.sm-notice--info { background: #eef4fb; border-color: #3b74b8; color: #1d3f66; }
.sm-notice--warn { background: #fff8e5; border-color: #e0a800; color: #5c4600; }
.sm-notice--error { background: #fdf0f0; border-color: var(--sm-danger); color: #7a1c1c; }

/* Forms */
.sm-field { margin: 0 0 1rem; }
.sm-field label { display: block; font-weight: 600; margin: 0 0 .35rem; color: var(--sm-ink); font-size: .95rem; }
.sm-field input[type=text], .sm-field input[type=email], .sm-field input[type=number], .sm-field input[type=tel], .sm-field input[type=date], .sm-field select, .sm-field textarea,
.sm-auth input, .sm-verify input, .sm-phone-form input { width: 100%; box-sizing: border-box; padding: .72rem .85rem; border: 1px solid #d5d9de; border-radius: 10px; background: #fff; font: inherit; font-size: 16px; color: var(--sm-ink); }
.sm-field input:focus, .sm-field select:focus, .sm-field textarea:focus, .sm-auth input:focus, .sm-verify input:focus, .sm-phone-form input:focus { outline: none; border-color: var(--sm-brand); box-shadow: 0 0 0 3px rgba(10, 122, 85, .14); }
.sm-field.has-error input, .sm-field.has-error select, .sm-field.has-error textarea { border-color: var(--sm-danger); }
.sm-req { color: var(--sm-danger); }
.sm-help { display: block; color: var(--sm-muted); margin-top: .3rem; font-size: .85rem; }
.sm-error { display: block; color: var(--sm-danger); margin-top: .3rem; font-size: .85rem; font-weight: 600; }
.sm-check { display: flex !important; align-items: center; gap: .55em; font-weight: 500 !important; }
.sm-check input { width: 1.1em; height: 1.1em; accent-color: var(--sm-brand); }
.sm-grid-2 { display: grid; gap: 0 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .sm-grid-2 { grid-template-columns: 1fr 1fr; } }
.sm-post-form { max-width: 720px; margin: 0 auto; }
.sm-post-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }

/* Photos */
.sm-photos { display: flex; flex-wrap: wrap; gap: .6rem; }
.sm-photo-previews { display: contents; }
.sm-photo { position: relative; width: 92px; height: 92px; border-radius: 10px; overflow: hidden; border: 1px solid var(--sm-line); background: var(--sm-surface); display: flex; align-items: center; justify-content: center; }
.sm-photo img { width: 100%; height: 100%; object-fit: cover; }
.sm-photo--add { border: 1.5px dashed #c5cad0; cursor: pointer; text-align: center; color: var(--sm-muted); font-size: .8rem; line-height: 1.3; }
.sm-photo--add:hover { border-color: var(--sm-brand); color: var(--sm-brand); }
.sm-photo--add input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.sm-photo--existing input { position: absolute; opacity: 0; }
.sm-photo-remove { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; background: rgba(28, 32, 36, .72); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; font-weight: 700; }
.sm-photo--existing.is-removed img { opacity: .25; filter: grayscale(1); }

/* Choose section */
.sm-choose h2 { text-align: center; }
.sm-choose-grid { display: grid; gap: .8rem; grid-template-columns: 1fr; max-width: 820px; margin: 0 auto; }
@media (min-width: 640px) { .sm-choose-grid { grid-template-columns: repeat(3, 1fr); } }
.sm-choose-card { display: flex; flex-direction: column; align-items: flex-start; gap: .35rem; padding: 1.3rem; background: #fff; border: 1px solid var(--sm-line); border-radius: var(--sm-radius); text-decoration: none !important; color: var(--sm-ink); transition: border-color .15s; }
.sm-choose-card:hover { border-color: var(--sm-brand); }
.sm-choose-card strong { font-size: 1.15rem; }
.sm-choose-card span { color: var(--sm-muted); font-size: .92rem; }
.sm-choose-emoji { font-size: 2rem !important; }
.sm-choose-icon { width: 44px; height: 44px; border-radius: 10px; background: var(--sm-brand-tint); color: var(--sm-brand) !important; display: flex; align-items: center; justify-content: center; margin-bottom: .3rem; }

/* Auth & verify */
.sm-auth h2, .sm-verify h2 { margin-top: 0; }
.sm-auth form, .sm-verify form, .sm-phone-form { display: grid; gap: .55rem; }
.sm-auth label, .sm-verify label { font-weight: 600; font-size: .95rem; }
.sm-auth form label:not(:first-child) { margin-top: .35rem; }
.sm-google { display: flex; justify-content: center; min-height: 44px; }
.sm-or { display: flex; align-items: center; gap: .8rem; color: var(--sm-muted); margin: 1rem 0; font-size: .9rem; }
.sm-or::before, .sm-or::after { content: ""; flex: 1; height: 1px; background: var(--sm-line); }
.sm-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.sm-auth-tabs { margin: -.4rem 0 1.2rem; }
.sm-auth-tabs a { flex: 1; text-align: center; }
.sm-forgot { justify-self: end; margin-top: -.15rem; }
.sm-auth form .sm-btn { margin-top: .6rem; }
.sm-auth-msg, .sm-verify-msg { min-height: 1.2em; margin: .6rem 0 0; font-weight: 600; }
.is-error { color: var(--sm-danger); }
.sm-phone-input { display: flex; align-items: stretch; }
.sm-phone-input span { display: flex; align-items: center; padding: 0 .8rem; border: 1px solid #d5d9de; border-right: 0; border-radius: 10px 0 0 10px; background: var(--sm-surface); font-weight: 600; color: var(--sm-muted); }
.sm-phone-input input { border-radius: 0 10px 10px 0 !important; }
.sm-steps { padding-left: 1.2rem; margin: 0 0 1rem; }
.sm-steps li { margin-bottom: .3rem; }
.sm-waiting { display: flex; align-items: center; gap: .5rem; justify-content: center; color: var(--sm-muted); }
.sm-spinner { width: 16px; height: 16px; border: 2.5px solid var(--sm-line); border-top-color: var(--sm-wa); border-radius: 50%; animation: sm-spin .8s linear infinite; }
@keyframes sm-spin { to { transform: rotate(360deg); } }
.sm-change { margin-top: 1rem; }
.sm-change summary { cursor: pointer; color: var(--sm-brand); font-weight: 600; margin-bottom: .6rem; }
.sm-qr-box { text-align: center; margin-bottom: 1rem; }
.sm-qr-title { font-weight: 700; margin: 0 0 .5rem; }
.sm-qr { display: inline-block; padding: 10px; background: #fff; border: 1px solid var(--sm-line); border-radius: 12px; line-height: 0; }
.sm-qr svg { width: 220px; height: 220px; }
.sm-qr-box .sm-steps { text-align: left; margin-top: .8rem; }

/* Cards grid */
.sm-cards { display: grid; gap: 1.4rem .9rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .sm-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.6rem 1.1rem; } }
@media (min-width: 1040px) { .sm-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.sm-card-ad { position: relative; background: transparent; }
.sm-card-link { display: block; color: inherit; text-decoration: none !important; }
.sm-card-img { position: relative; aspect-ratio: 4 / 3; background: var(--sm-surface); border-radius: var(--sm-radius); overflow: hidden; }
.sm-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.sm-card-link:hover .sm-card-img img { transform: scale(1.03); }
.sm-card-ad.is-featured .sm-card-img { box-shadow: 0 0 0 2px var(--sm-accent); }
.sm-card-ad.is-sold .sm-card-img img { filter: grayscale(.8); opacity: .7; }
.sm-card-body { padding: .65rem .1rem 0; }
.sm-card-price { margin: 0; font-weight: 700; font-size: 1.08rem; color: var(--sm-ink); letter-spacing: -.01em; }
.sm-card-ad--job .sm-card-price { font-size: .95rem; color: var(--sm-brand-dark); }
.sm-card-title { margin: .15rem 0 .25rem; font-size: .95rem; font-weight: 500; line-height: 1.35; color: var(--sm-ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sm-card-link:hover .sm-card-title { text-decoration: underline; text-underline-offset: 2px; }
.sm-card-meta { margin: 0 0 .25rem; font-size: .82rem; color: var(--sm-muted); display: flex; flex-wrap: wrap; gap: 0 .9rem; }
.sm-card-meta span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.sm-card-shop { margin: 0 0 .2rem; font-size: .82rem; font-weight: 600; color: var(--sm-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-card-tick { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; border-radius: 50%; background: var(--sm-brand); color: #fff; font-size: .62rem; vertical-align: 1px; }
.sm-card-foot { margin: 0; display: flex; justify-content: space-between; gap: .5rem; font-size: .78rem; color: var(--sm-muted); }
.sm-card-foot span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-card-foot span:last-child { flex: 0 0 auto; }
.sm-tag { position: absolute; top: 8px; left: 8px; padding: .2rem .55rem; border-radius: 6px; font-size: .75rem; font-weight: 700; }
.sm-tag--featured { background: var(--sm-accent); color: #3a2c00; }
.sm-tag--sold { background: var(--sm-ink); color: #fff; }
.sm-save { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .94); color: var(--sm-ink); cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 3px rgba(28, 32, 36, .18); }
.sm-save.is-saved, .smt-save-btn.is-saved { color: #d23b4b !important; }
.sm-save.is-saved svg, .smt-save-btn.is-saved svg { fill: currentColor; }
.sm-noimg { display: flex; width: 100%; height: 100%; background: var(--sm-surface); }
.sm-noimg--job { background: var(--sm-brand-tint); }

/* Job cards without a photo: compact text card */
.sm-card-ad.is-textcard { border: 1px solid var(--sm-line); border-radius: var(--sm-radius); padding: 1rem; transition: border-color .15s; }
.sm-card-ad.is-textcard:hover { border-color: #c9ced4; }
.sm-card-ad.is-textcard .sm-card-body { padding: .8rem 0 0; }
.sm-card-ad.is-textcard .sm-save { top: 12px; right: 12px; box-shadow: none; background: var(--sm-surface); }
.sm-card-mono { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 10px; background: var(--sm-brand-tint); color: var(--sm-brand-dark); font-weight: 800; font-size: 1.2rem; }

/* Dashboard */
.sm-tabs { display: flex; gap: .2rem; border-bottom: 1px solid var(--sm-line); margin-bottom: 1.2rem; overflow-x: auto; }
.sm-tabs a { padding: .7rem 1rem; font-weight: 600; color: var(--sm-muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.sm-tabs a:hover { color: var(--sm-ink); }
.sm-tabs a.is-active { color: var(--sm-ink); border-color: var(--sm-brand); }
.sm-dash-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.sm-my-ads { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--sm-line); }
.sm-my-ad { display: flex; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--sm-line); }
.sm-my-ad-thumb { flex: 0 0 96px; height: 96px; border-radius: 10px; overflow: hidden; background: var(--sm-surface); }
.sm-my-ad-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sm-my-ad-body { flex: 1; min-width: 0; }
.sm-my-ad-body h3 { margin: .3rem 0 .15rem; font-size: 1rem; font-weight: 600; }
.sm-my-ad-body p { margin: .1rem 0; }
.sm-price { font-weight: 700; }
.sm-my-ad-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }
.sm-inline { display: inline; margin: 0; }
.sm-badge { display: inline-block; padding: .12rem .55rem; border-radius: 6px; font-size: .78rem; font-weight: 600; }
.sm-badge--live { background: #e6f4ed; color: #0d5a3d; }
.sm-badge--pending { background: #fff4d6; color: #6b5100; }
.sm-badge--expired, .sm-badge--other { background: #eef0f2; color: #4a5560; }
.sm-badge--rejected { background: #fbe9e9; color: #8a1f1f; }
.sm-badge--sold { background: var(--sm-ink); color: #fff; }
.sm-empty { text-align: center; padding: 2.5rem 1rem; color: var(--sm-muted); background: var(--sm-surface); border-radius: var(--sm-radius); }
.sm-profile { max-width: 480px; }

/* Shops (dashboard) */
.sm-shop-intro { margin-bottom: 1rem; }
.sm-shop-intro p { max-width: 62ch; }
.sm-shop-status { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.sm-shop-status h2 { margin: 0 0 .4rem; }
.sm-shop-status .sm-badge { margin-right: .3rem; }
.sm-shop-status-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.sm-shop-link { margin: 0 0 1.2rem; padding: 1rem; background: var(--sm-surface); border-radius: var(--sm-radius); }
.sm-shop-link label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .4rem; }
.sm-shop-link div { display: flex; gap: .5rem; }
.sm-shop-link input { flex: 1; min-width: 0; padding: .6rem .8rem; border: 1px solid var(--sm-line); border-radius: 10px; background: #fff; font: inherit; }
.sm-shop-form { max-width: 720px; }
.sm-shop-upload { display: flex; align-items: center; gap: .8rem; }
.sm-shop-upload input { font-size: .9rem; }
.sm-shop-logo-prev { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; }
.sm-shop-cover-prev { width: 120px; height: 56px; border-radius: 10px; object-fit: cover; }

/* Size / colour picker on product pages */
.sm-order-picker { margin: 0 0 .9rem; }
.sm-order-picker p { margin: 0 0 .4rem; font-weight: 600; font-size: .92rem; }
.sm-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: .8rem; }
.sm-chips label { cursor: pointer; }
.sm-chips input { position: absolute; opacity: 0; pointer-events: none; }
.sm-chips span { display: block; min-width: 44px; padding: .45rem .75rem; border: 1px solid #d5d9de; border-radius: 9px; text-align: center; font-weight: 600; font-size: .9rem; }
.sm-chips label:hover span { border-color: var(--sm-ink); }
.sm-chips input:checked + span { background: var(--sm-ink); border-color: var(--sm-ink); color: #fff; }
.sm-chips input:focus-visible + span { outline: 3px solid rgba(10, 122, 85, .35); outline-offset: 2px; }
.sm-chips--static span { font-weight: 500; }
.sm-order-note { color: var(--sm-danger); font-weight: 600; font-size: .9rem; margin: -.3rem 0 .6rem; }

/* Safety */
.sm-safety { max-width: 720px; }
.sm-safety li { margin-bottom: .45rem; }

.sm-tabs .sm-tabs-admin { background: var(--sm-brand-tint, #e8f4ef); color: var(--sm-brand-dark, #07603f); }

/* Privacy Policy and Terms of Use */
.sm-legal { max-width: 720px; line-height: 1.65; }
.sm-legal h2 { font-size: 1.2rem; margin: 2rem 0 .6rem; letter-spacing: -.01em; }
.sm-legal h3 { font-size: 1rem; margin: 1.2rem 0 .4rem; }
.sm-legal ul { padding-left: 1.2rem; }
.sm-legal li { margin-bottom: .45rem; }
.sm-legal-date { color: var(--sm-muted, #5e6670); font-size: .9rem; }
.sm-legal-contact { padding: 14px 16px; border: 1px solid var(--sm-line, #e6e8eb); border-radius: 12px; background: #fff; }
