/* photo-grid.css — WC Photo Events */

/* -------------------------------------------------------------------------
   Events grid ([wpe_events] shortcode) — FASE 8
   ---------------------------------------------------------------------- */

.wpe-events-grid {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 280px, 1fr ) );
	gap: 1.5rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.wpe-event-card {
	border: 1px solid #ddd;
	border-radius: 4px;
	overflow: hidden;
	transition: box-shadow 0.2s;
}

.wpe-event-card:hover {
	box-shadow: 0 4px 12px rgba( 0, 0, 0, 0.12 );
}

.wpe-event-card a {
	color: inherit;
	display: block;
	text-decoration: none;
}

.wpe-event-card img {
	display: block;
	height: auto;
	width: 100%;
}

.wpe-event-card h2,
.wpe-event-card p {
	margin: 0;
	padding: 0.5rem 1rem;
}

.wpe-event-card h2 {
	font-size: 1.1rem;
}

.wpe-event-card p {
	color: #666;
	font-size: 0.9rem;
	padding-bottom: 1rem;
}

@media ( max-width: 480px ) {
	.wpe-events-grid {
		grid-template-columns: 1fr;
	}
}

/* -------------------------------------------------------------------------
   Masonry photo grid (archive-product.php) — FASE 9
   ---------------------------------------------------------------------- */

.wpe-photo-grid {
	width: 100%;
}

/* Sizer element — tells Masonry the column width without affecting markup. */
.wpe-photo-sizer,
.wpe-photo {
	box-sizing: border-box;
	width: 33.333%;
}

.wpe-photo {
	overflow: hidden;
	padding-bottom: 1rem;
	padding-right: 1rem;
	position: relative;
}

.wpe-photo img {
	display: block;
	height: auto;
	width: 100%;
}

.wpe-overlay {
	align-items: center;
	background: rgba( 0, 0, 0, 0.4 );
	bottom: 1rem;
	display: flex;
	gap: 1rem;
	justify-content: center;
	left: 0;
	opacity: 0;
	position: absolute;
	right: 1rem;
	top: 0;
	transition: opacity 0.2s;
}

.wpe-photo:hover .wpe-overlay {
	opacity: 1;
}

@media ( pointer: coarse ) {
	.wpe-overlay {
		background: rgba( 0, 0, 0, 0.25 );
		opacity: 1;
	}
}

.wpe-overlay button {
	background: rgba( 255, 255, 255, 0.9 );
	border: none;
	border-radius: 50%;
	cursor: pointer;
	height: 44px;
	padding: 0;
	width: 44px;
}

.wpe-overlay button:hover {
	background: #fff;
}

/* Cart button states */

.wpe-btn-cart.is-loading {
	cursor: not-allowed;
	opacity: 0.5;
}

.wpe-btn-cart.is-in-cart {
	background: #4caf50;
	color: #fff;
}

.wpe-btn-cart.is-error {
	animation: wpe-shake 0.4s ease-in-out;
	background: #f44336;
	color: #fff;
}

@keyframes wpe-shake {
	0%, 100% { transform: translateX( 0 ); }
	25% { transform: translateX( -4px ); }
	75% { transform: translateX( 4px ); }
}

/* Load more button */

#wpe-load-more {
	display: block;
	margin: 2rem auto;
	padding: 0.75rem 2rem;
}

@media ( max-width: 768px ) {
	.wpe-photo-sizer,
	.wpe-photo {
		width: 50%;
	}
}

@media ( max-width: 480px ) {
	.wpe-photo-sizer,
	.wpe-photo {
		width: 100%;
	}

	.wpe-photo {
		padding-right: 0;
	}

	.wpe-overlay {
		right: 0;
	}
}
