<?php
/**
 * WooCommerce storefront styles.
 *
 * @package DAFStory
 */

defined( 'ABSPATH' ) || exit;

/* ── Shop archive ── */
.shop-page__header {
	margin-bottom: 2rem;
	padding-bottom: 1.25rem;
	border-bottom: 1px solid var(--border-hairline);
}
.shop-page .product-grid,
.shop-page ul.products {
	grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr));
	gap: 2.25rem 1.5rem;
}
.shop-page__title {
	font-family: var(--font-nav);
	font-size: clamp(1.75rem, 3.5vw, 2.5rem);
	font-weight: 700;
	letter-spacing: -.03em;
	margin: 0 0 .5rem;
}
.shop-page__subtitle {
	margin: 0;
	max-width: 42ch;
	color: var(--muted);
	font-size: .9375rem;
	line-height: 1.55;
}
.shop-page__toolbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	flex-wrap: wrap;
	margin-bottom: 2.75rem;
	padding: 0 0 1rem;
	border-bottom: 1px solid var(--border-hairline);
}
.shop-page__toolbar-count .woocommerce-result-count {
	margin: 0;
	font-family: var(--font-nav);
	font-size: .75rem;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--dim);
}
.shop-page__toolbar-filters { margin-left: auto; }

/* ── Shop ordering / filter selects ── */
.shop-ordering {
	display: flex;
	align-items: center;
	gap: .65rem;
	margin: 0;
}
.shop-ordering__label {
	font-family: var(--font-nav);
	font-size: .6875rem;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--dim);
	white-space: nowrap;
}
.shop-ordering__control {
	position: relative;
	display: inline-flex;
	align-items: center;
}
.shop-ordering__select,
.shop-filter select,
.shop-page__sidebar .woocommerce-widget-layered-nav-dropdown select,
.shop-page__sidebar .dropdown_layered_nav_select {
	appearance: none;
	-webkit-appearance: none;
	min-width: 11.5rem;
	background: rgba(255,255,255,.05);
	border: 1px solid var(--border-hairline);
	color: var(--text);
	border-radius: 999px;
	padding: .58rem 2.35rem .58rem 1rem;
	font-family: var(--font-nav);
	font-size: .8125rem;
	font-weight: 600;
	cursor: pointer;
	transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.shop-ordering__select:hover,
.shop-filter select:hover,
.shop-page__sidebar .woocommerce-widget-layered-nav-dropdown select:hover {
	border-color: color-mix(in srgb, var(--accent) 32%, transparent);
	background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.shop-ordering__select:focus,
.shop-filter select:focus,
.shop-page__sidebar .woocommerce-widget-layered-nav-dropdown select:focus {
	outline: none;
	border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
.shop-ordering__chevron {
	position: absolute;
	right: .85rem;
	pointer-events: none;
	color: var(--muted);
}

/* ── Shop sidebar filters ── */
.shop-page__sidebar .widget {
	margin-bottom: 1.5rem;
	padding-bottom: 1.25rem;
	border-bottom: 1px solid var(--border-hairline);
}
.shop-page__sidebar .widget-title {
	font-family: var(--font-nav);
	font-size: .6875rem;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--dim);
	margin: 0 0 .85rem;
}
.shop-page__sidebar .woocommerce-widget-layered-nav-list {
	list-style: none;
	margin: 0;
	padding: 0;
}
.shop-page__sidebar .woocommerce-widget-layered-nav-list li {
	margin: 0 0 .35rem;
}
.shop-page__sidebar .woocommerce-widget-layered-nav-list a {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: .5rem;
	padding: .45rem .65rem;
	border-radius: 999px;
	font-size: .8125rem;
	color: var(--muted);
	text-decoration: none;
	transition: background .15s ease, color .15s ease;
}
.shop-page__sidebar .woocommerce-widget-layered-nav-list a:hover,
.shop-page__sidebar .woocommerce-widget-layered-nav-list .chosen a {
	color: var(--accent);
	background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.shop-page__sidebar .widget_price_filter .price_slider_wrapper {
	padding-top: .35rem;
}
.shop-page__sidebar .widget_price_filter .ui-slider {
	height: 3px;
	background: var(--border-hairline);
	border: 0;
	margin: 1rem .5rem 1.25rem;
}
.shop-page__sidebar .widget_price_filter .ui-slider .ui-slider-range {
	background: var(--accent);
}
.shop-page__sidebar .widget_price_filter .ui-slider .ui-slider-handle {
	width: 1rem;
	height: 1rem;
	top: -.35rem;
	border-radius: 50%;
	background: var(--accent);
	border: 2px solid var(--bg);
}

/* ── Borderless dynamic shop cards ── */
.product-card--shop {
	background: transparent;
	border: none;
	border-radius: 0;
	padding: 0;
	box-shadow: none;
}
.product-card--shop:hover,
.product-card--shop.is-visible:hover,
.product-card--shop.reveal.is-visible:hover {
	box-shadow: none;
	transform: translateY(-6px);
}
.product-card--shop .product-card__media {
	margin-bottom: 1.1rem;
	border-radius: calc(var(--radius) + 4px);
	background: transparent;
	box-shadow: 0 14px 36px rgba(0,0,0,.22);
	touch-action: pan-y;
}
@media (hover: hover) and (pointer: fine) {
	.product-card--shop .product-card__media {
		transition: transform .35s cubic-bezier(.22, 1, .36, 1), box-shadow .35s cubic-bezier(.22, 1, .36, 1);
		transform-style: preserve-3d;
		will-change: transform;
	}
}
.product-card--shop:hover .product-card__media {
	box-shadow: 0 24px 52px rgba(0,0,0,.32);
}
.product-card--shop .product-card__media::after {
	background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,.4));
	opacity: 0;
}
.product-card--shop:hover .product-card__media::after { opacity: 1; }
.product-card--shop .product-card__media img {
	transition: transform .5s cubic-bezier(.22, 1, .36, 1);
}
.product-card--shop:hover .product-card__media img {
	transform: scale(1.06);
}
.product-card--shop .product-card__body {
	text-align: left;
	padding: 0;
}
.product-card--shop .product-card__title {
	font-family: var(--font-nav);
	font-size: 1.05rem;
	font-weight: 700;
	letter-spacing: -.02em;
}
.product-card--shop .product-card__excerpt {
	font-size: .8125rem;
	color: var(--muted);
	-webkit-line-clamp: 3;
}
.product-card--shop .product-card__price {
	font-size: .9375rem;
	margin-top: .25rem;
}
.product-card--shop .product-card__action {
	padding-top: .65rem;
	opacity: 0;
	transform: translateY(6px);
	transition: opacity .25s ease, transform .25s ease;
}
.product-card--shop:hover .product-card__action,
.product-card--shop:focus-within .product-card__action {
	opacity: 1;
	transform: none;
}
.product-card--shop .product-card__action .button,
.product-card--shop .product-card__action a.button {
	width: auto !important;
	display: inline-flex !important;
	padding: .55rem 1.1rem !important;
	background: transparent !important;
	color: var(--accent) !important;
	border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent) !important;
}
.product-card--shop .product-card__action .button:hover,
.product-card--shop .product-card__action a.button:hover {
	background: var(--accent) !important;
	color: #fff !important;
}

