/* ============================================================
   HENCA GROUPS — UI polish (gallery, office/workshop maps, Chapa pay button)
   Everything here uses its own "hx-" class names, so it can never clash
   with style.css. The "added to cart" bar lives in assets/js/henca-ui.js.
   ============================================================ */

/* ---------- Furniture detail: two-column layout ---------- */
.hx-pdp { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.hx-pdp > * { min-width: 0; }
.hx-media { position: sticky; top: 92px; }
@media (max-width: 1050px) { .hx-pdp { gap: 36px; } }
@media (max-width: 800px)  { .hx-pdp { grid-template-columns: 1fr; gap: 26px; } .hx-media { position: static; } }

/* ---------- Photo gallery ---------- */
.hx-gallery-main { position: relative; width: 100%; aspect-ratio: 4 / 3; border-radius: 16px; overflow: hidden; background: #ece7df; border: 1px solid var(--line, #e8e5df); }
.hx-gallery-bg { position: absolute; inset: -24px; width: calc(100% + 48px); height: calc(100% + 48px); object-fit: cover; filter: blur(26px) saturate(1.15); opacity: .55; pointer-events: none; }
.hx-gallery-img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; display: block; cursor: pointer; transition: opacity .2s ease; }
.hx-gallery-img.is-swapping { opacity: .25; }
.hx-gallery-count { position: absolute; z-index: 2; right: 12px; bottom: 12px; padding: 4px 10px; border-radius: 999px; background: rgba(16,26,36,.72); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .4px; pointer-events: none; }
.hx-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 10px; margin-top: 12px; }
.hx-thumb { padding: 0; aspect-ratio: 1 / 1; border: 2px solid transparent; border-radius: 12px; overflow: hidden; background: #ece7df; cursor: pointer; opacity: .72; transition: opacity .2s ease, border-color .2s ease, transform .15s ease; }
.hx-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hx-thumb:hover { opacity: 1; transform: translateY(-2px); }
.hx-thumb.is-active { opacity: 1; border-color: var(--orange, #ff4d16); }
.hx-thumb:focus-visible { outline: 2px solid var(--orange, #ff4d16); outline-offset: 2px; }
@media (max-width: 800px) { .hx-thumbs { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; } }

/* ---------- Office & workshop: two matching map cards, both always visible ---------- */
.hx-loc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; align-items: stretch; margin-top: 8px; }
.hx-loc-grid.is-single { grid-template-columns: minmax(0, 720px); }
.hx-loc-card { display: flex; flex-direction: column; background: var(--surface, #fff); border: 1px solid var(--line, #e8e5df); border-radius: 18px; overflow: hidden; box-shadow: 0 10px 30px rgba(16,26,36,.07); transition: box-shadow .25s ease, transform .25s ease; }
.hx-loc-card:hover { box-shadow: 0 16px 40px rgba(16,26,36,.12); transform: translateY(-2px); }
.hx-loc-map { position: relative; height: 300px; background: #e9e5dd; }
.hx-loc-map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.hx-loc-tag { position: absolute; z-index: 2; left: 14px; top: 14px; padding: 6px 12px; border-radius: 999px; background: var(--orange, #ff4d16); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; box-shadow: 0 4px 12px rgba(0,0,0,.2); pointer-events: none; }
.hx-loc-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--muted, #6e7680); font-size: 12px; }
.hx-loc-body { flex: 1; display: flex; flex-direction: column; gap: 14px; padding: 22px 24px 24px; }
.hx-loc-body h3 { margin: 0; font: 700 20px var(--serif, Georgia, serif); color: var(--ink, #18222e); }
.hx-loc-info { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.hx-loc-info li { display: flex; align-items: center; gap: 12px; font-size: 13px; line-height: 1.45; color: var(--ink, #18222e); }
.hx-loc-info li a { color: inherit; }
.hx-loc-ico { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; background: #fff4ef; color: var(--orange, #ff4d16); }
.hx-loc-btn { margin-top: auto; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 20px; border-radius: 10px; background: var(--orange, #ff4d16); color: #fff; font-size: 12px; font-weight: 700; transition: background .2s ease, gap .2s ease; }
.hx-loc-btn:hover { background: var(--orange-dark, #db3d0d); gap: 12px; }
@media (max-width: 900px) {
  .hx-loc-grid, .hx-loc-grid.is-single { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .hx-loc-map { height: 260px; }
}

/* ---------- Pay with Chapa / ArifPay buttons ---------- */
.hx-pay { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line, #e8e5df); background: var(--surface, #fff); color: var(--ink, #18222e); text-align: left; font: inherit; cursor: pointer; transition: transform .18s ease, box-shadow .2s ease, border-color .2s ease, opacity .2s; }
.hx-pay:hover { transform: translateY(-2px); }
.hx-pay:focus-visible { outline: 3px solid rgba(124,194,67,.55); outline-offset: 2px; }
.hx-pay-logo { display: flex; align-items: center; justify-content: center; flex-shrink: 0; height: 46px; padding: 0 14px; background: #fff; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.14); }
.hx-pay-logo img { height: 24px; width: auto; display: block; filter: none !important; }
.hx-pay-logo-plain { min-width: 44px; width: 44px; padding: 0; background: #fff4ef; color: var(--orange, #ff4d16); box-shadow: none; }
.hx-pay-text { flex: 1; min-width: 0; }
.hx-pay-text strong { display: block; font-size: 13px; font-weight: 700; line-height: 1.25; }
.hx-pay-text small { display: block; margin-top: 2px; font-size: 10px; line-height: 1.35; opacity: .88; }
.hx-pay-arrow { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; transition: transform .2s ease; }
.hx-pay:hover .hx-pay-arrow { transform: translateX(3px); }
.hx-pay-chapa { border: 0; color: #fff; background: linear-gradient(135deg, #2e7d32 0%, #4c9a2a 55%, #7CC243 100%); box-shadow: 0 10px 24px rgba(76,154,42,.32); }
.hx-pay-chapa:hover { box-shadow: 0 14px 30px rgba(76,154,42,.45); }
.hx-pay-chapa .hx-pay-arrow { background: rgba(255,255,255,.22); }
.hx-pay-alt:hover { border-color: var(--orange, #ff4d16); box-shadow: 0 8px 22px rgba(16,26,36,.10); }
.hx-pay-alt .hx-pay-arrow { background: rgba(255,77,22,.1); color: var(--orange, #ff4d16); }
.hx-pay.is-loading { opacity: .8; pointer-events: none; cursor: progress; }
.checkout-actions .hx-pay-note { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0; font-size: 10px; color: var(--muted, #6e7680); text-align: center; }

@media (max-width: 480px) {
  .hx-pay { gap: 10px; padding: 10px 12px; }
  .hx-pay-logo { height: 40px; padding: 0 10px; border-radius: 9px; }
  .hx-pay-logo img { height: 19px; }
  .hx-pay-logo-plain { width: 40px; }
  .hx-pay-arrow { width: 26px; height: 26px; }
}

/* ---------- dark mode ---------- */
[data-theme="dark"] .hx-gallery-main, [data-theme="dark"] .hx-thumb { background: #1a2433; }
[data-theme="dark"] .hx-gallery-bg { filter: blur(26px) saturate(1.1) brightness(.75) !important; }
[data-theme="dark"] .hx-loc-map { background: #1a2433; }
[data-theme="dark"] .hx-loc-ico { background: rgba(255,77,22,.18); }
[data-theme="dark"] .hx-loc-card { box-shadow: 0 10px 30px rgba(0,0,0,.4); }
