/*
Theme Name: Rashu Maarukeytu
Theme URI: https://rashumaarukeytu.mv
Author: Rashu Maarukeytu
Description: Mobile-first community marketplace theme for every inhabited island in the Maldives. Pairs with the Rashu Marketplace plugin.
Version: 0.1.0
Requires PHP: 7.4
Text Domain: rashu-maarukeytu
*/

/* ---------------------------------------------------------------------- */
/* Reset + design tokens                                                   */
/* ---------------------------------------------------------------------- */

:root {
	--rm-bg: #f7faf9;
	--rm-fg: #12271f;
	--rm-surface: #ffffff;
	--rm-border: #e2ebe7;
	--rm-brand: #0e9f6e;
	--rm-brand-dark: #0b6e4f;
	--rm-brand-light: #e4f5ee;
	--rm-accent: #f59e0b;
	--rm-danger: #dc2626;
	--rm-muted: #5b6b64;
	--rm-radius: 12px;
	--rm-radius-sm: 8px;
	--rm-radius-full: 999px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--rm-bg);
	color: var(--rm-fg);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.5;
	padding-bottom: 64px;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

.rm-container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.rm-hide-mobile { display: none; }
.rm-hide-desktop { display: block; }
@media (min-width: 1024px) {
	.rm-hide-mobile { display: block; }
	.rm-hide-desktop { display: none; }
	body { padding-bottom: 0; }
}

/* ---------------------------------------------------------------------- */
/* Header                                                                   */
/* ---------------------------------------------------------------------- */

.rm-header { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,0.95); backdrop-filter: blur(6px); border-bottom: 1px solid var(--rm-border); }
.rm-header-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.rm-logo { font-weight: 800; font-size: 18px; color: var(--rm-brand-dark); white-space: nowrap; }
.rm-logo span { color: var(--rm-brand); }
.rm-location-pill { display: inline-flex; align-items: center; gap: 5px; background: var(--rm-brand-light); color: var(--rm-brand-dark); border-radius: var(--rm-radius-full); padding: 6px 12px; font-size: 12px; font-weight: 600; white-space: nowrap; max-width: 45vw; overflow: hidden; text-overflow: ellipsis; }
.rm-icon-btn { border: none; background: none; border-radius: 999px; padding: 8px; display: inline-flex; cursor: pointer; }
.rm-icon-btn:hover { background: var(--rm-brand-light); }
.rm-search-bar { display: flex; align-items: center; gap: 8px; background: var(--rm-surface); border: 1px solid var(--rm-border); border-radius: var(--rm-radius-full); padding: 9px 16px; flex: 1; }
.rm-search-bar input { border: none; background: none; outline: none; width: 100%; font-size: 14px; }
.rm-header-desktop { display: none; }
@media (min-width: 1024px) {
	.rm-header-desktop { display: flex; align-items: center; gap: 14px; padding: 10px 24px; max-width: 1200px; margin: 0 auto; }
	.rm-header-mobile { display: none; }
}
.rm-category-strip { display: none; }
@media (min-width: 1024px) {
	.rm-category-strip { display: flex; gap: 20px; overflow-x: auto; padding: 8px 24px; border-top: 1px solid var(--rm-border); max-width: 1200px; margin: 0 auto; font-size: 13px; color: var(--rm-muted); }
	.rm-category-strip a:hover { color: var(--rm-brand-dark); }
}

/* ---------------------------------------------------------------------- */
/* Bottom nav                                                               */
/* ---------------------------------------------------------------------- */

