/* Trilian Commerce -- frontend styles */

/* Expandable Info Sections (Elementor accordion widget) -- built on native
   <details>/<summary>, so no JS is required for expand/collapse; this CSS
   only handles the +/- indicator and layout. */
.tc-accordion {
	width: 100%;
}
.tc-accordion-item {
	border-bottom: 1px solid #ddd;
}
.tc-accordion-item + .tc-accordion-item {
	margin-top: 0;
}
.tc-accordion-title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 4px;
	font-weight: 600;
	letter-spacing: 0.02em;
	cursor: pointer;
	list-style: none; /* hide default marker (Chrome/Safari use ::-webkit-details-marker below) */
}
.tc-accordion-title::-webkit-details-marker {
	display: none;
}
.tc-accordion-title::marker {
	content: '';
}
.tc-accordion-icon {
	position: relative;
	flex: 0 0 auto;
	width: 14px;
	height: 14px;
}
.tc-accordion-icon::before,
.tc-accordion-icon::after {
	content: '';
	position: absolute;
	background: currentColor;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
}
.tc-accordion-icon::before {
	width: 14px;
	height: 2px;
}
.tc-accordion-icon::after {
	width: 2px;
	height: 14px;
	transition: transform 0.15s ease;
}
.tc-accordion-item[open] .tc-accordion-icon::after {
	transform: translate(-50%, -50%) rotate(90deg);
	opacity: 0; /* the vertical bar rotates away, leaving just the horizontal bar -- a "+" becomes a "-" */
}
.tc-accordion-content {
	padding: 0 4px 16px;
}
.tc-accordion-content > *:first-child {
	margin-top: 0;
}
.tc-accordion-content > *:last-child {
	margin-bottom: 0;
}

.tc-products-grid {
	--tc-grid-columns: 0;
	display: grid;
	grid-template-columns: repeat(var(--tc-grid-columns, auto-fill), minmax(220px, 1fr));
	gap: 24px;
	list-style: none;
	margin: 0;
	padding: 0;
}
.tc-products-grid[style*="--tc-grid-columns"] {
	grid-template-columns: repeat(var(--tc-grid-columns), 1fr);
}

.tc-product {
	border: 1px solid #e2e2e2;
	border-radius: 6px;
	padding: 16px;
	text-align: center;
}

.tc-product img {
	/* display:block + margin:0 auto centers the image regardless of what
	   the active theme's own global "img" styles set display to -- many
	   themes set img { display: block } as a baseline reset, which quietly
	   defeats text-align:center on this card (text-align only centers
	   inline/inline-block content, never block-level elements). Setting
	   both explicitly here means this always centers correctly no matter
	   what the theme does, while max-width:100%/height:auto keep it
	   responsive at any card width. */
	display: block;
	max-width: 100%;
	height: auto;
	margin: 0 auto 10px;
}

.tc-product-images,
.tc-product-image-main {
	text-align: center;
}

.tc-product-image-main img {
	display: block;
	max-width: 100%;
	height: auto;
	margin: 0 auto;
}

.tc-product-image {
	text-align: center;
}

.tc-product-image img {
	display: block;
	max-width: 100%;
	height: auto;
	margin: 0 auto;
}

.tc-product-title {
	font-size: 15px;
	margin: 8px 0 4px;
}

.tc-product-price ins {
	text-decoration: none;
	color: #b32d2e;
}

.tc-single-product {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 32px;
}

.tc-cart-table, .tc-cart-totals {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 20px;
}

.tc-cart-table td, .tc-cart-table th,
.tc-cart-totals td, .tc-cart-totals th {
	padding: 10px;
	border-bottom: 1px solid #eee;
	text-align: left;
}

.tc-quantity-input, .tc-cart-qty {
	width: 60px;
}

.tc-checkout-columns {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 32px;
}

.tc-checkout-billing p, .tc-checkout-billing label {
	display: block;
	margin-bottom: 10px;
}

.tc-checkout-billing input {
	display: block;
	width: 100%;
	padding: 8px;
	margin-top: 4px;
}

.tc-payment-method {
	border: 1px solid #e2e2e2;
	border-radius: 6px;
	padding: 12px;
	margin-bottom: 10px;
}

.tc-gateway-warning {
	color: #b32d2e;
	font-weight: bold;
}

.tc-notices .tc-notice {
	padding: 10px 14px;
	border-radius: 4px;
	margin-bottom: 12px;
}

