/* ==========================================================================
   Logo Grid – Elementor widget (widgets/logo-grid)
   ตัวแปรที่วิดเจ็ตตั้งให้: --thep-cols, --thep-gap, --thep-arrow-size, --thep-arrow-color,
   --thep-dot-size, --thep-dot-color, --thep-dot-active
   ========================================================================== */
.elementor-widget-thep_logo_grid { width: 100%; }

/* Card */
.thep-logo-gallery .gallery { display: flex !important; flex-wrap: wrap; justify-content: center; gap: var(--thep-gap, 16px);
	margin: 8px 0 0 !important; width: 100%; }
.thep-logo-gallery .gallery-item { box-sizing: border-box; height: 112px; margin: 0 !important; padding: 0 !important;
	background: #fff; border: 1px solid #E3E7EE; border-radius: 10px;
	display: flex !important; align-items: center; justify-content: center; }
.thep-logo-gallery .gallery-icon { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; padding: 14px; }
.thep-logo-gallery .gallery-icon a { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.thep-logo-gallery .gallery-icon img { max-width: 100% !important; max-height: 82px !important; width: auto !important; height: auto !important;
	object-fit: contain; border: 0 !important; box-shadow: none !important; }
.thep-logo-gallery.no-border .gallery-item { border-color: transparent; background: transparent; }

/* Grid: Columns */
.thep-logo-gallery.is-grid .gallery-item {
	flex: 0 0 calc((100% - (var(--thep-cols, 6) - 1) * var(--thep-gap, 16px)) / var(--thep-cols, 6));
	width: calc((100% - (var(--thep-cols, 6) - 1) * var(--thep-gap, 16px)) / var(--thep-cols, 6)) !important;
	max-width: calc((100% - (var(--thep-cols, 6) - 1) * var(--thep-gap, 16px)) / var(--thep-cols, 6)) !important; }

/* Carousel (Swiper) */
.thep-logo-gallery.is-swiper { position: relative; }
.thep-logo-gallery.is-swiper .swiper { overflow: hidden; }
.thep-logo-gallery.is-swiper .swiper-slide { height: auto; }
.thep-logo-gallery.is-swiper .gallery-item { flex: none; width: 100% !important; max-width: 100% !important; }

/* Carousel navigation: arrows */
.thep-logo-gallery.is-swiper.arrows-outside { padding: 0 calc(var(--thep-arrow-size, 40px) + 12px); }
.thep-logo-gallery .thep-nav { position: absolute; top: 50%; z-index: 2; transform: translateY(-50%);
	width: var(--thep-arrow-size, 40px); height: var(--thep-arrow-size, 40px); padding: 0; border-radius: 50%;
	display: flex; align-items: center; justify-content: center; cursor: pointer;
	background: #fff; border: 1px solid #E3E7EE; color: var(--thep-arrow-color, #0B1F3A);
	font-size: calc(var(--thep-arrow-size, 40px) * .5); line-height: 1; box-shadow: 0 2px 8px rgba(11,31,58,.08); }
.thep-logo-gallery .thep-nav:focus-visible { outline: 2px solid #C9A227; outline-offset: 2px; }
.thep-logo-gallery .thep-nav.swiper-button-disabled { opacity: .35; cursor: default; }
.thep-logo-gallery .thep-prev { left: 0; }
.thep-logo-gallery .thep-next { right: 0; }
.thep-logo-gallery .thep-next svg { transform: rotate(180deg); }
.thep-logo-gallery.arrows-inside .thep-prev { left: 8px; }
.thep-logo-gallery.arrows-inside .thep-next { right: 8px; }
.thep-logo-gallery.has-dots.has-arrows .thep-nav { top: calc(50% - 16px); }

/* Carousel navigation: dots */
.thep-logo-gallery .thep-dots { position: static; display: flex; justify-content: center; gap: 8px; margin-top: 20px; }
.thep-logo-gallery .thep-dots .swiper-pagination-bullet { width: var(--thep-dot-size, 8px); height: var(--thep-dot-size, 8px); margin: 0 !important;
	border-radius: 50%; opacity: 1; background: var(--thep-dot-color, #CBD2DC); }
.thep-logo-gallery .thep-dots .swiper-pagination-bullet-active { background: var(--thep-dot-active, #C9A227); }

/* Hover only on logos that link to a partner website (!important: beats the Border Color control) */
.thep-logo-gallery .gallery-item.has-link { transition: border-color .2s, box-shadow .2s, background-color .2s; }
.thep-logo-gallery .gallery-item.has-link:hover,
.thep-logo-gallery .gallery-item.has-link:focus-within { border-color: #C9A227 !important; box-shadow: 0 6px 18px rgba(11,31,58,.08); position: relative; z-index: 1; }
.thep-logo-gallery.style-hairline .gallery-item.has-link:hover,
.thep-logo-gallery.style-hairline .gallery-item.has-link:focus-within { box-shadow: none; background-color: #FBF8EE !important; }
.thep-logo-gallery .gallery-item.has-link a:focus-visible { outline: 2px solid #C9A227; outline-offset: 2px; border-radius: 6px; }

/* Alignment of incomplete rows (Grid) */
.thep-logo-gallery.align-left .gallery { justify-content: flex-start; }
.thep-logo-gallery.align-right .gallery { justify-content: flex-end; }

/* Style: Hairline grid – lines only around cells, shared edges collapse */
.thep-logo-gallery.style-hairline { --thep-gap: 0px; }
.thep-logo-gallery.style-hairline .gallery { padding: 0 1px 1px 0; }
.thep-logo-gallery.style-hairline .gallery-item { border-radius: 0; margin: 0 -1px -1px 0 !important; background: transparent; }

/* Name under logo (Alt Text) */
.thep-logo-gallery.has-names .gallery-item { flex-direction: column; height: auto !important; padding-bottom: 14px !important; }
.thep-logo-gallery.has-names .gallery-icon { height: 112px; flex: none; }
.thep-logo-name { padding: 0 10px; font-size: 13px; line-height: 1.4; text-align: center; color: #4A5568; }

/* Marquee: continuous scroll, optional 2 rows in opposite directions */
.thep-logo-gallery.is-marquee .thep-mq-row { overflow: hidden;
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
	mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.thep-logo-gallery.is-marquee .thep-mq-row + .thep-mq-row { margin-top: var(--thep-gap, 16px); }
.thep-logo-gallery.style-hairline.is-marquee .thep-mq-row + .thep-mq-row { margin-top: -1px; }
.thep-mq-track { display: flex; gap: var(--thep-gap, 16px); width: max-content; padding: 0 var(--thep-gap, 16px) 1px 0;
	animation: thep-mq 60s linear infinite; }
.thep-mq-row.rev .thep-mq-track { animation-direction: reverse; }
.thep-logo-gallery.is-marquee:not(.no-pause) .thep-mq-row:hover .thep-mq-track { animation-play-state: paused; }
.thep-logo-gallery.is-marquee .gallery-item { flex: 0 0 var(--thep-mq-card, 170px);
	width: var(--thep-mq-card, 170px) !important; max-width: var(--thep-mq-card, 170px) !important; }
@keyframes thep-mq { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
	.thep-mq-track { animation: none; }
	.thep-logo-gallery.is-marquee .thep-mq-row { overflow-x: auto; }
}

@media (max-width: 767px) {
	.thep-logo-gallery .gallery-item { height: 96px; }
	.thep-logo-gallery .gallery-icon { padding: 10px; }
	.thep-logo-gallery .gallery-icon img { max-height: 70px !important; }
	.thep-logo-gallery.has-names .gallery-icon { height: 96px; }
	.thep-logo-gallery.is-marquee .gallery-item { flex-basis: var(--thep-mq-card, 140px); width: var(--thep-mq-card, 140px) !important; max-width: var(--thep-mq-card, 140px) !important; }
}
