/* Branches (inc/branches.php): a card per shop with a photo collage, its details and a map; the
   service centre and a WhatsApp box under them; and the photo viewer (assets/js/branches.js). */

.ic-branches { --ic-dark: #1f1a30; --ic-gold-ink: #a8720c; display: grid; gap: 28px; margin-bottom: 40px; }

/* ---------- Intro and the jump chips ---------- */
.ic-branches__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; }
.ic-branches .ic-branches__lead { margin: 0; max-width: 64ch; color: var(--ic-text); font-size: 16px; line-height: 1.75; }
.ic-branches__jump { display: flex; flex-wrap: wrap; gap: 10px; }
.ic-branches__chip { display: inline-flex; align-items: center; gap: 10px; padding: 8px 18px 8px 14px; border: 1px solid var(--ic-line); border-radius: var(--ic-radius-pill); background: #fff; color: var(--ic-title); text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
.ic-branches__chip:hover, .ic-branches__chip:focus-visible { border-color: var(--ic-gold); box-shadow: 0 6px 18px rgba(0, 0, 0, .08); color: var(--ic-ink); transform: translateY(-1px); }
.ic-branches__chiptext { display: grid; line-height: 1.3; }
.ic-branches__chiptext b { font-size: 14px; font-weight: 700; }
.ic-branches__chiptext small { color: var(--ic-text); font-size: 12px; }
.ic-branches__dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--ic-muted); }
.ic-branches__chip.is-open .ic-branches__dot { background: var(--ic-green); box-shadow: 0 0 0 4px rgba(59, 155, 72, .16); }
.ic-branches__chip.is-closed .ic-branches__dot { background: var(--ic-red); box-shadow: 0 0 0 4px rgba(226, 45, 45, .12); }

/* ---------- A branch: photos | details over the map (the second one the other way round) ---------- */
.ic-branch {
	display: grid;
	grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
	grid-template-rows: auto 1fr;
	grid-template-areas: "photos info" "photos map";
	overflow: hidden;
	border-radius: 18px;
	background: #fff;
	box-shadow: var(--ic-shadow);
	scroll-margin-top: calc(var(--ic-admin) + var(--ic-top-h) + 24px);
}
.ic-branch--flip { grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr); grid-template-areas: "info photos" "map photos"; }
.ic-branch--nomap { grid-template-rows: auto; grid-template-areas: "photos info"; }
.ic-branch--flip.ic-branch--nomap { grid-template-areas: "info photos"; }
.ic-branch--nophotos { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto; grid-template-areas: "info map"; }
.ic-branch--nophotos.ic-branch--nomap { grid-template-columns: 1fr; grid-template-areas: "info"; }

