/* =====================================================
   SUNLINE — FEATURES
   Quote list · Compare · Calculator · Search · Warranty · Projects · Map
   Uses logical properties (inline-start/end) so RTL works automatically.
===================================================== */

.screen-reader-text {
    position: absolute !important; width: 1px; height: 1px; overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.sl-hp { position: absolute !important; inset-inline-start: -9999px; width: 1px; height: 1px; opacity: 0; }
.is-disabled { opacity: .5; pointer-events: none; }

/* ─── Header quote icon ─────────────────────────────── */
.nav__quote {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,.35); color: #fff; font-size: 1.1rem;
}
.nav__quote:hover { border-color: var(--primary); background: rgba(249,115,22,.15); }
.nav__quote-count {
    position: absolute; top: -6px; inset-inline-end: -6px;
    min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
    background: var(--primary); color: #fff; font-size: .7rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center; line-height: 1;
}
.nav__quote-count[hidden] { display: none; }
.nav__quote-count.bump { animation: slBump .45s ease; }
@keyframes slBump { 0%,100% { transform: scale(1); } 40% { transform: scale(1.45); } }
.nav__quote--mobile { display: none; }
@media (max-width: 768px) {
    .nav__quote--mobile { display: inline-flex; margin-inline-start: auto; margin-inline-end: 1rem; }
}

/* ─── Header spacing (more items in the nav) ────────── */
.nav { gap: 1.5rem; }
.nav__links a { white-space: nowrap; }
.nav__cta { gap: .75rem; }
@media (max-width: 1400px) {
    .nav__links { gap: 1.5rem; }
    .nav__cta .btn-ghost-white { padding: .6rem .9rem !important; }
}
@media (max-width: 1240px) {
    .nav__cta .btn-ghost-white { display: none; }
}

/* ─── Product actions (quote + compare) ─────────────── */
.sl-actions { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0 1.25rem 1rem; }
.sl-act {
    flex: 1 1 auto; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
    padding: .45rem .6rem; border: 1.5px solid var(--border); border-radius: 8px;
    font-size: .78rem; font-weight: 600; color: var(--text); background: #fff;
    transition: var(--transition);
}
.sl-act:hover { border-color: var(--primary); color: var(--primary-dark); }
.sl-act.is-active { background: var(--primary-light); border-color: var(--primary); color: var(--primary-dark); }
.sl-actions--lg { padding: 0; margin-top: 1rem; max-width: 460px; }
.sl-actions--lg .sl-act { padding: .7rem 1rem; font-size: .9rem; }
.compare-table .sl-actions { padding: 0; flex-direction: column; }

/* ─── Compare bar ────────────────────────────────────── */
.compare-bar {
    position: fixed; inset-inline: 0; bottom: 0; z-index: 900;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    padding: .75rem max(1.5rem, calc((100vw - 1240px) / 2 + 1.5rem));
    background: var(--secondary); color: #fff; box-shadow: 0 -8px 30px rgba(0,0,0,.25);
    transform: translateY(110%); visibility: hidden;
    transition: transform .35s cubic-bezier(.16,1,.3,1), visibility 0s linear .35s;
}
.compare-bar.is-visible { transform: none; visibility: visible; transition-delay: 0s; }
.compare-bar__items { display: flex; align-items: center; gap: .6rem; }
.compare-bar__item {
    position: relative; width: 48px; height: 48px; border-radius: 8px; background: #fff;
    display: flex; align-items: center; justify-content: center; overflow: visible;
}
.compare-bar__item img { width: 100%; height: 100%; object-fit: contain; border-radius: 8px; }
.compare-bar__item button {
    position: absolute; top: -7px; inset-inline-end: -7px; width: 20px; height: 20px; border-radius: 50%;
    background: #ef4444; color: #fff; font-size: .65rem; line-height: 20px;
}
.compare-bar__count { font-size: .85rem; opacity: .7; margin-inline-start: .25rem; }
.compare-bar__actions { display: flex; gap: .6rem; }
.compare-bar .btn { padding: .55rem 1.1rem; font-size: .88rem; }
body.has-compare-bar { padding-bottom: 80px; }
body.has-compare-bar .whatsapp-float { bottom: calc(5rem + 72px); }
body.has-compare-bar .back-to-top { bottom: calc(2rem + 72px); }

