/* Hilal Shop — product page gallery.
   Themes (WooCommerce, Astra) style the gallery with long selectors, so the
   properties that decide the look are marked !important. */

.tws-gal { --tws-g-accent: #EA580C; --tws-g-radius: 16px; --tws-g-shadow: 0 10px 30px -14px rgba(15, 23, 42, .25); }
.tws-gal.tws-gal-sh--none { --tws-g-shadow: none; }
.tws-gal.tws-gal-sh--strong { --tws-g-shadow: 0 18px 40px -16px rgba(15, 23, 42, .38); }

/* ---------- Main image frame ---------- */
.tws-gal .woocommerce-product-gallery .flex-viewport,
.tws-gal .woocommerce-product-gallery.tws-gal-single .woocommerce-product-gallery__wrapper,
.tws-gal .woocommerce-product-gallery:not(:has(.flex-viewport)) .woocommerce-product-gallery__wrapper {
	position: relative;
	box-sizing: border-box;
	overflow: hidden;
	border-radius: var(--tws-g-radius) !important;
	box-shadow: var(--tws-g-shadow);
}
/* No padding or border width inside the slider: WooCommerce's slider measures the
   frame once, and any extra width there makes the next image peek in.
   The white space is drawn on the image itself (border-box), the frame line is an outline. */
.tws-gal .woocommerce-product-gallery .woocommerce-product-gallery__image { overflow: hidden; }
.tws-gal .woocommerce-product-gallery .woocommerce-product-gallery__image img {
	box-sizing: border-box !important;
	padding: 14px !important;
	object-fit: contain;
}

/* A. Soft frame */
.tws-gal--soft .woocommerce-product-gallery .flex-viewport,
.tws-gal--soft .woocommerce-product-gallery.tws-gal-single .woocommerce-product-gallery__wrapper,
.tws-gal--soft .woocommerce-product-gallery:not(:has(.flex-viewport)) .woocommerce-product-gallery__wrapper {
	background: #fff;
	border: 0 !important;
	outline: 1px solid #E5E7EB;
	outline-offset: -1px;
}

/* B. Grey stage: white photo backgrounds blend into it */
.tws-gal--tinted .woocommerce-product-gallery .flex-viewport,
.tws-gal--tinted .woocommerce-product-gallery.tws-gal-single .woocommerce-product-gallery__wrapper,
.tws-gal--tinted .woocommerce-product-gallery:not(:has(.flex-viewport)) .woocommerce-product-gallery__wrapper {
	background: linear-gradient(160deg, #F8FAFC, #EEF2F7);
	border: 0 !important;
}
.tws-gal--tinted .woocommerce-product-gallery .woocommerce-product-gallery__image img,
.tws-gal--tinted .woocommerce-product-gallery .flex-control-thumbs img { mix-blend-mode: multiply; }

/* C. Accent frame */
.tws-gal--accent .woocommerce-product-gallery .flex-viewport,
.tws-gal--accent .woocommerce-product-gallery.tws-gal-single .woocommerce-product-gallery__wrapper,
.tws-gal--accent .woocommerce-product-gallery:not(:has(.flex-viewport)) .woocommerce-product-gallery__wrapper {
	background: #fff;
	border: 0 !important;
	outline: 2px solid var(--tws-g-accent);
	outline-offset: -2px;
}

/* ---------- Thumbnails: tiles that look clickable ---------- */
.tws-gal .woocommerce-product-gallery .flex-control-thumbs {
	display: flex !important; flex-wrap: wrap; gap: 10px;
	margin: 14px 0 0 !important; padding: 0 !important; list-style: none;
}
.tws-gal .woocommerce-product-gallery .flex-control-thumbs li {
	float: none !important; width: 72px !important; margin: 0 !important; padding: 0 !important; list-style: none;
}
.tws-gal .woocommerce-product-gallery .flex-control-thumbs li :is(img, .twsa-galprev__thumb) {
	display: block; box-sizing: border-box;
	width: 72px !important; height: 72px !important; object-fit: contain;
	padding: 5px; margin: 0 !important;
	background: #fff;
	border: 1.5px solid #E5E7EB !important;
	border-radius: calc(var(--tws-g-radius) * .7) !important;
	opacity: .65 !important; cursor: pointer;
	transition: opacity .15s, border-color .15s, box-shadow .15s, transform .15s;
}
.tws-gal .woocommerce-product-gallery .flex-control-thumbs li :is(img, .twsa-galprev__thumb):hover { opacity: 1 !important; transform: translateY(-1px); }
.tws-gal .woocommerce-product-gallery .flex-control-thumbs li :is(img, .twsa-galprev__thumb).flex-active {
	opacity: 1 !important;
	border: 2px solid var(--tws-g-accent) !important;
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--tws-g-accent) 18%, transparent);
}
.tws-gal--tinted .woocommerce-product-gallery .flex-control-thumbs li :is(img, .twsa-galprev__thumb) { background: #F1F5F9; border-color: transparent !important; }
.tws-gal--tinted .woocommerce-product-gallery .flex-control-thumbs li :is(img, .twsa-galprev__thumb).flex-active { background: color-mix(in srgb, var(--tws-g-accent) 9%, #fff); }

/* ---------- Zoom button ---------- */
.tws-gal .woocommerce-product-gallery .woocommerce-product-gallery__trigger {
	width: 38px !important; height: 38px !important; top: 12px !important;
	display: grid !important; place-items: center;
	background: #fff !important; border-radius: 50% !important;
	box-shadow: 0 2px 10px rgba(15, 23, 42, .16) !important;
	font-size: 16px !important; line-height: 1 !important; text-decoration: none !important;
	z-index: 5;
}

/* ---------- Counter and arrows (added by gallery.js) ---------- */
.tws-gal-count {
	position: absolute; top: 14px; left: 14px; z-index: 4; /* the zoom button sits on the right */
	padding: 4px 10px;
	font: 700 12px/1.4 system-ui, sans-serif; color: #fff; letter-spacing: .02em;
	background: rgba(15, 23, 42, .72); border-radius: 999px;
	pointer-events: none;
}
.tws-gal--accent .tws-gal-count { background: var(--tws-g-accent); }

.tws-gal-arrow {
	position: absolute; top: 50%; z-index: 4;
	display: grid; place-items: center;
	width: 38px; height: 38px; margin-top: -19px; padding: 0;
	color: #0F172A; background: #fff; border: 0; border-radius: 50%;
	box-shadow: 0 2px 10px rgba(15, 23, 42, .18);
	cursor: pointer; transition: transform .15s, background .15s;
}
.tws-gal-arrow:hover { background: #fff; color: var(--tws-g-accent); transform: scale(1.06); }
.tws-gal-arrow.is-prev { right: 10px; }
.tws-gal-arrow.is-next { left: 10px; }
.tws-gal-arrow svg { display: block; }
@media (hover: hover) and (min-width: 922px) {
	.tws-gal-arrow { opacity: 0; transition: opacity .2s, transform .15s; }
	.tws-gal .woocommerce-product-gallery:hover .tws-gal-arrow, .tws-gal-arrow:focus-visible { opacity: 1; }
}
