/* SAMECOM products — grid, cards, gallery, buy box, details. Shared by product pages,
   categories, the [samecom_products] shortcode and landing pages. */

/* Grid & cards */
.samecom-product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: clamp(12px, 2vw, 24px); }
@media (max-width: 480px) { .samecom-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }

.samecom-product-card { display: flex; flex-direction: column; background: var(--samecom-surface); border: 1px solid var(--samecom-border); border-radius: var(--samecom-radius); overflow: hidden; transition: box-shadow .2s, transform .2s; }
.samecom-product-card:hover { box-shadow: var(--samecom-shadow); transform: translateY(-2px); }
.samecom-product-card__media { position: relative; display: block; aspect-ratio: 1 / 1; background: var(--samecom-soft); overflow: hidden; }
.samecom-product-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.samecom-product-card:hover .samecom-product-card__media img { transform: scale(1.04); }
.samecom-product-card__media .samecom-badge { position: absolute; top: 10px; inset-inline-start: 10px; }
.samecom-product-card.is-out-of-stock .samecom-product-card__media img { opacity: .6; }
.samecom-product-card__body { display: flex; flex-direction: column; gap: 6px; padding: 14px; flex: 1; }
.samecom-product-card__cat { font-size: .78rem; color: var(--samecom-muted); text-transform: uppercase; letter-spacing: .03em; }
.samecom-product-card__title { font-size: 1rem; line-height: 1.35; margin: 0; font-weight: 600; }
.samecom-product-card__title a { text-decoration: none; }
.samecom-product-card__title a:hover { color: var(--samecom-primary); }
.samecom-product-card__price { font-size: 1.02rem; }
.samecom-product-card__actions { margin-top: auto; padding-top: 8px; }
@media (max-width: 480px) {
	.samecom-product-card__body { padding: 10px; }
	.samecom-product-card__actions .samecom-btn { min-height: 40px; padding: 8px 10px; font-size: .88rem; }
}

/* Gallery */
.samecom-gallery { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.samecom-gallery__main { position: relative; aspect-ratio: 1 / 1; background: var(--samecom-soft); border-radius: var(--samecom-radius); overflow: hidden; }
.samecom-gallery__main img { width: 100%; height: 100%; object-fit: contain; }
.samecom-gallery__main .samecom-badge { position: absolute; top: 14px; inset-inline-start: 14px; z-index: 1; }
.samecom-gallery__thumbs { position: relative; list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: thin; }
.samecom-gallery__thumb { display: block; width: 72px; height: 72px; padding: 0; border: 2px solid transparent; border-radius: var(--samecom-radius-sm); overflow: hidden; background: var(--samecom-soft); cursor: pointer; flex: none; }
.samecom-gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }
.samecom-gallery__thumb.is-active { border-color: var(--samecom-primary); }
.samecom-gallery__thumb:focus-visible { outline: 3px solid color-mix(in srgb, var(--samecom-primary) 45%, transparent); outline-offset: 1px; }
.samecom-gallery--thumbs-side { flex-direction: row-reverse; align-items: flex-start; }
.samecom-gallery--thumbs-side .samecom-gallery__main { flex: 1; }
.samecom-gallery--thumbs-side .samecom-gallery__thumbs { flex-direction: column; max-height: 520px; overflow-y: auto; }
@media (max-width: 767px) {
	.samecom-gallery--thumbs-side { flex-direction: column; }
	.samecom-gallery--thumbs-side .samecom-gallery__thumbs { flex-direction: row; max-height: none; }
	.samecom-gallery__thumb { width: 60px; height: 60px; }
}

/* Buy box */
.samecom-buy-box { display: flex; flex-direction: column; gap: 16px; margin: 20px 0; }
.samecom-buy-box__price { font-size: 1.6rem; line-height: 1.2; }
.samecom-attribute { border: 0; margin: 0; padding: 0; min-width: 0; }
.samecom-attribute legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.samecom-attribute__chosen { font-weight: 400; color: var(--samecom-muted); }
.samecom-attribute__options { display: flex; flex-wrap: wrap; gap: 8px; }
.samecom-option { display: inline-flex; align-items: center; min-height: 42px; min-width: 48px; padding: 8px 16px; border: 2px solid var(--samecom-border); border-radius: var(--samecom-radius-sm); background: #fff; cursor: pointer; font-weight: 500; justify-content: center; transition: border-color .15s; user-select: none; }
.samecom-option:hover { border-color: var(--samecom-muted); }
input:checked + .samecom-option { border-color: var(--samecom-primary); background: color-mix(in srgb, var(--samecom-primary) 7%, #fff); color: var(--samecom-primary); }
input:focus-visible + .samecom-option { outline: 3px solid color-mix(in srgb, var(--samecom-primary) 45%, transparent); outline-offset: 2px; }
.samecom-option.is-unavailable { opacity: .45; text-decoration: line-through; }
.samecom-buy-box__meta { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
.samecom-sku { font-size: .88rem; color: var(--samecom-muted); }
.samecom-sku[hidden] { display: none; }
.samecom-buy-box__actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.samecom-buy-box__actions .samecom-btn { flex: 1 1 180px; }
.samecom-buy-box__actions .samecom-qty { flex: none; }
@media (max-width: 480px) { .samecom-buy-box__actions .samecom-btn { flex-basis: 100%; } }

/* Summary */
.samecom-summary { min-width: 0; }
.samecom-summary__cats { font-size: .85rem; color: var(--samecom-muted); margin: 0 0 6px; text-transform: uppercase; letter-spacing: .03em; }
.samecom-summary__cats a { text-decoration: none; }
.samecom-summary__title { font-size: clamp(1.5rem, 3vw, 2.1rem); line-height: 1.2; margin: 0 0 12px; }
.samecom-summary__excerpt { color: var(--samecom-muted); }

/* Share */
.samecom-share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .9rem; padding-top: 16px; border-top: 1px solid var(--samecom-border); }
.samecom-share__label { color: var(--samecom-muted); }
.samecom-share__link { padding: 4px 12px; border-radius: 999px; background: var(--samecom-soft); text-decoration: none; }
.samecom-share__link:hover { background: var(--samecom-border); }

/* Details */
.samecom-details { margin: clamp(32px, 5vw, 56px) 0; }
.samecom-details__tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--samecom-border); margin-bottom: 20px; overflow-x: auto; }
.samecom-details__tab { border: 0; background: none; padding: 12px 18px; font: inherit; font-weight: 600; color: var(--samecom-muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.samecom-details__tab[aria-selected="true"] { color: var(--samecom-text); border-bottom-color: var(--samecom-primary); }
.samecom-details__heading { font-size: 1.3rem; margin: 0 0 14px; }
.samecom-details--stacked .samecom-details__panel + .samecom-details__panel { margin-top: 32px; }
.samecom-info-table { width: 100%; border-collapse: collapse; }
.samecom-info-table th, .samecom-info-table td { padding: 10px 12px; border-bottom: 1px solid var(--samecom-border); text-align: start; vertical-align: top; }
.samecom-info-table th { width: 35%; font-weight: 600; background: var(--samecom-soft); }

.samecom-related { margin: clamp(32px, 5vw, 64px) 0; }