/* ─── Instant product search ─────────────────────────── */
.product-search { position: relative; margin-bottom: 1.25rem; }
.product-search input {
    width: 100%; padding: .85rem 1rem; padding-inline-start: 2.75rem;
    border: 1.5px solid var(--border); border-radius: var(--radius); font-size: 1rem; background: #fff;
}
.product-search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(249,115,22,.12); }
.product-search__icon { position: absolute; inset-inline-start: 1rem; top: 50%; transform: translateY(-50%); opacity: .55; pointer-events: none; }
.product-search__results {
    position: absolute; top: calc(100% + 6px); inset-inline: 0; z-index: 50;
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); overflow: hidden; max-height: 70vh; overflow-y: auto;
}
.product-search__item {
    display: flex; align-items: center; gap: .85rem; padding: .65rem 1rem; border-bottom: 1px solid var(--border);
}
.product-search__item:hover, .product-search__item:focus { background: var(--bg-soft); outline: none; }
.product-search__item img, .product-search__ph {
    width: 44px; height: 44px; flex-shrink: 0; object-fit: contain; border-radius: 6px; background: var(--bg-soft);
    display: flex; align-items: center; justify-content: center;
}
.product-search__item strong { display: block; font-size: .92rem; }
.product-search__item small { color: var(--text-muted); font-size: .8rem; }
.product-search__all {
    display: block; width: 100%; padding: .75rem 1rem; text-align: start;
    font-weight: 600; color: var(--primary-dark); font-size: .88rem;
}
.product-search__all:hover, .product-search__all:focus { background: var(--bg-soft); outline: none; }
.product-search__none { padding: 1rem; color: var(--text-muted); font-size: .9rem; }