.rm-bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--rm-surface); border-top: 1px solid var(--rm-border); display: grid; grid-template-columns: repeat(5, 1fr); padding-bottom: env(safe-area-inset-bottom); }
@media (min-width: 1024px) { .rm-bottom-nav { display: none; } }
.rm-bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 0; font-size: 10px; font-weight: 600; color: var(--rm-muted); }
.rm-bottom-nav a.active { color: var(--rm-brand-dark); }
.rm-bottom-nav .rm-sell-btn { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 999px; background: var(--rm-brand); color: #fff; margin-bottom: 2px; }

/* ---------------------------------------------------------------------- */
/* Buttons + form controls                                                  */
/* ---------------------------------------------------------------------- */

.rm-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: var(--rm-radius-sm); padding: 10px 18px; font-size: 14px; font-weight: 600; cursor: pointer; border: 1px solid transparent; }
.rm-btn-primary { background: var(--rm-brand); color: #fff; }
.rm-btn-primary:hover { background: var(--rm-brand-dark); }
.rm-btn-outline { background: var(--rm-surface); border-color: var(--rm-border); color: var(--rm-fg); }
.rm-btn-outline:hover { background: var(--rm-brand-light); }
.rm-btn-danger { background: var(--rm-danger); color: #fff; }
.rm-btn-danger-outline { border-color: rgba(220,38,38,0.4); color: var(--rm-danger); background: none; }
.rm-btn-full { width: 100%; }
.rm-btn-sm { padding: 5px 12px; font-size: 12px; border-radius: var(--rm-radius-full); }
.rm-btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.rm-field { margin-bottom: 14px; }
.rm-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.rm-input, .rm-textarea, .rm-select {
	width: 100%; border: 1px solid var(--rm-border); border-radius: var(--rm-radius-sm);
	padding: 10px 12px; font-size: 14px; background: var(--rm-surface); outline: none;
}
.rm-input:focus, .rm-textarea:focus, .rm-select:focus { border-color: var(--rm-brand); }
.rm-hint { font-size: 12px; color: var(--rm-muted); margin-top: 4px; }
.rm-error { font-size: 13px; color: var(--rm-danger); margin-top: 6px; }

.rm-chip { display: inline-flex; align-items: center; gap: 4px; border-radius: var(--rm-radius-full); padding: 7px 14px; font-size: 12px; font-weight: 600; border: 1px solid var(--rm-border); background: var(--rm-surface); cursor: pointer; }
.rm-chip.active { border-color: var(--rm-brand); background: var(--rm-brand-light); color: var(--rm-brand-dark); }

/* ---------------------------------------------------------------------- */
/* Listing cards + grid                                                     */
/* ---------------------------------------------------------------------- */

.rm-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 16px; }
@media (min-width: 640px) { .rm-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .rm-grid { grid-template-columns: repeat(4, 1fr); padding: 16px 24px; } }
@media (min-width: 1280px) { .rm-grid { grid-template-columns: repeat(5, 1fr); } }

.rm-card { display: flex; flex-direction: column; background: var(--rm-surface); border: 1px solid var(--rm-border); border-radius: var(--rm-radius); overflow: hidden; }
.rm-card-image-wrap { position: relative; aspect-ratio: 4/3; background: var(--rm-brand-light); overflow: hidden; }
.rm-card-image-wrap img { width: 100%; height: 100%; object-fit: cover; }
.rm-card-badges { position: absolute; top: 6px; left: 6px; display: flex; gap: 4px; }
.rm-badge { background: rgba(20,20,20,0.85); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 4px; }
.rm-save-btn { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 999px; background: rgba(255,255,255,0.9); border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.rm-card-body { padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.rm-card-price { font-weight: 700; font-size: 15px; }
.rm-card-title { font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rm-card-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--rm-muted); margin-top: 4px; }
.rm-condition-tag { align-self: flex-start; background: var(--rm-bg); border-radius: 4px; padding: 2px 6px; font-size: 10px; color: var(--rm-muted); margin-top: 4px; }

/* ---------------------------------------------------------------------- */
/* Category shortcuts / grid                                                */
/* ---------------------------------------------------------------------- */

.rm-cat-shortcuts { display: flex; gap: 12px; overflow-x: auto; padding: 4px 16px 8px; }
@media (min-width: 1024px) { .rm-cat-shortcuts { display: none; } }
.rm-cat-shortcut { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 64px; flex-shrink: 0; text-align: center; }
.rm-cat-shortcut-icon { width: 48px; height: 48px; border-radius: 16px; background: var(--rm-brand-light); color: var(--rm-brand-dark); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.rm-cat-shortcut-label { font-size: 11px; line-height: 1.2; }
.rm-cat-shortcut-count { font-size: 10px; color: var(--rm-muted); }

.rm-cat-full-grid { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 16px; }
@media (min-width: 640px) { .rm-cat-full-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .rm-cat-full-grid { grid-template-columns: repeat(3, 1fr); padding: 16px 24px; } }
.rm-cat-full-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--rm-border); border-radius: var(--rm-radius); background: var(--rm-surface); }
.rm-cat-full-row:hover { background: var(--rm-brand-light); }

/* ---------------------------------------------------------------------- */
/* Misc components                                                          */
/* ---------------------------------------------------------------------- */

.rm-page { padding: 16px; max-width: 1200px; margin: 0 auto; }
.rm-page-narrow { max-width: 480px; margin: 0 auto; padding: 24px 16px; }
.rm-h1 { font-size: 20px; font-weight: 800; }
@media (min-width: 1024px) { .rm-h1 { font-size: 26px; } }
.rm-muted { color: var(--rm-muted); font-size: 13px; }

.rm-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 48px 24px; text-align: center; border: 1px dashed var(--rm-border); border-radius: var(--rm-radius); background: var(--rm-surface); }

