/**
 * TreguPlus Frontend — marketplace styles.
 * Scoped under .tpf-wrap so nothing here can leak into / override
 * Classima's own theme styles; we only style our own markup.
 */

.tpf-wrap { max-width: 1200px; margin: 0 auto; padding: 24px 16px 64px; }
.tpf-wrap a { text-decoration: none; }
.tpf-wrap * { box-sizing: border-box; }

/* Buttons */
.tpf-btn { display: inline-block; padding: 10px 18px; border-radius: 6px; border: 1px solid #d0d5dd; background: #fff; color: #1a1a1a; cursor: pointer; font-size: 14px; line-height: 1.2; }
.tpf-btn:hover { border-color: #98a2b3; }
.tpf-btn-primary { background: #1a56db; border-color: #1a56db; color: #fff; }
.tpf-btn-primary:hover { background: #1544ad; }
.tpf-btn-secondary { background: #111827; border-color: #111827; color: #fff; }
.tpf-btn-danger { color: #b42318; border-color: #fda29b; }
.tpf-btn-small { padding: 6px 10px; font-size: 12px; }
.tpf-btn-block { display: block; width: 100%; text-align: center; margin-top: 8px; }

/* Notices */
.tpf-notice { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; }
.tpf-notice-success { background: #ecfdf3; color: #027a48; border: 1px solid #abefc6; }
.tpf-notice-error { background: #fef3f2; color: #b42318; border: 1px solid #fda29b; }
.tpf-notice-warning { background: #fffaeb; color: #b54708; border: 1px solid #fec84b; }

/* Hero / search bar */
.tpf-hero { text-align: center; padding: 48px 0 32px; }
.tpf-hero-title { font-size: 32px; margin-bottom: 20px; }
.tpf-search-bar { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 12px; }
.tpf-search-input { flex: 1 1 260px; padding: 10px 12px; border: 1px solid #d0d5dd; border-radius: 6px; }
.tpf-search-select { padding: 10px 12px; border: 1px solid #d0d5dd; border-radius: 6px; }
.tpf-hero-cta { margin-top: 8px; }

/* Sections */
.tpf-section { margin: 40px 0; }
.tpf-section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.tpf-category-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tpf-chip { padding: 6px 14px; border-radius: 999px; background: #f2f4f7; color: #344054; font-size: 13px; }
.tpf-chip.is-active { background: #1a56db; color: #fff; }
.tpf-chip-count { opacity: .65; font-size: 12px; margin-left: 2px; }

/* Grid / cards */
.tpf-listings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.tpf-listings-grid.tpf-layout-list { grid-template-columns: 1fr; }
.tpf-card { position: relative; border: 1px solid #eaecf0; border-radius: 10px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.tpf-layout-list .tpf-card { flex-direction: row; }
.tpf-card-media { display: block; aspect-ratio: 4/3; overflow: hidden; background: #f2f4f7; }
.tpf-layout-list .tpf-card-media { width: 200px; flex-shrink: 0; aspect-ratio: auto; }
.tpf-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tpf-card-type-badge { position: absolute; top: 8px; left: 8px; background: #111827; color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 4px; }
.tpf-card-body { padding: 12px; flex: 1; }
.tpf-card-title { display: block; font-weight: 600; color: #101828; margin-bottom: 4px; }
.tpf-card-category { display: inline-block; font-size: 12px; color: #1a56db; text-decoration: none; margin-bottom: 4px; }
.tpf-card-category:hover { text-decoration: underline; }
.tpf-card-price { color: #1a56db; font-weight: 700; margin-bottom: 6px; }
.tpf-card-meta { display: flex; justify-content: space-between; font-size: 12px; color: #667085; }
.tpf-favorite-btn { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 50%; border: none; background: rgba(255,255,255,.9); cursor: pointer; font-size: 16px; color: #98a2b3; }
.tpf-favorite-btn.is-active { color: #e0245e; }

.tpf-empty-state { text-align: center; padding: 48px 16px; color: #667085; }
.tpf-empty-state .tpf-btn { margin-top: 12px; }

/* Listings/search page */
.tpf-listings-layout { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: start; }
.tpf-filters-form { display: flex; flex-direction: column; gap: 14px; border: 1px solid #eaecf0; border-radius: 10px; padding: 16px; }
.tpf-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #344054; }
.tpf-field input, .tpf-field select, .tpf-field textarea { padding: 8px 10px; border: 1px solid #d0d5dd; border-radius: 6px; font-size: 14px; }
.tpf-field-row { display: flex; gap: 10px; }
.tpf-field-row-wrap { flex-wrap: wrap; }
.tpf-field-row .tpf-field { flex: 1; }
.tpf-results-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.tpf-results-title { margin: 0; }
.tpf-results-count { color: #667085; font-size: 13px; }
.tpf-toolbar-controls { display: flex; gap: 8px; align-items: center; }
.tpf-layout-toggle { border: 1px solid #d0d5dd; padding: 6px 10px; border-radius: 6px; color: #344054; }
.tpf-layout-toggle.is-active { background: #1a56db; color: #fff; border-color: #1a56db; }
.tpf-pagination { display: flex; gap: 6px; justify-content: center; margin-top: 24px; }
.tpf-page-link { padding: 6px 12px; border: 1px solid #d0d5dd; border-radius: 6px; }
.tpf-page-link.is-current { background: #1a56db; color: #fff; border-color: #1a56db; }

/* Single listing */
.tpf-breadcrumb { font-size: 13px; color: #667085; margin-bottom: 16px; }
.tpf-single-layout { display: grid; grid-template-columns: 1fr 320px; gap: 32px; align-items: start; }
.tpf-gallery-main img, .tpf-gallery-main { width: 100%; border-radius: 10px; aspect-ratio: 4/3; object-fit: cover; background: #f2f4f7; }
.tpf-gallery-thumbs { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.tpf-gallery-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; cursor: pointer; border: 2px solid transparent; }
.tpf-gallery-thumb:hover { border-color: #1a56db; }
.tpf-single-title { font-size: 26px; margin: 16px 0 4px; }
.tpf-single-price { font-size: 22px; color: #1a56db; font-weight: 700; margin-bottom: 12px; }
.tpf-single-meta-row { display: flex; gap: 16px; flex-wrap: wrap; color: #667085; font-size: 13px; margin-bottom: 16px; }
.tpf-single-actions { display: flex; gap: 8px; margin-bottom: 24px; }
.tpf-specs-table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.tpf-specs-table th, .tpf-specs-table td { text-align: left; padding: 8px 4px; border-bottom: 1px solid #eaecf0; font-size: 14px; }
.tpf-specs-table th { width: 40%; color: #667085; font-weight: 500; }
.tpf-seller-card { border: 1px solid #eaecf0; border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.tpf-contact-list { list-style: none; margin: 8px 0; padding: 0; font-size: 14px; }
.tpf-owner-actions { display: flex; flex-direction: column; gap: 8px; }

/* Badges */
.tpf-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.tpf-badge-draft { background: #f2f4f7; color: #344054; }
.tpf-badge-pending { background: #fffaeb; color: #b54708; }
.tpf-badge-approved { background: #ecfdf3; color: #027a48; }
.tpf-badge-rejected { background: #fef3f2; color: #b42318; }
.tpf-badge-expired, .tpf-badge-archived { background: #f2f4f7; color: #667085; }
.tpf-badge-sold { background: #eff8ff; color: #175cd3; }

/* Dashboard */
.tpf-dashboard-layout { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
.tpf-dashboard-nav { display: flex; flex-direction: column; gap: 4px; border: 1px solid #eaecf0; border-radius: 10px; padding: 8px; }
.tpf-dashboard-nav-link { padding: 10px 12px; border-radius: 6px; color: #344054; }
.tpf-dashboard-nav-link.is-active { background: #eff4ff; color: #1a56db; font-weight: 600; }
.tpf-logout-link { margin-top: 8px; border-top: 1px solid #eaecf0; padding-top: 12px; color: #b42318; }
.tpf-dashboard-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 24px; }
.tpf-dash-card { border: 1px solid #eaecf0; border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.tpf-dash-card-value { font-size: 24px; font-weight: 700; }
.tpf-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.tpf-table th, .tpf-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #eaecf0; font-size: 14px; }
.tpf-row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.tpf-inline-form { display: inline; }
.tpf-rejection-reason { font-size: 12px; color: #b42318; margin-top: 4px; }
.tpf-my-listings-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }

/* Auth */
.tpf-auth-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.tpf-auth-panel { border: 1px solid #eaecf0; border-radius: 10px; padding: 20px; }
.tpf-auth-panel p { margin: 0 0 12px; }
.tpf-auth-panel label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.tpf-auth-panel input[type=text], .tpf-auth-panel input[type=email], .tpf-auth-panel input[type=password] { padding: 8px 10px; border: 1px solid #d0d5dd; border-radius: 6px; margin-top: 4px; }

/* ---------------- Password visibility toggle (Module 06) ---------------- */
.tpf-password-wrap { position: relative; display: block; margin-top: 4px; }
.tpf-password-wrap input[type=password],
.tpf-password-wrap input[type=text] { width: 100%; padding-right: 40px; margin-top: 0; }
.tpf-password-toggle {
	position: absolute;
	top: 50%;
	right: 4px;
	transform: translateY(-50%);
	background: none;
	border: none;
	cursor: pointer;
	font-size: 15px;
	line-height: 1;
	padding: 6px;
	opacity: .55;
}
.tpf-password-toggle:hover, .tpf-password-toggle[aria-pressed="true"] { opacity: 1; }
.tpf-checkbox { display: flex; align-items: center; gap: 6px; font-size: 13px; }

/* Wizard */
.tpf-wizard-progress { display: flex; list-style: none; padding: 0; margin: 24px 0; gap: 8px; }
.tpf-wizard-progress li { flex: 1; text-align: center; padding: 10px 4px; border-bottom: 3px solid #eaecf0; color: #98a2b3; font-size: 13px; }
.tpf-wizard-progress li.is-active { border-color: #1a56db; color: #1a56db; font-weight: 600; }
.tpf-wizard-progress li.is-done { border-color: #12b76a; color: #12b76a; }
.tpf-wizard-step-num { display: inline-block; width: 20px; height: 20px; border-radius: 50%; background: currentColor; color: #fff !important; line-height: 20px; margin-right: 4px; font-size: 11px; }
.tpf-wizard-form { max-width: 640px; }
.tpf-wizard-actions { display: flex; gap: 10px; margin-top: 20px; }
.tpf-media-dropzone { border: 2px dashed #d0d5dd; border-radius: 10px; padding: 24px; text-align: center; display: flex; gap: 10px; align-items: center; justify-content: center; }
.tpf-media-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.tpf-media-item { position: relative; width: 96px; height: 96px; border-radius: 8px; overflow: hidden; border: 2px solid transparent; }
.tpf-media-item.is-primary { border-color: #1a56db; }
.tpf-media-item img { width: 100%; height: 100%; object-fit: cover; }
.tpf-media-primary-tag { display: none; position: absolute; bottom: 2px; left: 2px; background: #1a56db; color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 4px; }
.tpf-media-item.is-primary .tpf-media-primary-tag { display: block; }
.tpf-media-remove { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; border: none; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; line-height: 1; }
.tpf-review-media { display: flex; gap: 8px; margin: 16px 0; flex-wrap: wrap; }
.tpf-review-media img { width: 88px; height: 88px; object-fit: cover; border-radius: 8px; }

/* Modal */
.tpf-modal { position: fixed; inset: 0; background: rgba(16,24,40,.6); display: flex; align-items: center; justify-content: center; z-index: 9999; }
.tpf-modal[hidden] { display: none; }
.tpf-modal-inner { background: #fff; border-radius: 10px; padding: 24px; max-width: 420px; width: 90%; position: relative; }
.tpf-modal-close { position: absolute; top: 8px; right: 12px; background: none; border: none; font-size: 22px; cursor: pointer; }

.tpf-muted { color: #667085; font-size: 13px; }

@media (max-width: 782px) {
	.tpf-listings-layout, .tpf-single-layout, .tpf-dashboard-layout, .tpf-auth-panels { grid-template-columns: 1fr; }
}
