/* Shopora Core — uses theme.json tokens with safe fallbacks so it also works with other block themes. */
:root {
	--sc-primary: var(--wp--preset--color--primary, #d90f22);
	--sc-text: var(--wp--preset--color--contrast, #14171c);
	--sc-muted: var(--wp--preset--color--muted, #69707d);
	--sc-border: var(--wp--preset--color--divider, #e4e6ea);
	--sc-surface: var(--wp--preset--color--surface, #f4f5f7);
	--sc-base: var(--wp--preset--color--base, #fff);
}

/* Live search */
.shopora-sr {
	position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 200;
	background: var(--sc-base); color: var(--sc-text);
	border: 1px solid var(--sc-border); border-radius: 10px;
	box-shadow: 0 16px 40px rgba(16,24,40,.18);
	max-height: 70vh; overflow: auto; padding: 6px;
}
.shopora-sr[hidden] { display: none; }
.shopora-sr__item {
	display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center;
	padding: 8px; border-radius: 8px; color: var(--sc-text) !important; text-decoration: none;
	font-size: .875rem;
}
.shopora-sr__item:hover, .shopora-sr__item.is-active { background: var(--sc-surface); }
.shopora-sr__item img { width: 48px; height: 48px; object-fit: contain; background: #fff; border-radius: 6px; }
.shopora-sr__name { line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.shopora-sr__price { font-weight: 700; color: var(--sc-primary); white-space: nowrap; font-size: .8rem; text-align: right; }
.shopora-sr__price del { display: block; color: var(--sc-muted); font-weight: 400; }
.shopora-sr__price ins { text-decoration: none; }
.shopora-sr__empty { margin: 0; padding: 12px; color: var(--sc-muted); font-size: .875rem; }
.shopora-sr__all { display: block; padding: 10px; text-align: center; font-weight: 600; font-size: .875rem; color: var(--sc-primary) !important; border-top: 1px solid var(--sc-border); margin-top: 4px; }

/* Card overlay buttons */
.wc-block-components-product-image { position: relative; }
.shopora-wish {
	position: absolute; top: 6px; right: 6px; z-index: 2;
	width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer;
	display: grid; place-items: center;
	background: rgba(255,255,255,.95); box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.shopora-wish svg, .shopora-wish-inline svg { fill: none; stroke: var(--sc-text); stroke-width: 1.8; }
.shopora-wish[aria-pressed="true"] svg, .shopora-wish-inline[aria-pressed="true"] svg { fill: var(--sc-primary); stroke: var(--sc-primary); }
.shopora-qv-btn {
	position: absolute; left: 50%; bottom: 8px; z-index: 2; transform: translate(-50%, 6px);
	opacity: 0; transition: opacity .15s, transform .15s;
	border: 0; border-radius: 99px; padding: .45em 1em; cursor: pointer;
	background: var(--sc-text); color: #fff; font-size: .75rem; font-weight: 600; white-space: nowrap;
}
.wc-block-product:hover .shopora-qv-btn, .shopora-qv-btn:focus-visible { opacity: 1; transform: translate(-50%, 0); }
@media (hover: none) { .shopora-qv-btn { display: none; } }

.shopora-wish-inline {
	display: inline-flex; align-items: center; gap: .5em; margin-top: .75rem;
	background: none; border: 1px solid var(--sc-border); border-radius: 6px;
	padding: .55em 1em; cursor: pointer; font: inherit; font-size: .875rem; color: var(--sc-text);
}
.shopora-wish-inline:hover { border-color: var(--sc-primary); }

/* Countdown */
.shopora-countdown {
	margin: 0 0 .75rem; padding: .6em .9em; border-radius: 8px;
	background: #ecfdf3; color: #0b6b37; font-size: .875rem; font-weight: 600;
}

/* Quick view */
.shopora-qv {
	width: min(920px, calc(100vw - 24px)); max-height: calc(100vh - 32px);
	padding: 0; border: 0; border-radius: 14px; overflow: auto;
	background: var(--sc-base); color: var(--sc-text);
}
.shopora-qv::backdrop { background: rgba(10,12,16,.55); }
.shopora-qv__inner { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 28px; padding: 28px; }
.shopora-qv__close { position: absolute; top: 8px; right: 12px; background: none; border: 0; font-size: 28px; line-height: 1; cursor: pointer; color: var(--sc-text); }
.shopora-qv__main { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; border-radius: 10px; border: 1px solid var(--sc-border); }
.shopora-qv__thumbs { display: flex; gap: 8px; margin-top: 8px; }
.shopora-qv__thumbs button { padding: 0; border: 1px solid var(--sc-border); border-radius: 6px; background: #fff; cursor: pointer; width: 60px; height: 60px; }
.shopora-qv__thumbs img { width: 100%; height: 100%; object-fit: contain; }
.shopora-qv__brand { margin: 0; color: var(--sc-muted); text-transform: uppercase; font-size: .75rem; letter-spacing: .05em; }
.shopora-qv__title { margin: .2em 0 .4em; font-size: 1.35rem; }
.shopora-qv__price { font-size: 1.4rem; font-weight: 800; color: var(--sc-primary); }
.shopora-qv__price del { color: var(--sc-muted); font-size: .65em; font-weight: 400; }
.shopora-qv__price ins { text-decoration: none; }
.shopora-qv__desc { font-size: .9rem; color: var(--sc-muted); }
.shopora-qv__buy { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 1rem 0; }
.shopora-qv__qty { width: 70px; padding: .6em; border: 1px solid var(--sc-border); border-radius: 6px; }
.shopora-qv__cart, .shopora-qv__more { font-weight: 600; color: var(--sc-primary) !important; }
.shopora-qv__err { color: #b42318; }
.shopora-qv__loading { width: 100%; min-height: 360px; display: grid; place-items: center; }
.shopora-qv__loading::after { content: ""; width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--sc-border); border-top-color: var(--sc-primary); animation: shopora-spin .8s linear infinite; }
@keyframes shopora-spin { to { transform: rotate(360deg); } }
@media (max-width: 700px) { .shopora-qv__inner { grid-template-columns: 1fr; padding: 20px; } }

/* Wishlist page */
.shopora-wishlist__grid { list-style: none; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.shopora-wishlist__item { border: 1px solid var(--sc-border); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.shopora-wishlist__img img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.shopora-wishlist__name { font-weight: 600; font-size: .9rem; line-height: 1.35; }
.shopora-wishlist__price { font-weight: 700; color: var(--sc-primary); }
.shopora-wishlist__price ins { text-decoration: none; }
.shopora-wishlist__actions { margin-top: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.shopora-wishlist__remove { background: none; border: 0; color: var(--sc-muted); text-decoration: underline; cursor: pointer; font-size: .8rem; }

/* Call to order */
.shopora-call {
	display: flex; gap: 12px; align-items: flex-start; margin-top: 1rem;
	padding: 12px 14px; border-radius: 10px; background: var(--sc-surface);
}
.shopora-call__icon { font-size: 1.4rem; line-height: 1; }
.shopora-call p { margin: 0; }
.shopora-call__text { font-size: .875rem; color: var(--sc-muted); }
.shopora-call__actions { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 4px !important; font-weight: 700; }
.shopora-call__tel { color: var(--sc-primary) !important; }
.shopora-call__wa { color: #128c4a !important; }

/* Sticky add-to-cart bar */
.shopora-satc {
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 94;
	background: var(--sc-base); border-top: 1px solid var(--sc-border);
	box-shadow: 0 -6px 20px rgba(16,24,40,.1);
	animation: shopora-up .2s ease-out;
}
.shopora-satc[hidden] { display: none; }
.shopora-satc__inner { max-width: 1280px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 14px; }
.shopora-satc__img { width: 52px; height: 52px; object-fit: contain; border-radius: 6px; border: 1px solid var(--sc-border); background: #fff; }
.shopora-satc__info { flex: 1; min-width: 0; }
.shopora-satc__info p { margin: 0; }
.shopora-satc__name { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shopora-satc__price { font-weight: 800; color: var(--sc-primary); font-size: .95rem; }
.shopora-satc__price del { color: var(--sc-muted); font-weight: 400; font-size: .8em; margin-right: 4px; }
.shopora-satc__price ins { text-decoration: none; }
.shopora-satc__btn { white-space: nowrap; }
@keyframes shopora-up { from { transform: translateY(100%); } to { transform: none; } }
@media (max-width: 781px) {
	/* Sit above the theme's bottom navigation bar. */
	.shopora-satc { bottom: calc(62px + env(safe-area-inset-bottom)); }
	.shopora-satc__img { display: none; }
	.has-shopora-satc .shopora-wa { bottom: calc(150px + env(safe-area-inset-bottom)); }
}
@media (min-width: 782px) { .has-shopora-satc .shopora-wa { bottom: 90px; } }
@media (prefers-reduced-motion: reduce) { .shopora-satc { animation: none; } }

/* Free-delivery progress bar */
.shopora-freebar {
	margin: 0 0 1.25rem; padding: 12px 14px; border-radius: 10px;
	background: var(--sc-surface); border: 1px solid var(--sc-border);
}
.shopora-freebar__msg { margin: 0 0 8px; font-weight: 600; font-size: .9rem; min-height: 1.4em; }
.shopora-freebar__track { height: 8px; border-radius: 99px; background: var(--sc-border); overflow: hidden; }
.shopora-freebar__fill { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--sc-primary); transition: width .4s ease; }
.shopora-freebar.is-unlocked .shopora-freebar__fill { background: #12924a; }
.wc-block-mini-cart__drawer .shopora-freebar { margin: 12px 16px 0; }

/* Hero slides (block shopora/slides; behaviour comes from the theme's slider script) */
.shopora-slides { border-radius: var(--wp--custom--radius--large, 16px); overflow: hidden; }
.shopora-slides .shopora-slide {
	position: relative; display: flex; align-items: center;
	min-height: var(--shopora-slide-h, 420px);
	padding: clamp(1.5rem, 5vw, 4rem); box-sizing: border-box; isolation: isolate;
}
.shopora-slide__media, .shopora-slide__overlay { position: absolute; inset: 0; z-index: -1; }
.shopora-slide__media img { width: 100%; height: 100%; object-fit: cover; }
.shopora-slide__overlay { background: #000; }
.shopora-slide__content { max-width: 620px; }
.shopora-slide--center { justify-content: center; text-align: center; }
.shopora-slide--center .shopora-slide__content { margin: 0 auto; }
.shopora-slide--right { justify-content: flex-end; text-align: right; }
.shopora-slide.is-text-light { color: #fff; }
.shopora-slide.is-text-dark { color: var(--sc-text); }
.shopora-slide.is-text-dark .shopora-eyebrow { background: rgba(0,0,0,.08); }
.shopora-slide__title { font-size: clamp(1.75rem, 4vw, 3rem); font-weight: 800; line-height: 1.1; margin: .35em 0 .25em; color: inherit; }
.shopora-slide__text { font-size: clamp(1rem, 1.6vw, 1.2rem); margin: 0 0 1.25rem; opacity: .95; }
.shopora-slide__buttons { display: flex; flex-wrap: wrap; gap: .75rem; }
.shopora-slide--center .shopora-slide__buttons { justify-content: center; }
.shopora-slide--right .shopora-slide__buttons { justify-content: flex-end; }
.shopora-slide__btn.wp-element-button { background: #fff; color: #14171c; }
.shopora-slide__btn.wp-element-button:hover { background: #f0f0f0; color: #14171c; }
.shopora-slide__btn.is-secondary { background: transparent; color: inherit; box-shadow: inset 0 0 0 2px currentColor; }
.is-text-dark .shopora-slide__btn:not(.is-secondary) { background: var(--sc-primary); color: #fff; }
@media (max-width: 600px) {
	.shopora-slides .shopora-slide { min-height: var(--shopora-slide-h-m, 340px); align-items: flex-end; }
}

/* Image-only banners */
.shopora-slides .shopora-slide--image { padding: 0; display: block; background: transparent; }
.shopora-slide--image .shopora-slide__link { display: block; height: 100%; }
.shopora-slide--image .shopora-slide__link:focus-visible { outline: 3px solid var(--wp--preset--color--accent, #ffb400); outline-offset: -3px; }
.shopora-slides .shopora-slide--image.is-fit-natural { min-height: 0; }
.shopora-slide--image.is-fit-natural .shopora-slide__media { position: static; z-index: auto; display: block; }
/* Whole image, but never taller than 1.5× the slider height (a square or
   portrait upload would otherwise stretch every slide). Letterboxed instead. */
.shopora-slide--image.is-fit-natural .shopora-slide__media img {
	height: auto; display: block;
	max-height: calc(var(--shopora-slide-h, 420px) * 1.5);
	object-fit: contain; background: var(--sc-surface);
}
@media (max-width: 600px) {
	.shopora-slide--image.is-fit-natural .shopora-slide__media img { max-height: calc(var(--shopora-slide-h-m, 340px) * 1.5); }
}
.shopora-slide--image.is-fit-cover .shopora-slide__media { z-index: 0; }

/* Split + product slides */
.shopora-slides .shopora-slide--split {
	display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(1rem, 4vw, 3rem); align-items: center;
}
.shopora-slide--split.is-image-left .shopora-slide__side { order: -1; }
.shopora-slide__side { display: flex; justify-content: center; align-items: center; height: 100%; }
.shopora-slide__side .shopora-slide__media { position: static; z-index: auto; }
.shopora-slide__side img { width: auto; max-width: 100%; max-height: calc(var(--shopora-slide-h, 420px) - 4rem); object-fit: contain; filter: drop-shadow(0 18px 30px rgba(0,0,0,.25)); }
.shopora-slide__price { font-size: clamp(1.25rem, 2.4vw, 1.75rem); font-weight: 800; margin: 0 0 1.25rem; }
.shopora-slide__price del { opacity: .65; font-size: .7em; font-weight: 400; margin-right: .35em; }
.shopora-slide__price ins { text-decoration: none; }
.shopora-slide__badge { display: inline-block; vertical-align: middle; margin-left: .4em; padding: .15em .55em; border-radius: 99px; font-size: .55em; background: var(--wp--preset--color--accent, #ffb400); color: #14171c; }
@media (max-width: 700px) {
	.shopora-slides .shopora-slide--split { grid-template-columns: 1fr; align-items: end; text-align: left; }
	.shopora-slide--split .shopora-slide__side { order: -1; height: auto; }
	.shopora-slide__side img { max-height: 170px; }
}

/* Video slides */
.shopora-slide__video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* WhatsApp */
.shopora-wa {
	position: fixed; right: 18px; bottom: 18px; z-index: 95;
	width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
	background: #25d366; color: #fff !important; box-shadow: 0 6px 20px rgba(0,0,0,.2);
	transition: transform .15s;
}
.shopora-wa:hover { transform: scale(1.06); }
@media (max-width: 781px) { .shopora-wa { bottom: calc(76px + env(safe-area-inset-bottom)); right: 14px; width: 50px; height: 50px; } }