/* ─── Shared card ────────────────────────────────────── */
.calc-card {
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 1.75rem; box-shadow: var(--shadow); margin-bottom: 1.5rem;
}
.calc-card--dark { background: var(--secondary); color: #fff; border-color: transparent; }
.calc-card__title { font-size: 1.2rem; margin-bottom: 1.25rem; }
.calc-card--dark .calc-card__title { color: #fff; }
.calc-note { font-size: .8rem; opacity: .65; margin-top: 1rem; }

/* ─── Calculator ─────────────────────────────────────── */
.calc { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 2rem; align-items: start; }
.calc__result { position: sticky; top: 100px; }
.calc-table-wrap { overflow-x: auto; }
.calc-table { width: 100%; border-collapse: collapse; }
.calc-table th {
    text-align: start; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em;
    color: var(--text-muted); padding: 0 .4rem .6rem; white-space: nowrap;
}
.calc-table td { padding: .3rem .4rem; border-top: 1px solid var(--border); }
.calc-in {
    width: 90px; padding: .5rem .6rem; border: 1.5px solid var(--border); border-radius: 8px; font-size: .92rem;
}
.calc-in--name { width: 100%; min-width: 160px; }
.calc-in--sm { width: 72px; }
.calc-in:focus { outline: none; border-color: var(--primary); }
.calc-rm { width: 30px; height: 30px; border-radius: 50%; color: #ef4444; font-size: .85rem; }
.calc-rm:hover { background: #fee2e2; }
.calc-add { margin-top: 1rem; }
.calc-add select {
    padding: .65rem 1rem; border: 1.5px dashed var(--primary); border-radius: var(--radius);
    color: var(--primary-dark); font-weight: 600; background: #fff7ed; max-width: 100%;
}
.calc-field { margin-bottom: 1.5rem; }
.calc-field label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .5rem; }
.calc-field strong { color: var(--primary-dark); }
.calc-field input[type=range] { width: 100%; accent-color: var(--primary); }
.calc-field small { color: var(--text-muted); font-size: .8rem; }
.calc-stats { display: grid; gap: .6rem; }
.calc-stat {
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
    padding: .6rem .85rem; border-radius: 10px; background: rgba(255,255,255,.06); font-size: .9rem;
}
.calc-stat span { opacity: .75; }
.calc-stat strong { text-align: end; }
.calc-stat--hl { background: rgba(249,115,22,.16); }
.calc-stat--hl strong { color: var(--accent); font-size: 1.05rem; }
.calc-reco__title { font-size: .95rem; margin: 1.5rem 0 .6rem; color: #fff; }
.calc-reco { display: grid; gap: .4rem; margin-bottom: 1.25rem; }
.calc-reco li { display: flex; align-items: center; gap: .6rem; font-size: .88rem; }
.calc-reco a { flex: 1; color: #fff; text-decoration: underline; text-decoration-color: rgba(255,255,255,.3); }
.calc-reco a:hover { color: var(--accent); }
.calc-reco__qty { font-weight: 700; color: var(--accent); }
.calc-reco__none { opacity: .7; font-size: .85rem; }
.calc-cta { width: 100%; justify-content: center; margin-top: .6rem; }

/* ─── Quote page ─────────────────────────────────────── */
.quote { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 2rem; align-items: start; }
.quote__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; gap: 1rem; }
.quote__head h2 { font-size: 1.35rem; }
.quote__clear { padding: .4rem .9rem; font-size: .85rem; }
.quote__clear[hidden] { display: none; }
.quote-items { display: grid; gap: .75rem; }
.quote-item {
    display: grid; grid-template-columns: 64px minmax(0,1fr) auto auto; gap: 1rem; align-items: center;
    padding: .85rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: #fff;
}
.quote-item__img {
    width: 64px; height: 64px; border-radius: 8px; background: var(--bg-soft);
    display: flex; align-items: center; justify-content: center; font-size: 1.6rem; overflow: hidden;
}
.quote-item__img img { width: 100%; height: 100%; object-fit: contain; }
.quote-item__title { font-weight: 600; display: block; }
.quote-item__title:hover { color: var(--primary); }
.quote-item__meta { font-size: .8rem; color: var(--text-muted); }
.quote-item__remove { width: 32px; height: 32px; border-radius: 50%; color: #ef4444; }
.quote-item__remove:hover { background: #fee2e2; }
.qty { display: inline-flex; border: 1.5px solid var(--border); border-radius: 8px; overflow: hidden; }
.qty__btn { width: 32px; font-size: 1.1rem; color: var(--text); background: var(--bg-soft); }
.qty__btn:hover { color: var(--primary); }
.qty__input { width: 52px; border: 0; text-align: center; font-size: .95rem; -moz-appearance: textfield; }
.qty__input::-webkit-inner-spin-button { -webkit-appearance: none; }
.quote-empty {
    text-align: center; padding: 3.5rem 2rem; background: var(--bg-soft);
    border: 2px dashed var(--border); border-radius: var(--radius-lg);
}
.quote-empty[hidden] { display: none; }
.quote-empty__icon { font-size: 3.5rem; margin-bottom: .75rem; }
.quote-empty p { color: var(--text-muted); margin-bottom: 1.25rem; }
.quote-empty__actions { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }
.quote-note {
    margin-top: 1rem; padding: .9rem 1.1rem; border-inline-start: 4px solid var(--primary);
    background: #fff7ed; border-radius: 8px; white-space: pre-line; font-size: .88rem;
}
.quote-note[hidden] { display: none; }
.quote__submit, .quote__wa { width: 100%; justify-content: center; margin-top: .75rem; }
.quote__wa { background: #25D366; color: #fff; }
.quote__wa:hover { background: #1ebe5b; color: #fff; }
#quoteForm.is-disabled { opacity: .55; pointer-events: none; }

/* ─── Compare table ──────────────────────────────────── */
.compare-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.compare-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.compare-table th, .compare-table td { padding: .85rem 1rem; border-bottom: 1px solid var(--border); text-align: start; vertical-align: top; font-size: .92rem; }
.compare-table thead th { vertical-align: bottom; background: var(--bg-soft); min-width: 200px; }
.compare-table thead th:first-child { min-width: 150px; }
.compare-table tbody th { color: var(--text-muted); font-weight: 600; white-space: nowrap; }
.compare-table tr.is-diff td { background: #fff7ed; font-weight: 600; }
.compare-table__img {
    display: flex; align-items: center; justify-content: center; height: 140px; margin-bottom: .6rem;
    background: #fff; border-radius: 10px; font-size: 3rem;
}
.compare-table__img img { max-height: 140px; width: auto; object-fit: contain; }
.compare-table__name { display: block; font-weight: 700; margin-bottom: .4rem; }
.compare-table__name:hover { color: var(--primary); }
.compare-table__remove { font-size: .78rem; color: #ef4444; }
.compare-table__file { display: block; color: var(--primary-dark); font-size: .85rem; margin-bottom: .25rem; }
.compare-hint { margin-top: .85rem; font-size: .85rem; color: var(--text-muted); }

/* ─── Warranty ───────────────────────────────────────── */
.warranty { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 2rem; align-items: start; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group .is-invalid { border-color: #ef4444 !important; box-shadow: 0 0 0 3px rgba(239,68,68,.12); }
.calc-card--dark .form-group label { color: rgba(255,255,255,.85); }
.warranty-result { margin-top: 1.25rem; padding: 1.1rem 1.25rem; border-radius: var(--radius); background: rgba(255,255,255,.08); }
.warranty-result.is-active { border-inline-start: 4px solid #22c55e; }
.warranty-result.is-expired { border-inline-start: 4px solid #f59e0b; }
.warranty-result__status { font-size: 1.15rem; font-weight: 700; margin-bottom: .5rem; }
.warranty-result dl { display: grid; grid-template-columns: auto 1fr; gap: .3rem .9rem; font-size: .9rem; }
.warranty-result dt { opacity: .7; }

/* ─── Projects ───────────────────────────────────────── */
.project-filters { margin-bottom: 2rem; }
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.75rem; }
.project-card {
    display: block; border-radius: var(--radius-lg); overflow: hidden; background: #fff;
    border: 1px solid var(--border); box-shadow: var(--shadow); transition: var(--transition);
}
.project-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.project-card.is-hidden { display: none; }
.project-card__img { position: relative; aspect-ratio: 4 / 3; background: var(--bg-soft); display: flex; align-items: center; justify-content: center; font-size: 3.5rem; }
.project-card__img img { width: 100%; height: 100%; object-fit: cover; }
.project-card__type { position: absolute; top: 1rem; inset-inline-start: 1rem; }
.project-card__body { padding: 1.25rem; }
.project-card__body h3 { font-size: 1.1rem; margin-bottom: .5rem; }
.project-card__meta { display: flex; flex-wrap: wrap; gap: .5rem 1rem; font-size: .85rem; color: var(--text-muted); }

/* ─── Distributor map ────────────────────────────────── */
.dist-map {
    height: 420px; border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 2rem;
    border: 1px solid var(--border); box-shadow: var(--shadow); z-index: 0;
}
.dist-pin span {
    display: flex; align-items: center; justify-content: center; width: 34px; height: 34px;
    border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
    background: var(--primary); border: 3px solid #fff; box-shadow: 0 3px 10px rgba(0,0,0,.3); font-size: 0;
}
.dist-pop { display: flex; flex-wrap: wrap; gap: .5rem .9rem; margin-top: .5rem; }
.dist-pop a { color: var(--primary-dark); font-weight: 600; }
.dist-card__name { cursor: pointer; }

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 1024px) {
    .calc, .quote, .warranty { grid-template-columns: minmax(0, 1fr); }
    .calc__result { position: static; }
}
@media (max-width: 600px) {
    .form-row { grid-template-columns: 1fr; gap: 0; }
    .quote-item { grid-template-columns: 52px minmax(0,1fr) auto; }
    .quote-item .qty { grid-column: 2; justify-self: start; }
    .quote-item__img { width: 52px; height: 52px; }
    .calc-card { padding: 1.25rem; }
    /* Appliance table → stacked cards */
    .calc-table thead { display: none; }
    .calc-table, .calc-table tbody { display: block; }
    .calc-table tr {
        display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) 30px; gap: .5rem;
        padding: .75rem 0; border-top: 1px solid var(--border);
    }
    .calc-table td { display: block; padding: 0; border: 0; min-width: 0; }
    .calc-table td:first-child { grid-column: 1 / -1; }
    .calc-table td:not(:first-child):not(:last-child)::before {
        content: attr(data-label); display: block; font-size: .7rem; color: var(--text-muted);
        text-transform: uppercase; margin-bottom: .2rem;
    }
    .calc-table td:last-child { align-self: end; }
    .calc-in, .calc-in--sm, .calc-in--name { width: 100%; min-width: 0; }
    .dist-map { height: 320px; }
    .compare-bar { padding: .6rem 1rem; }
    .compare-bar__item { width: 40px; height: 40px; }
}

/* ─── RTL: mirror the page hero so text sits on the dark side (desktop split layout) ── */
@media (min-width: 769px) {
    html[dir="rtl"] .page-hero::before {
        background: linear-gradient(-105deg, var(--secondary) 55%, #fff 55%);
    }
    html[dir="rtl"] .page-hero::after {
        clip-path: polygon(44% 0, 100% 0, 100% 100%, 44% 100%);
    }
    html[dir="rtl"] .page-hero__left { padding: 2.5rem 0 2.5rem 2rem; }
}

/* RTL breadcrumbs: dir="rtl" already flips the order — no row-reverse */
html[dir="rtl"] .page-hero .breadcrumbs {
    flex-direction: row;
    justify-content: flex-start;
}