/* Photos: the first one big, the next ones in a row under it. */
.ic-branch__photos { grid-area: photos; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: minmax(340px, 1fr) auto; gap: 8px; padding: 8px; }
.ic-branch__photos--n1 { grid-template-rows: minmax(340px, 1fr); }
.ic-branch__photos--n2 { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(300px, 1.6fr) minmax(200px, 1fr); }
.ic-branch__photos--n3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ic-branch__photos--n4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ic-branch__photo { position: relative; display: block; min-height: 0; overflow: hidden; border-radius: 12px; background: #ece9e3; }
.ic-branch__photo--1 { grid-column: 1 / -1; }
.ic-branch__photos:not(.ic-branch__photos--n1):not(.ic-branch__photos--n2) .ic-branch__photo:not(.ic-branch__photo--1) { aspect-ratio: 4 / 3; }
.ic-branch__photo img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.ic-branch__photo:focus-visible { outline: 3px solid var(--ic-gold); outline-offset: 2px; }
@media (hover: hover) {
	.ic-branch__photo:hover img { transform: scale(1.045); }
}
.ic-branch__more { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 6px; background: rgba(20, 16, 32, .55); color: #fff; font-size: 20px; font-weight: 800; transition: background-color .2s; }
.ic-branch__more .ic-branch-icon { width: 20px; height: 20px; }
.ic-branch__more > span:not(.screen-reader-text) { direction: ltr; unicode-bidi: isolate; }
.ic-branch__photo:hover .ic-branch__more { background: rgba(20, 16, 32, .68); }

/* Details. */
.ic-branch__info { grid-area: info; padding: 30px 32px 22px; }
.ic-branches .ic-branch__area { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--ic-gold-ink); font-size: 13px; font-weight: 700; letter-spacing: .02em; }
.ic-branch__area .ic-branch-icon { width: 16px; height: 16px; }
.ic-branches .ic-branch__name { margin: 6px 0 10px; color: var(--ic-ink); font-size: clamp(24px, 2.1vw, 32px); font-weight: 800; line-height: 1.2; }
.ic-branch__rating { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; color: var(--ic-title); font-size: 14px; text-decoration: none; }
.ic-branch__rating b { color: var(--ic-ink); font-size: 15px; }
a.ic-branch__rating:hover .ic-branch__reviews { color: var(--ic-blue); text-decoration: underline; }
.ic-branch__stars { background: linear-gradient(90deg, #f5be23 calc(var(--r, 5) / 5 * 100%), #d8d8d8 0); -webkit-background-clip: text; background-clip: text; color: transparent; font-size: 17px; letter-spacing: 1px; line-height: 1; }
.icam-rtl .ic-branch__stars { background-image: linear-gradient(270deg, #f5be23 calc(var(--r, 5) / 5 * 100%), #d8d8d8 0); }
.ic-branch__reviews { color: var(--ic-text); }

.ic-branches .ic-branch__status { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; width: fit-content; margin: 14px 0 0; padding: 6px 14px; border-radius: var(--ic-radius-pill); font-size: 13px; }
.ic-branch__status:empty { display: none; }
.ic-branch__status b { display: inline-flex; align-items: center; gap: 7px; font-weight: 800; }
.ic-branch__status b::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.ic-branch__status.is-open { background: var(--ic-green-soft); color: #23702f; }
.ic-branch__status.is-closed { background: #fdecec; color: #b42020; }
.ic-branch__status span { color: var(--ic-title); font-weight: 600; }

.ic-branches .ic-branch__facts { display: grid; gap: 10px; margin: 20px 0 0; padding: 0; list-style: none; }
.ic-branch__facts li { display: flex; gap: 10px; color: var(--ic-title); font-size: 14.5px; line-height: 1.6; }
.ic-branch__facts .ic-branch-icon, .ic-branches__addr .ic-branch-icon { flex: none; margin-top: 3px; color: var(--ic-gold-ink); }
.ic-branch__facts a { color: var(--ic-ink); font-weight: 700; text-decoration: none; }
.ic-branch__facts a:hover { color: var(--ic-blue); }

.ic-branch__hours { margin-top: 20px; padding: 14px 14px 10px; border-radius: 14px; background: var(--ic-page); }
.ic-branches .ic-branch__hours h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; padding-inline: 8px; color: var(--ic-ink); font-size: 14px; font-weight: 700; }
.ic-branch__hours h3 .ic-branch-icon { width: 16px; height: 16px; color: var(--ic-gold-ink); }
.ic-branch__hours dl { margin: 0; }
.ic-branch__hours dl > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 14px; padding: 6px 8px; border-radius: 9px; font-size: 14px; }
.ic-branch__hours dt { display: inline-flex; align-items: center; gap: 8px; color: var(--ic-title); }
.ic-branch__hours dd { margin: 0; color: var(--ic-ink); font-weight: 700; direction: ltr; unicode-bidi: isolate; }
.icam-rtl .ic-branch__hours dd { direction: rtl; }
.ic-branch__hours .is-closed dd { color: #b42020; }
.ic-branch__hours .is-today { background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .06); }
.ic-branch__today { padding: 1px 8px; border-radius: var(--ic-radius-pill); background: var(--ic-gold); color: var(--ic-dark); font-size: 11px; font-weight: 800; }

.ic-branch__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.ic-branch__actions .ic-btn { min-height: 46px; padding-inline: 22px; border-radius: var(--ic-radius-pill); font-size: 14px; font-weight: 700; }
.ic-branch__actions .ic-btn .ic-branch-icon { width: 17px; height: 17px; }
.ic-branch__actions .ic-btn--gold, .ic-branch__actions .ic-btn--gold:hover { color: var(--ic-dark); }

/* Map. */
.ic-branch__map { grid-area: map; display: flex; min-height: 240px; padding: 0 32px 30px; }
.ic-branch__map iframe { flex: 1; width: 100%; min-height: 240px; border: 0; border-radius: 14px; background: #eef0ee; }
.ic-branch--nophotos .ic-branch__map { padding: 30px 30px 30px 0; }
.icam-rtl .ic-branch--nophotos .ic-branch__map { padding: 30px 0 30px 30px; }

/* ---------- Service centre and WhatsApp ---------- */
.ic-branches__extra { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.ic-branches__card { display: flex; gap: 18px; padding: 24px 26px; border-radius: 18px; background: #fff; box-shadow: var(--ic-shadow); }
.ic-branches__cardicon { display: grid; flex: none; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--ic-cream); color: var(--ic-gold-ink); }
.ic-branches__cardicon .ic-branch-icon { width: 22px; height: 22px; }
.ic-branches .ic-branches__card h3 { margin: 2px 0 6px; color: var(--ic-ink); font-size: 18px; font-weight: 800; }
.ic-branches .ic-branches__card p { margin: 0 0 10px; color: var(--ic-text); font-size: 14px; line-height: 1.65; }
.ic-branches .ic-branches__addr { display: flex; gap: 8px; color: var(--ic-title); }
.ic-branches__link { color: var(--ic-blue); font-size: 14px; font-weight: 700; text-decoration: none; }
.ic-branches__link:hover { text-decoration: underline; }
.ic-branches__card--wa { position: relative; overflow: hidden; background: var(--ic-dark); }
.ic-branches__card--wa::after { content: ""; position: absolute; inset: auto 0 0; height: 5px; background: linear-gradient(90deg, #f5be23 0 20%, #f08a24 0 40%, #e5484d 0 60%, #8a4fc4 0 80%, #3a78e8 0); }
.ic-branches__card--wa .ic-branches__cardicon { background: rgba(255, 255, 255, .08); color: #f5be23; }
.ic-branches .ic-branches__card--wa h3 { color: #fff; }
.ic-branches .ic-branches__card--wa p { color: rgba(255, 255, 255, .74); }
.ic-branches__wa.ic-btn { min-height: 44px; padding-inline: 20px; border-radius: var(--ic-radius-pill); background: #25d366; color: #0b3b1e; font-weight: 800; }
.ic-branches__wa.ic-btn:hover { background: #1fbd5a; color: #0b3b1e; }

/* ---------- Tablets: photos across the top, details and map side by side ---------- */
@media (max-width: 1100px) {
	.ic-branch, .ic-branch--flip { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto; grid-template-areas: "photos photos" "info map"; }
	.ic-branch--nomap, .ic-branch--flip.ic-branch--nomap { grid-template-areas: "photos photos" "info info"; }
	.ic-branch__photos { grid-template-rows: auto auto; }
	.ic-branch__photo--1 { aspect-ratio: 16 / 8; }
	.ic-branch__photos--n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto; }
	.ic-branch__photos--n2 .ic-branch__photo--1 { grid-column: auto; aspect-ratio: 4 / 3; }
	.ic-branch__photos--n2 .ic-branch__photo { aspect-ratio: 4 / 3; }
	.ic-branch__map { padding: 30px 30px 30px 0; }
	.icam-rtl .ic-branch__map { padding: 30px 0 30px 30px; }
}

/* ---------- Phones: photos slide sideways, then details, then the map ---------- */
@media (max-width: 767px) {
	.ic-branches { gap: 20px; }
	.ic-branches .ic-branches__lead { font-size: 15px; }
	.ic-branches__jump { width: 100%; }
	.ic-branches__chip { flex: 1 1 0; min-width: 0; }
	.ic-branch, .ic-branch--flip, .ic-branch--nomap, .ic-branch--flip.ic-branch--nomap, .ic-branch--nophotos { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-template-areas: "photos" "info" "map"; border-radius: 16px; }
	.ic-branch__photos, .ic-branch__photos--n2 { display: flex; gap: 8px; padding: 8px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; }
	.ic-branch__photos::-webkit-scrollbar { display: none; }
	.ic-branch__photo, .ic-branch__photo--1, .ic-branch__photos--n2 .ic-branch__photo { flex: 0 0 86%; aspect-ratio: 4 / 3; scroll-snap-align: center; }
	.ic-branch__photos--n1 .ic-branch__photo { flex-basis: 100%; }
	.ic-branch__info { padding: 18px 18px 6px; }
	.ic-branches .ic-branch__name { font-size: 24px; }
	.ic-branch__actions .ic-btn { flex: 1 1 auto; }
	.ic-branch__map, .icam-rtl .ic-branch__map, .ic-branch--nophotos .ic-branch__map, .icam-rtl .ic-branch--nophotos .ic-branch__map { min-height: 220px; padding: 12px 18px 18px; }
	.ic-branch__map iframe { min-height: 220px; }
	.ic-branches__extra { grid-template-columns: minmax(0, 1fr); gap: 14px; }
	.ic-branches__card { gap: 14px; padding: 20px 18px; }
	.ic-branches__cardicon { width: 42px; height: 42px; }
}

/* ---------- Photo viewer ---------- */
.ic-lb-open { overflow: hidden; }
.ic-lb { width: 100vw; max-width: none; height: 100vh; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(14, 11, 22, .96); color: #fff; }
.ic-lb::backdrop { background: rgba(0, 0, 0, .6); }
.ic-lb[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.ic-lb__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; font-size: 14px; font-weight: 700; }
.ic-lb__count { color: rgba(255, 255, 255, .8); }
.ic-lb__stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 0 76px; }
.ic-lb__img { max-width: min(100%, 1400px); max-height: 100%; border-radius: 8px; object-fit: contain; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.ic-lb__cap { margin: 0; padding: 14px 20px 22px; color: rgba(255, 255, 255, .78); font-size: 14px; text-align: center; }
.ic-lb button { display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer; transition: background-color .15s; }
.ic-lb button:hover, .ic-lb button:focus-visible { background: rgba(255, 255, 255, .24); }
.ic-lb button:focus-visible { outline: 2px solid #f5be23; outline-offset: 2px; }
.ic-lb__close { width: 42px; height: 42px; }
.ic-lb__nav { position: absolute; top: 50%; transform: translateY(-50%); }
.ic-lb__nav--prev { inset-inline-start: 16px; }
.ic-lb__nav--next { inset-inline-end: 16px; }
.icam-rtl .ic-lb__nav svg { transform: scaleX(-1); }
@media (max-width: 767px) {
	.ic-lb__stage { padding: 0 8px; }
	.ic-lb__nav { top: auto; bottom: -62px; transform: none; }
	.ic-lb__cap { padding: 14px 70px 22px; }
}

@media (prefers-reduced-motion: reduce) {
	.ic-branch__photo img, .ic-branches__chip { transition: none; }
	.ic-branch__photo:hover img { transform: none; }
}