.woocommerce-notices-wrapper { margin-bottom: 1rem; }

/* ── Single product ── */
.wc-single-product { padding: 1.5rem 0 4rem; }
.wc-single-product__hero {
	display: grid;
	grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
	gap: clamp(1.5rem, 4vw, 3.5rem);
	align-items: start;
	margin-bottom: 3rem;
	padding-top: .5rem;
}
.wc-single-product .onsale {
	position: absolute;
	top: .75rem;
	left: .75rem;
	z-index: 2;
	padding: .25rem .55rem;
	font-family: var(--font-nav);
	font-size: .625rem;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: #fff;
	background: var(--gold);
	border-radius: 999px;
}
.wc-single-product__gallery {
	position: relative;
}
.wc-single-product__gallery .woocommerce-product-gallery {
	position: relative;
	background: rgba(255,255,255,.03);
	border: 1px solid var(--border-hairline);
	border-radius: calc(var(--radius) + 4px);
	overflow: hidden;
}
.wc-single-product__gallery .woocommerce-product-gallery__wrapper,
.wc-single-product__gallery .woocommerce-product-gallery__image {
	margin: 0;
}
.wc-single-product__gallery .woocommerce-product-gallery__image img {
	width: 100%;
	height: auto;
	display: block;
	border-radius: calc(var(--radius) + 4px);
	touch-action: pan-y;
	-webkit-user-drag: none;
}
@media (hover: hover) and (pointer: fine) {
	.wc-single-product__gallery .woocommerce-product-gallery__image img {
		cursor: zoom-in;
	}
}
.woocommerce-product-gallery.is-zoomed .woocommerce-product-gallery__image img {
	cursor: zoom-out;
	transform: scale(2.2);
}
.woocommerce-product-gallery.is-zoomed {
	overflow: hidden;
}
.wc-single-product__gallery .flex-control-thumbs {
	display: flex;
	gap: .5rem;
	list-style: none;
	margin: .75rem 0 0;
	padding: 0;
	flex-wrap: wrap;
}
.wc-single-product__gallery .flex-control-thumbs li {
	width: calc(20% - .4rem);
	margin: 0;
}
.wc-single-product__gallery .flex-control-thumbs img {
	border-radius: var(--radius);
	border: 1px solid transparent;
	opacity: .65;
	cursor: pointer;
	transition: opacity .15s ease, border-color .15s ease;
}
.wc-single-product__gallery .flex-control-thumbs img.flex-active,
.wc-single-product__gallery .flex-control-thumbs img:hover {
	opacity: 1;
	border-color: var(--accent);
}
.wc-single-product__summary .product_title {
	font-family: var(--font-read);
	font-size: clamp(1.5rem, 3vw, 2.125rem);
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: -.025em;
	margin: 0 0 .75rem;
}
.wc-single-product__summary .woocommerce-product-details__short-description {
	color: var(--muted);
	font-size: 1rem;
	line-height: 1.7;
	margin-bottom: 1.25rem;
}
.wc-single-product__summary .price {
	font-family: var(--font-nav);
	font-size: 1.125rem;
	font-weight: 700;
	color: var(--text);
	margin-bottom: 1.25rem;
}
.wc-single-product__summary .price del {
	opacity: .5;
	margin-right: .4rem;
	font-weight: 500;
}
.wc-single-product__summary .price ins {
	text-decoration: none;
	color: var(--accent);
}
.wc-single-product__summary form.cart {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .75rem;
	margin-bottom: 1.25rem;
}
.wc-single-product__summary .quantity {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--border-hairline);
	border-radius: 999px;
	overflow: hidden;
	background: rgba(255,255,255,.03);
}
.wc-single-product__summary .quantity .qty {
	width: 3rem;
	background: transparent;
	border: 0;
	color: var(--text);
	text-align: center;
	font-family: var(--font-nav);
	font-size: .875rem;
	padding: .55rem 0;
	-moz-appearance: textfield;
}
.wc-single-product__summary .quantity .qty::-webkit-outer-spin-button,
.wc-single-product__summary .quantity .qty::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}
.wc-single-product__summary .product_meta {
	font-size: .75rem;
	color: var(--dim);
	padding-top: 1rem;
	border-top: 1px solid var(--border-hairline);
}
.wc-single-product__summary .product_meta > span {
	display: block;
	margin-bottom: .35rem;
}
.wc-single-product__summary .product_meta a {
	color: var(--muted);
	text-decoration: none;
}
.wc-single-product__summary .product_meta a:hover { color: var(--accent); }

