/**
 * Electrical Marketplace — frontend styles.
 * Brand: Manrope, button #ffe1b8 (text #000), heading colour #c84e18.
 */

:root {
    --em-brand: #c84e18;
    --em-brand-dark: #a63f12;
    --em-btn-bg: #ffe1b8;
    --em-btn-text: #000;
    --em-text: #1a1a1a;
    --em-muted: #6b7280;
    --em-bg: #ffffff;
    --em-bg-alt: #faf6f1;
    --em-border: #e7e2da;
    --em-radius: 12px;
    --em-radius-sm: 8px;
    --em-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
    --em-shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.10);
    --em-container: 1200px;
    --em-font: 'Manrope', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--em-font);
    color: var(--em-text);
    background: var(--em-bg);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; height: auto; display: block; }

a { color: var(--em-brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.em-container { max-width: var(--em-container); margin: 0 auto; padding: 0 20px; }

/* Headings */
.em-h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; color: var(--em-brand); margin: 0 0 16px; letter-spacing: -0.02em; }
.em-h2 { font-size: clamp(22px, 3vw, 30px); font-weight: 700; color: var(--em-brand); margin: 0 0 16px; letter-spacing: -0.015em; }
.em-h3 { font-size: 20px; font-weight: 700; color: var(--em-brand); margin: 24px 0 12px; }

.em-prose p { margin: 0 0 1em; }
.em-prose ul { padding-left: 1.25em; }

/* Buttons */
.em-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    background: var(--em-btn-bg); color: var(--em-btn-text);
    border: 1px solid transparent; border-radius: 999px;
    padding: 12px 22px; font-family: inherit; font-weight: 700; font-size: 15px;
    cursor: pointer; line-height: 1; text-decoration: none;
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.em-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(200, 78, 24, 0.15); text-decoration: none; }
.em-btn:active { transform: translateY(0); }
.em-btn--primary { background: var(--em-btn-bg); color: var(--em-btn-text); }
.em-btn--ghost   { background: transparent; color: var(--em-text); border-color: var(--em-border); }
.em-btn--danger  { background: #fff; color: #b91c1c; border-color: #fecaca; }
.em-btn--sm { padding: 8px 14px; font-size: 13px; }
.em-btn--lg { padding: 16px 28px; font-size: 16px; }
.em-btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

/* Header */
.em-header { background: #fff; border-bottom: 1px solid var(--em-border); position: sticky; top: 0; z-index: 50; }
.em-header__inner { display: flex; align-items: center; gap: 18px; padding: 16px 0; }
.em-logo { display: inline-flex; align-items: center; gap: 8px; color: var(--em-brand); font-weight: 800; font-size: 18px; }
.em-logo:hover { text-decoration: none; }
.em-logo__mark { background: var(--em-brand); color: #fff; width: 32px; height: 32px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }
.em-search { flex: 1; max-width: 540px; display: flex; border: 1px solid var(--em-border); border-radius: 999px; overflow: hidden; background: #fff; }
.em-search input { flex: 1; border: 0; padding: 10px 16px; font-family: inherit; font-size: 14px; outline: none; background: transparent; }
.em-search button { border: 0; background: var(--em-brand); color: #fff; padding: 0 16px; cursor: pointer; }
.em-header__actions { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.em-header__link { color: var(--em-text); font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.em-header__link:hover { color: var(--em-brand); text-decoration: none; }
.em-header__phone { color: var(--em-brand); }
.em-header__cart { position: relative; color: var(--em-text); }
.em-header__cart:hover { color: var(--em-brand); }
.em-header__cart-count {
    position: absolute; top: -6px; right: -8px;
    background: var(--em-brand); color: #fff; font-size: 11px; font-weight: 700;
    border-radius: 999px; min-width: 18px; height: 18px;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0 5px;
}
.em-subnav { background: var(--em-bg-alt); border-bottom: 1px solid var(--em-border); }
.em-subnav__inner { display: flex; gap: 4px; overflow-x: auto; padding: 8px 0; }
.em-subnav__item { color: var(--em-text); font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: 999px; white-space: nowrap; }
.em-subnav__item:hover { background: #fff; text-decoration: none; }
.em-subnav__item--cta { background: var(--em-btn-bg); color: var(--em-btn-text); }

/* Footer */
.em-footer { background: #1f1611; color: #d6cfc7; margin-top: 80px; }
.em-footer__inner { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; padding: 60px 20px; max-width: var(--em-container); margin: 0 auto; }
.em-footer h4 { color: #fff; margin: 0 0 12px; font-size: 14px; text-transform: uppercase; letter-spacing: .08em; }
.em-footer ul { list-style: none; padding: 0; margin: 0; }
.em-footer li { margin: 8px 0; }
.em-footer a { color: #d6cfc7; }
.em-footer a:hover { color: #fff; }
.em-footer__bottom { border-top: 1px solid #2c211a; padding: 16px 20px; }
@media (max-width: 768px) { .em-footer__inner { grid-template-columns: 1fr 1fr; } }

/* Sections */
.em-section { padding: 60px 0; }
.em-section--alt { background: var(--em-bg-alt); }
.em-section--cta { padding: 40px 0; }

/* Hero */
.em-hero { background: linear-gradient(135deg, #fff7ec, #fce4cf); padding: 80px 0; }
.em-hero__inner { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: center; }
.em-hero__title { font-size: clamp(32px, 5vw, 52px); font-weight: 800; color: var(--em-brand); margin: 0 0 16px; letter-spacing: -0.02em; line-height: 1.1; }
.em-hero__sub { font-size: 18px; color: #4b3a2e; max-width: 540px; margin: 0 0 28px; }
.em-hero__ctas { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.em-hero__bullets { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; color: #4b3a2e; font-weight: 600; }
.em-hero__bullets li::before { content: "✓"; color: var(--em-brand); margin-right: 8px; font-weight: 800; }
.em-hero__art { display: flex; align-items: center; justify-content: center; }
.em-hero__bolt { font-size: 200px; line-height: 1; opacity: .9; }
@media (max-width: 768px) { .em-hero__inner { grid-template-columns: 1fr; } .em-hero__art { display: none; } }

/* Categories grid */
.em-cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.em-cat-card {
    display: flex; align-items: center; justify-content: center; min-height: 90px; padding: 14px;
    background: #fff; border: 1px solid var(--em-border); border-radius: var(--em-radius);
    color: var(--em-text); font-weight: 700; text-align: center;
    transition: border-color .15s, transform .15s, box-shadow .15s;
}
.em-cat-card:hover { border-color: var(--em-brand); color: var(--em-brand); transform: translateY(-2px); box-shadow: var(--em-shadow); text-decoration: none; }

/* Service grid + card */
.em-svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.em-svc-card { background: #fff; border: 1px solid var(--em-border); border-radius: var(--em-radius); overflow: hidden; transition: transform .15s, box-shadow .15s; display: flex; flex-direction: column; }
.em-svc-card:hover { transform: translateY(-2px); box-shadow: var(--em-shadow-lg); }
.em-svc-card__media { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--em-bg-alt); }
.em-svc-card__media img { width: 100%; height: 100%; object-fit: cover; }
.em-svc-card__placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 56px; color: var(--em-brand); opacity: .35; }
.em-svc-card__placeholder--lg { font-size: 120px; }
.em-svc-card__body { padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.em-svc-card__cat { font-size: 12px; font-weight: 700; color: var(--em-brand); text-transform: uppercase; letter-spacing: .05em; }
.em-svc-card__title { font-size: 16px; font-weight: 700; margin: 0; }
.em-svc-card__title a { color: var(--em-text); }
.em-svc-card__title a:hover { color: var(--em-brand); text-decoration: none; }
.em-svc-card__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; }
.em-svc-card__price { font-size: 18px; font-weight: 800; color: var(--em-text); }
.em-svc-card__price--quote { font-size: 14px; color: var(--em-muted); font-weight: 600; }

/* Catalogue layout */
.em-page-head { margin-bottom: 28px; }
.em-catalog { display: grid; grid-template-columns: 220px 1fr; gap: 32px; }
.em-catalog__sidebar h3 { margin-top: 0; }
.em-cat-list { list-style: none; padding: 0; margin: 0; }
.em-cat-list a { display: block; padding: 8px 12px; border-radius: var(--em-radius-sm); color: var(--em-text); font-weight: 600; }
.em-cat-list a:hover { background: var(--em-bg-alt); text-decoration: none; }
.em-cat-list a.is-active { background: var(--em-brand); color: #fff; }
@media (max-width: 768px) { .em-catalog { grid-template-columns: 1fr; } }

/* Pagination */
.em-pagination { display: flex; gap: 6px; margin-top: 28px; flex-wrap: wrap; }
.em-pagination__item { padding: 8px 12px; border: 1px solid var(--em-border); border-radius: var(--em-radius-sm); color: var(--em-text); font-weight: 600; }
.em-pagination__item.is-current { background: var(--em-brand); color: #fff; border-color: var(--em-brand); }

/* How-it-works steps */
.em-steps { list-style: none; padding: 0; margin: 0; counter-reset: em-step; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.em-steps li { background: #fff; padding: 22px; border-radius: var(--em-radius); border: 1px solid var(--em-border); position: relative; }
.em-steps li::before { counter-increment: em-step; content: counter(em-step); display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 999px; background: var(--em-btn-bg); color: var(--em-btn-text); font-weight: 800; margin-bottom: 10px; }
.em-steps strong { display: block; color: var(--em-brand); margin-bottom: 6px; }
.em-steps span { color: var(--em-muted); }

/* CTA banner */
.em-cta-banner { background: var(--em-brand); color: #fff; padding: 40px; border-radius: var(--em-radius); display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.em-cta-banner h2 { color: #fff; margin: 0 0 6px; }
.em-cta-banner p { margin: 0; opacity: .9; }

/* Service detail */
.em-breadcrumbs { display: flex; gap: 6px; align-items: center; color: var(--em-muted); font-size: 13px; margin-bottom: 18px; flex-wrap: wrap; }
.em-breadcrumbs a { color: var(--em-muted); }
.em-breadcrumbs a:hover { color: var(--em-brand); }
.em-svc-detail { display: grid; grid-template-columns: 1fr 1.1fr; gap: 40px; }
.em-svc-detail__media { background: var(--em-bg-alt); border-radius: var(--em-radius); overflow: hidden; aspect-ratio: 4/3; }
.em-svc-detail__media img { width: 100%; height: 100%; object-fit: cover; }
.em-svc-detail__price-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin: 16px 0 24px; }
.em-svc-detail__price { font-size: 32px; font-weight: 800; color: var(--em-brand); }
.em-svc-detail__price--quote { font-size: 18px; color: var(--em-muted); font-weight: 600; }
.em-svc-detail__perks { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-direction: column; gap: 8px; }
.em-svc-detail__perks li::before { content: "✓"; color: var(--em-brand); margin-right: 8px; font-weight: 800; }
@media (max-width: 768px) { .em-svc-detail { grid-template-columns: 1fr; } }

/* Cart */
.em-cart { background: #fff; }
.em-cart__items { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--em-border); }
.em-cart__item { display: grid; grid-template-columns: 80px 1fr auto auto auto; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--em-border); align-items: center; }
.em-cart__item-thumb { width: 80px; height: 80px; border-radius: var(--em-radius-sm); background: var(--em-bg-alt); overflow: hidden; }
.em-cart__item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.em-cart__item-title { font-weight: 700; }
.em-cart__qty { display: inline-flex; align-items: center; gap: 8px; }
.em-cart__qty button { width: 28px; height: 28px; border: 1px solid var(--em-border); background: #fff; border-radius: 6px; cursor: pointer; font-weight: 700; }
.em-cart__remove { background: none; border: 0; color: #b91c1c; cursor: pointer; font-weight: 600; }
.em-cart__totals { padding: 24px 0; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.em-cart__total { font-size: 22px; font-weight: 800; color: var(--em-brand); }
.em-cart__actions { display: flex; gap: 10px; justify-content: flex-end; }

/* Checkout */
.em-checkout__grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; }
.em-checkout__form input, .em-checkout__form textarea, .em-form input, .em-form textarea, .em-form select {
    width: 100%; padding: 11px 14px; border: 1px solid var(--em-border); border-radius: var(--em-radius-sm);
    font-family: inherit; font-size: 14px; background: #fff;
}
.em-checkout__form input:focus, .em-checkout__form textarea:focus, .em-form input:focus, .em-form textarea:focus, .em-form select:focus { border-color: var(--em-brand); outline: none; box-shadow: 0 0 0 3px rgba(200, 78, 24, 0.15); }
.em-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.em-checkout__form label, .em-form label { display: block; font-weight: 600; font-size: 14px; }
.em-checkout__form label > input, .em-checkout__form label > textarea, .em-form label > input, .em-form label > textarea, .em-form label > select { margin-top: 6px; font-weight: 400; }
.em-checkout__summary { background: var(--em-bg-alt); padding: 24px; border-radius: var(--em-radius); align-self: start; position: sticky; top: 100px; }
.em-summary-row { display: flex; justify-content: space-between; padding: 8px 0; }
.em-summary-row--total { border-top: 1px solid var(--em-border); margin-top: 8px; padding-top: 14px; font-weight: 800; font-size: 18px; color: var(--em-brand); }
.em-gdpr label { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.em-gdpr input { width: auto; margin-top: 4px; }
.em-checkout__error { color: #b91c1c; font-weight: 600; margin-top: 12px; }
@media (max-width: 768px) { .em-checkout__grid { grid-template-columns: 1fr; } .em-grid-2 { grid-template-columns: 1fr; } }

/* Thanks */
.em-thanks { text-align: center; max-width: 600px; margin: 0 auto; }
.em-thanks__icon { width: 80px; height: 80px; border-radius: 999px; background: #d1fae5; color: #047857; font-size: 40px; font-weight: 800; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; }
.em-thanks__sub { color: var(--em-muted); }
.em-thanks__cta { display: flex; gap: 12px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }

/* Auth pages */
.em-auth { max-width: 480px; margin: 0 auto; }
.em-auth__sub { color: var(--em-muted); margin-bottom: 24px; }
.em-auth__alt { margin-top: 18px; color: var(--em-muted); text-align: center; }
.em-form p { margin: 0 0 14px; }
.em-form__msg { padding: 12px; border-radius: var(--em-radius-sm); font-weight: 600; }
.em-form__msg.is-error { background: #fef2f2; color: #b91c1c; }
.em-form__msg.is-success { background: #ecfdf5; color: #047857; }
.em-form--narrow { max-width: 600px; }

/* Quote */
.em-quote__intro { color: var(--em-muted); margin-bottom: 24px; }

/* Notices */
.em-notice { padding: 14px 16px; border-radius: var(--em-radius-sm); margin-bottom: 20px; font-size: 14px; }
.em-notice--warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.em-notice--info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* Dashboard */
.em-dash__head { display: flex; flex-direction: column; gap: 14px; margin-bottom: 24px; }
.em-dash__nav { display: flex; gap: 4px; border-bottom: 1px solid var(--em-border); overflow-x: auto; }
.em-dash__tab { padding: 12px 18px; color: var(--em-text); font-weight: 600; border-bottom: 2px solid transparent; }
.em-dash__tab:hover { color: var(--em-brand); text-decoration: none; }
.em-dash__tab.is-active { color: var(--em-brand); border-bottom-color: var(--em-brand); }
.em-dash__pane { display: none; }
.em-dash__pane.is-active { display: block; }
.em-dash__filters { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.em-dash__filters input, .em-dash__filters select { padding: 10px 14px; border: 1px solid var(--em-border); border-radius: var(--em-radius-sm); font-family: inherit; font-size: 14px; }

/* Job list */
.em-jobs-list { display: grid; gap: 14px; }
.em-job { background: #fff; border: 1px solid var(--em-border); border-radius: var(--em-radius); padding: 18px; display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: start; }
.em-job__title { font-weight: 700; font-size: 16px; margin: 0 0 6px; color: var(--em-text); }
.em-job__meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--em-muted); font-size: 13px; margin-bottom: 8px; }
.em-job__meta strong { color: var(--em-text); }
.em-job__desc { color: var(--em-text); font-size: 14px; margin: 0 0 8px; }
.em-job__price { font-size: 20px; font-weight: 800; color: var(--em-brand); text-align: right; }
.em-job__cta { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.em-job__contact { font-size: 13px; color: var(--em-text); background: var(--em-bg-alt); padding: 8px 12px; border-radius: var(--em-radius-sm); }
.em-job__contact strong { color: var(--em-brand); }

/* Orders list (account) */
.em-orders { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.em-order { background: #fff; border: 1px solid var(--em-border); border-radius: var(--em-radius); padding: 16px 18px; }
.em-order__head { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.em-order__id { font-weight: 800; }
.em-order__date { color: var(--em-muted); font-size: 13px; }
.em-order__total { margin-left: auto; font-weight: 800; color: var(--em-brand); }
.em-order__items { list-style: none; padding: 0; margin: 0; color: var(--em-text); }
.em-order__items li { padding: 4px 0; }

/* Badges */
.em-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.em-badge--pending,    .em-badge--available, .em-badge--awaiting_payment { background: #fef3c7; color: #92400e; }
.em-badge--approved,   .em-badge--paid,      .em-badge--completed        { background: #d1fae5; color: #065f46; }
.em-badge--assigned,   .em-badge--accepted   { background: #dbeafe; color: #1e40af; }
.em-badge--rejected,   .em-badge--cancelled, .em-badge--refunded         { background: #fee2e2; color: #991b1b; }
.em-badge--suspended { background: #f3f4f6; color: #4b5563; }

/* States */
.em-loading { color: var(--em-muted); padding: 20px; text-align: center; }
.em-empty   { color: var(--em-muted); padding: 24px; background: var(--em-bg-alt); border-radius: var(--em-radius); text-align: center; }

/* Klarna iframe wrapper */
.em-klarna-wrap { margin-top: 16px; padding: 16px; background: var(--em-bg-alt); border-radius: var(--em-radius); }