.tc-notice--success { background: #e7f6e7; border: 1px solid #b7e0b7; }
.tc-notice--error   { background: #fbe7e7; border: 1px solid #f0b7b7; }

.tc-product-gallery-thumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 10px;
}

.tc-gallery-thumb {
	display: block;
	border: 2px solid transparent;
	border-radius: 4px;
	overflow: hidden;
	line-height: 0;
}

.tc-gallery-thumb img {
	width: 70px;
	height: 70px;
	object-fit: cover;
	margin: 0;
}

.tc-gallery-thumb.is-active {
	border-color: #b32d2e;
}

/* Product image lightbox -----------------------------------------------
   Click the main product image on the single product page (default
   layout, or the Elementor Product Image widget -- both share this exact
   markup) to view it full-size, with prev/next through the featured
   image plus every gallery image. Built from scratch, no external
   library, matching this plugin's zero-dependency approach. See the
   matching block in assets/js/frontend.js for the behavior. */

.tc-product-image-main {
	cursor: zoom-in;
}

body.tc-lightbox-open {
	overflow: hidden;
}

.tc-lightbox-overlay {
	position: fixed;
	inset: 0;
	background: rgba( 0, 0, 0, 0.85 );
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 100000;
	padding: 40px;
	box-sizing: border-box;
}

.tc-lightbox-overlay[hidden] {
	display: none;
}

.tc-lightbox-image-wrap {
	max-width: 90vw;
	max-height: 90vh;
	display: flex;
	align-items: center;
	justify-content: center;
}

.tc-lightbox-image-wrap img {
	max-width: 90vw;
	max-height: 90vh;
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
	margin: 0;
}

.tc-lightbox-close,
.tc-lightbox-prev,
.tc-lightbox-next {
	position: absolute;
	background: rgba( 255, 255, 255, 0.1 );
	border: none;
	color: #fff;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	padding: 12px 16px;
	border-radius: 4px;
	transition: background-color 0.15s ease;
}

.tc-lightbox-close:hover,
.tc-lightbox-prev:hover,
.tc-lightbox-next:hover {
	background: rgba( 255, 255, 255, 0.25 );
}

.tc-lightbox-close {
	top: 20px;
	right: 20px;
}

.tc-lightbox-prev {
	left: 20px;
	top: 50%;
	transform: translateY( -50% );
}

.tc-lightbox-next {
	right: 20px;
	top: 50%;
	transform: translateY( -50% );
}

.tc-lightbox-counter {
	position: absolute;
	bottom: 20px;
	left: 50%;
	transform: translateX( -50% );
	color: #fff;
	font-size: 14px;
	opacity: 0.8;
}

@media ( max-width: 600px ) {
	.tc-lightbox-prev,
	.tc-lightbox-next {
		padding: 8px 12px;
		font-size: 22px;
	}
	.tc-lightbox-overlay {
		padding: 16px;
	}
}

/* Product Carousel (Elementor widget) --------------------------------- */

.tc-elementor-product-carousel .tc-carousel {
	--tc-carousel-items: 4;
	--tc-carousel-gap: 20px;
	display: flex;
	align-items: center;
	gap: 8px;
}

.tc-carousel-viewport {
	flex: 1 1 auto;
	overflow-x: auto;
	scroll-behavior: smooth;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.tc-carousel-viewport::-webkit-scrollbar {
	display: none;
}

.tc-carousel-track {
	display: flex;
	gap: var(--tc-carousel-gap);
	list-style: none;
	margin: 0;
	padding: 0;
}

.tc-carousel-item {
	flex: 0 0 calc((100% - (var(--tc-carousel-items) - 1) * var(--tc-carousel-gap)) / var(--tc-carousel-items));
	scroll-snap-align: start;
	border: 1px solid #e2e2e2;
	border-radius: 6px;
	padding: 16px;
	text-align: center;
}

.tc-carousel-item img {
	display: block;
	max-width: 100%;
	height: auto;
	margin: 0 auto 10px;
}

.tc-carousel-arrow {
	flex: 0 0 auto;
	background: none;
	border: none;
	font-size: 32px;
	line-height: 1;
	cursor: pointer;
	padding: 4px 8px;
	color: inherit;
}

.tc-carousel-dots {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 14px;
}

.tc-carousel-dot {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background-color: #d5d5d5;
	border: none;
	padding: 0;
	cursor: pointer;
}

.tc-carousel-dot.is-active {
	background-color: #333;
}

/* Variation "Choose a size" selector -------------------------------- */

.tc-variation-selector {
	margin: 4px 0 16px;
}

.tc-variation-selector-label {
	font-weight: 600;
	margin: 0 0 8px;
}

.tc-size-options {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.tc-size-option {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	min-width: 100px;
	background: #fff;
	border: 1px solid #d5d5d5;
	border-radius: 4px;
	padding: 10px 14px;
	cursor: pointer;
	text-align: left;
	line-height: 1.3;
}

.tc-size-option:hover:not([disabled]) {
	border-color: #999;
}

.tc-size-option.is-selected {
	border-color: #1d1d1d;
	border-width: 2px;
	padding: 9px 13px; /* keep the box the same size when the border thickens */
	box-shadow: 0 0 0 1px #1d1d1d inset;
}

.tc-size-option[disabled] {
	opacity: 0.45;
	cursor: not-allowed;
	background: #f7f7f7;
}

.tc-size-option-label {
	font-weight: 600;
}

.tc-size-option-price {
	font-size: 13px;
	color: #444;
}

.tc-size-option-note {
	font-size: 11px;
	color: #b32d2e;
}

.tc-variation-availability {
	font-size: 13px;
	color: #2a7a2a;
	min-height: 1em;
	margin: 8px 0 0;
}

.tc-variation-availability:empty {
	margin: 0;
}

@media (max-width: 782px) {
	.tc-single-product, .tc-checkout-columns {
		grid-template-columns: 1fr;
	}
}