.wc-product-panel {
	margin-top: 2.5rem;
	padding-top: 2rem;
	border-top: 1px solid var(--border-hairline);
}
.wc-product-panel__title {
	font-family: var(--font-nav);
	font-size: .6875rem;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--dim);
	margin: 0 0 1rem;
}
.wc-product-panel__content {
	font-family: var(--font-read);
	font-size: 1.0625rem;
	line-height: 1.8;
	color: var(--muted);
	max-width: 48rem;
}
.wc-product-panel__content p:last-child { margin-bottom: 0; }

.wc-related {
	margin-top: 3.5rem;
	padding-top: 2rem;
	border-top: 1px solid var(--border-hairline);
}
.wc-related__title {
	font-family: var(--font-nav);
	font-size: .6875rem;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--dim);
	margin: 0 0 1.25rem;
}

/* ── Global WooCommerce buttons & forms ── */
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.woocommerce .button,
.woocommerce .product-card__action .button {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	gap: .35rem;
	padding: .7rem 1.35rem !important;
	font-family: var(--font-nav) !important;
	font-size: .75rem !important;
	font-weight: 700 !important;
	letter-spacing: .06em !important;
	text-transform: uppercase !important;
	background: var(--accent) !important;
	color: #fff !important;
	border: 0 !important;
	border-radius: 999px !important;
	text-decoration: none !important;
	cursor: pointer;
	transition: opacity .15s ease, transform .15s ease, background .15s ease !important;
}
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce .button:hover {
	opacity: .92;
	color: #fff !important;
	transform: translateY(-1px);
}
.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce input.button.alt {
	background: var(--gold) !important;
}
.woocommerce a.button.disabled,
.woocommerce button.button:disabled {
	opacity: .45 !important;
	cursor: not-allowed;
	transform: none !important;
}