.rm-filter-row { display: flex; align-items: center; gap: 8px; overflow-x: auto; padding: 0 16px 8px; }
@media (min-width: 1024px) { .rm-filter-row { padding: 0 24px 8px; } }

.rm-modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 1024px) { .rm-modal-backdrop { align-items: center; } }
.rm-modal-sheet { background: var(--rm-surface); border-radius: 16px 16px 0 0; padding: 20px; width: 100%; max-width: 480px; max-height: 85vh; overflow-y: auto; }
@media (min-width: 1024px) { .rm-modal-sheet { border-radius: 16px; } }

.rm-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 0 16px; }
.rm-tab { flex-shrink: 0; border-radius: var(--rm-radius-full); padding: 7px 14px; font-size: 12px; font-weight: 600; border: 1px solid var(--rm-border); background: var(--rm-surface); }
.rm-tab.active { border-color: var(--rm-brand); background: var(--rm-brand-light); color: var(--rm-brand-dark); }

.rm-seller-row { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--rm-border); border-radius: var(--rm-radius); background: var(--rm-surface); }
.rm-avatar { width: 44px; height: 44px; border-radius: 999px; background: var(--rm-brand-light); color: var(--rm-brand-dark); display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }

.rm-gallery-main { position: relative; aspect-ratio: 4/3; border-radius: var(--rm-radius); overflow: hidden; background: var(--rm-brand-light); }
.rm-gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.rm-gallery-thumbs { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; }
.rm-gallery-thumbs img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 2px solid transparent; cursor: pointer; }
.rm-gallery-thumbs img.active { border-color: var(--rm-brand); }

.rm-wizard-progress { display: flex; gap: 4px; margin-bottom: 20px; }
.rm-wizard-progress span { height: 4px; flex: 1; border-radius: 999px; background: var(--rm-border); }
.rm-wizard-progress span.done { background: var(--rm-brand); }
.rm-wizard-step-option { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; border: 1px solid var(--rm-border); border-radius: var(--rm-radius); padding: 12px 16px; width: 100%; background: var(--rm-surface); text-align: left; cursor: pointer; }
.rm-wizard-step-option.selected { border-color: var(--rm-brand); background: var(--rm-brand-light); }
.rm-wizard-step-option strong { font-size: 14px; }
.rm-wizard-step-option small { color: var(--rm-muted); font-size: 12px; }

.rm-photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (min-width: 640px) { .rm-photo-grid { grid-template-columns: repeat(4, 1fr); } }
.rm-photo-tile { position: relative; aspect-ratio: 1; border-radius: var(--rm-radius-sm); overflow: hidden; border: 1px solid var(--rm-border); }
.rm-photo-tile img { width: 100%; height: 100%; object-fit: cover; }
.rm-photo-add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; aspect-ratio: 1; border-radius: var(--rm-radius-sm); border: 2px dashed var(--rm-border); color: var(--rm-muted); cursor: pointer; background: none; }
.rm-photo-remove { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,0.6); color: #fff; border: none; border-radius: 999px; width: 20px; height: 20px; font-size: 11px; cursor: pointer; }
.rm-photo-cover-badge { position: absolute; top: 4px; left: 4px; background: var(--rm-brand); color: #fff; font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 3px; }

.rm-toast { position: fixed; bottom: 76px; left: 50%; transform: translateX(-50%); background: #1a1a1a; color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 13px; z-index: 60; }

.rm-otp-box { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.4); border-radius: var(--rm-radius-sm); padding: 10px 12px; font-size: 12px; margin-bottom: 12px; }
.rm-otp-code { font-family: monospace; font-size: 16px; letter-spacing: 2px; }

.rm-safety-note { display: flex; gap: 8px; background: var(--rm-brand-light); color: var(--rm-brand-dark); border-radius: var(--rm-radius-sm); padding: 10px 12px; font-size: 12px; margin-bottom: 12px; }

table.rm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.rm-table th, table.rm-table td { text-align: left; padding: 8px; border-bottom: 1px solid var(--rm-border); }