.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
	list-style: none;
	margin: 0 0 1rem;
	padding: .85rem 1rem;
	border-radius: var(--radius);
	font-size: .875rem;
	border: 1px solid var(--border-hairline);
	background: rgba(255,255,255,.03);
}
.woocommerce-error { border-color: rgba(220,80,80,.35); color: #f5b0b0; }
.woocommerce-message { border-color: color-mix(in srgb, var(--accent) 26%, transparent); }
.woocommerce-info { border-color: rgba(255,255,255,.08); color: var(--muted); }

/* ── Cart & checkout ── */
.woocommerce-cart .shop_table,
.woocommerce-checkout .shop_table,
.woocommerce-account .woocommerce-MyAccount-navigation + .woocommerce-MyAccount-content .shop_table {
	width: 100%;
	border-collapse: collapse;
	font-size: .875rem;
}
.woocommerce table.shop_table th,
.woocommerce table.shop_table td {
	padding: .85rem .5rem;
	border-bottom: 1px solid var(--border-hairline);
	text-align: left;
	vertical-align: middle;
}
.woocommerce table.shop_table th {
	font-family: var(--font-nav);
	font-size: .6875rem;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--dim);
}
.woocommerce table.shop_table .product-thumbnail img {
	width: 4rem;
	border-radius: var(--radius);
}
.woocommerce-cart-form .actions .coupon {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
}
.woocommerce-cart-form .actions .coupon input {
	background: rgba(255,255,255,.04);
	border: 1px solid var(--border-hairline);
	color: var(--text);
	border-radius: 999px;
	padding: .55rem .85rem;
	font-size: .8125rem;
}
.woocommerce .cart-collaterals,
.woocommerce-checkout .col2-set {
	margin-top: 2rem;
}
.woocommerce .cart_totals,
.woocommerce-checkout #order_review {
	background: rgba(255,255,255,.03);
	border: 1px solid var(--border-hairline);
	border-radius: calc(var(--radius) + 4px);
	padding: 1.25rem;
}
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select {
	width: 100%;
	background: rgba(255,255,255,.04);
	border: 1px solid var(--border-hairline);
	color: var(--text);
	border-radius: var(--radius);
	padding: .6rem .75rem;
	font-family: var(--font-ui);
	font-size: .875rem;
}
.woocommerce form .form-row label {
	font-size: .75rem;
	font-weight: 600;
	color: var(--muted);
	margin-bottom: .35rem;
}

/* ── Account ── */
.woocommerce-account .woocommerce {
	display: grid;
	grid-template-columns: 12rem 1fr;
	gap: 2rem;
}
.woocommerce-MyAccount-navigation ul {
	list-style: none;
	margin: 0;
	padding: 0;
}
.woocommerce-MyAccount-navigation a {
	display: block;
	padding: .55rem 0;
	font-size: .8125rem;
	color: var(--muted);
	text-decoration: none;
	border-bottom: 1px solid var(--border-hairline);
}
.woocommerce-MyAccount-navigation .is-active a,
.woocommerce-MyAccount-navigation a:hover {
	color: var(--accent);
}

/* ── Breadcrumbs ── */
.wc-single-product__breadcrumb-wrap {
	padding-top: 1.25rem;
	margin-bottom: .25rem;
}
.woocommerce-breadcrumb {
	font-family: var(--font-nav);
	font-size: .6875rem;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--dim);
	margin-bottom: 0;
	padding-bottom: 0;
	line-height: 1.6;
}
.woocommerce-breadcrumb a {
	color: var(--muted);
	text-decoration: none;
	transition: color .15s ease;
}
.woocommerce-breadcrumb a:hover { color: var(--accent); }
.wc-single-product__breadcrumb-wrap .woocommerce-breadcrumb {
	padding-bottom: 1rem;
	margin-bottom: 1.5rem;
	border-bottom: 1px solid var(--border-hairline);
}
.shop-page--archive > .woocommerce-breadcrumb {
	margin-bottom: 1.5rem;
	padding-bottom: 1rem;
	border-bottom: 1px solid var(--border-hairline);
}

/* ── Shop archive spacing (default WC loop markup) ── */
.shop-page--archive .woocommerce-result-count,
.shop-page--generic .woocommerce-result-count {
	margin: 0 0 1rem;
	font-family: var(--font-nav);
	font-size: .75rem;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--dim);
}
.shop-page--archive .shop-ordering,
.shop-page--archive .woocommerce-ordering,
.shop-page--generic .shop-ordering,
.shop-page--generic .woocommerce-ordering {
	margin-bottom: 2.75rem;
}
.shop-page--archive ul.products,
.shop-page--generic ul.products {
	margin-top: .25rem;
}

@media (max-width: 900px) {
	.wc-single-product__hero { grid-template-columns: 1fr; }
	.woocommerce-account .woocommerce { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
	.shop-page__toolbar { flex-direction: column; align-items: stretch; }
	.shop-page__toolbar-filters { margin-left: 0; width: 100%; }
	.shop-ordering { flex-direction: column; align-items: stretch; width: 100%; }
	.shop-ordering__control,
	.shop-ordering__select { width: 100%; }
	.product-card--shop .product-card__action {
		opacity: 1;
		transform: none;
	}
	.wc-single-product__summary form.cart { flex-direction: column; align-items: stretch; }
	.wc-single-product__summary .button { width: 100%; }

	/* Shop e categorie prodotto */
	.shop-page__header,
	.shop-page__header .term-description {
		text-align: center;
	}
	.shop-page__subtitle {
		margin-inline: auto;
	}

	/* Card prodotto */
	.product-card__body,
	.product-card--shop .product-card__body {
		text-align: center;
	}
	.product-card--shop .product-card__action {
		display: flex;
		justify-content: center;
	}
	.product-card--shop .product-card__action .button,
	.product-card--shop .product-card__action a.button {
		width: auto !important;
	}

	/* Singolo prodotto */
	.wc-single-product__summary {
		text-align: center;
	}
	.wc-single-product__summary .woocommerce-product-details__short-description,
	.wc-single-product__summary .price,
	.wc-single-product__summary .product_meta {
		text-align: center;
	}
	.wc-single-product__summary .woocommerce-product-details__short-description [class*="has-text-align-left"],
	.wc-single-product__summary .woocommerce-product-details__short-description .alignleft {
		text-align: left;
	}
	.wc-single-product__summary .woocommerce-product-details__short-description [class*="has-text-align-right"],
	.wc-single-product__summary .woocommerce-product-details__short-description .alignright {
		text-align: right;
	}
	.wc-single-product__summary form.cart {
		align-items: center;
	}
}
