/* ============================================================
   Photos Gallery Plugin – Frontend Styles
   ============================================================ */

/* ---- Reset / base ----------------------------------------- */
.pgp-search-wrap *,
.pgp-modal *,
.pgp-cart-sidebar * {
	box-sizing: border-box;
}

/* ---- Search form ------------------------------------------ */
.pgp-search-wrap {
	max-width: 1100px;
	margin: 0 auto;
}

.pgp-search-form {
	margin-bottom: 24px;
}

.pgp-search-fields {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.pgp-search-input {
	width: 100%;
	padding: 12px 18px;
	font-size: 16px;
	border: 2px solid #ddd;
	border-radius: 6px;
	outline: none;
	transition: border-color 0.2s;
}
.pgp-search-input:focus {
	border-color: #555;
}

.pgp-aspect-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 16px;
	font-size: 14px;
}
.pgp-filter-label {
	font-weight: 600;
	color: #555;
}
.pgp-aspect-filters label {
	display: flex;
	align-items: center;
	gap: 4px;
	cursor: pointer;
}

/* ---- Results info ----------------------------------------- */
.pgp-results-info {
	font-size: 13px;
	color: #888;
	margin-bottom: 12px;
	min-height: 20px;
}

/* ---- Results grid ----------------------------------------- */
.pgp-results-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 20px;
}

.pgp-photo-card {
	border: 1px solid #e8e8e8;
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
	transition: box-shadow 0.2s, transform 0.2s;
	display: flex;
	flex-direction: column;
}
.pgp-photo-card:hover {
	box-shadow: 0 4px 16px rgba(0,0,0,0.12);
	transform: translateY(-2px);
}

.pgp-photo-card-thumb {
	background: #f0f0f0;
	aspect-ratio: 3/2;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 40px;
	color: #ccc;
	overflow: hidden;
	position: relative;
}
.pgp-photo-card-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.3s ease;
}
.pgp-photo-card:hover .pgp-photo-card-thumb img {
	transform: scale(1.04);
}
.pgp-thumb-placeholder {
	font-size: 36px;
	color: #ccc;
	user-select: none;
}

.pgp-photo-card-body {
	padding: 12px;
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.pgp-photo-card-catalog {
	font-size: 11px;
	color: #999;
	font-family: monospace;
	letter-spacing: 0.5px;
}

.pgp-photo-card-name {
	font-size: 14px;
	font-weight: 600;
	color: #222;
	line-height: 1.3;
}

.pgp-photo-card-gallery {
	font-size: 12px;
	color: #777;
}

.pgp-photo-card-aspect {
	font-size: 11px;
	color: #aaa;
	margin-top: auto;
	padding-top: 6px;
}

.pgp-photo-card-footer {
	padding: 10px 12px 12px;
}

/* ---- Buttons ---------------------------------------------- */
.pgp-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 20px;
	border: none;
	border-radius: 5px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.2s, opacity 0.2s;
	text-decoration: none;
	gap: 6px;
}
.pgp-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.pgp-btn-primary {
	background: #2c2c2c;
	color: #fff;
}
.pgp-btn-primary:hover:not(:disabled) {
	background: #444;
}

/* Specific modal / cart action buttons — outline style */
#pgp-add-to-cart-confirm,
#pgp-order-submit,
#pgp-proceed-order {
	background: #fff;
	color: #1a1a1a;
	border: 2px solid #1a1a1a;
	transition: background-color 0.18s, color 0.18s, border-color 0.18s;
}
#pgp-add-to-cart-confirm:hover:not(:disabled),
#pgp-order-submit:hover:not(:disabled),
#pgp-proceed-order:hover:not(:disabled) {
	background: #1a1a1a;
	color: #fff;
}

.pgp-btn-secondary {
	background: #f0f0f0;
	color: #333;
}
.pgp-btn-secondary:hover:not(:disabled) {
	background: #ddd;
}

.pgp-btn-full {
	width: 100%;
}

.pgp-btn-sm {
	padding: 6px 12px;
	font-size: 12px;
}

.pgp-btn-add-to-cart {
	background: #fff;
	color: #1a1a1a;
	border: 2px solid #1a1a1a;
	width: 100%;
	transition: background-color 0.18s, color 0.18s;
}
.pgp-btn-add-to-cart:hover {
	background: #1a1a1a;
	color: #fff;
}

/* ---- Modal base ------------------------------------------- */
.pgp-modal {
	position: fixed;
	inset: 0;
	z-index: 99990;
	display: flex;
	align-items: center;
	justify-content: center;
}
.pgp-modal[hidden] {
	display: none !important;
}

.pgp-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,0.55);
}

.pgp-modal-box {
	position: relative;
	background: #fff;
	border-radius: 10px;
	padding: 32px;
	width: 90%;
	max-width: 480px;
	max-height: 90vh;
	overflow-y: auto;
	z-index: 1;
	box-shadow: 0 8px 40px rgba(0,0,0,0.2);
}

.pgp-order-box {
	max-width: 560px;
}

.pgp-modal-close {
	position: absolute;
	top: 12px;
	right: 16px;
	background: none;
	border: none;
	font-size: 24px;
	cursor: pointer;
	color: #999;
	line-height: 1;
	padding: 4px;
}
.pgp-modal-close:hover {
	color: #333;
}

.pgp-modal-title {
	margin: 0 0 20px;
	font-size: 20px;
	font-weight: 700;
}

/* ---- Paper selector modal --------------------------------- */
.pgp-photo-summary {
	background: #f7f7f7;
	border-radius: 6px;
	padding: 10px 14px;
	margin-bottom: 20px;
	font-size: 13px;
}
.pgp-photo-summary strong {
	display: block;
	font-size: 15px;
	margin-bottom: 2px;
}

.pgp-form-group {
	margin-bottom: 16px;
}
.pgp-form-group label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: #555;
	margin-bottom: 5px;
}

.pgp-select {
	width: 100%;
	padding: 9px 12px;
	border: 1px solid #ccc;
	border-radius: 5px;
	font-size: 14px;
	background: #fff;
	appearance: auto;
}
.pgp-select:focus {
	outline: none;
	border-color: #555;
}

.pgp-size-preview {
	font-size: 12px;
	color: #888;
	margin-bottom: 8px;
	min-height: 18px;
}

.pgp-price-display {
	font-size: 22px;
	font-weight: 700;
	color: #222;
	margin-bottom: 20px;
	text-align: center;
}

/* ---- Cart floating button --------------------------------- */
.pgp-cart-btn {
	position: fixed;
	bottom: 28px;
	right: 28px;
	width: 58px;
	height: 58px;
	background: #2c2c2c;
	color: #fff;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	z-index: 99980;
	box-shadow: 0 4px 16px rgba(0,0,0,0.25);
	transition: background 0.2s, transform 0.2s;
	user-select: none;
}
.pgp-cart-btn:hover {
	background: #444;
	transform: scale(1.05);
}

.pgp-cart-icon {
	font-size: 22px;
	line-height: 1;
}

.pgp-cart-count {
	position: absolute;
	top: 2px;
	right: 2px;
	background: #e53e3e;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}
.pgp-cart-count[data-count="0"] {
	display: none;
}

/* ---- Cart sidebar ----------------------------------------- */
.pgp-cart-sidebar {
	position: fixed;
	inset: 0;
	z-index: 99990;
	display: flex;
	justify-content: flex-end;
}
.pgp-cart-sidebar[hidden] {
	display: none !important;
}

.pgp-cart-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,0.45);
}

.pgp-cart-panel {
	position: relative;
	width: 100%;
	max-width: 420px;
	background: #fff;
	display: flex;
	flex-direction: column;
	height: 100%;
	box-shadow: -4px 0 24px rgba(0,0,0,0.15);
	z-index: 1;
}

.pgp-cart-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 24px;
	border-bottom: 1px solid #eee;
}
.pgp-cart-header h2 {
	margin: 0;
	font-size: 18px;
}

.pgp-cart-close {
	background: none;
	border: none;
	font-size: 24px;
	cursor: pointer;
	color: #999;
	padding: 4px;
	line-height: 1;
}
.pgp-cart-close:hover { color: #333; }

.pgp-cart-items {
	flex: 1;
	overflow-y: auto;
	padding: 16px 24px;
}

.pgp-cart-item {
	display: flex;
	gap: 12px;
	padding: 14px 0;
	border-bottom: 1px solid #f0f0f0;
}
.pgp-cart-item:last-child {
	border-bottom: none;
}

.pgp-cart-item-icon {
	width: 48px;
	height: 48px;
	background: #f0f0f0;
	border-radius: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
	flex-shrink: 0;
}

.pgp-cart-item-info {
	flex: 1;
	min-width: 0;
}

.pgp-cart-item-name {
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.pgp-cart-item-catalog {
	font-size: 11px;
	color: #aaa;
	font-family: monospace;
}
.pgp-cart-item-details {
	font-size: 12px;
	color: #777;
	margin-top: 2px;
}
.pgp-cart-item-price {
	font-size: 14px;
	font-weight: 700;
	white-space: nowrap;
}

.pgp-cart-item-remove {
	background: none;
	border: none;
	color: #ccc;
	cursor: pointer;
	font-size: 18px;
	padding: 2px 6px;
	line-height: 1;
	align-self: flex-start;
}
.pgp-cart-item-remove:hover { color: #e53e3e; }

.pgp-cart-footer {
	padding: 20px 24px;
	border-top: 1px solid #eee;
}

.pgp-cart-total {
	display: flex;
	justify-content: space-between;
	font-size: 15px;
	font-weight: 600;
	margin-bottom: 14px;
}

.pgp-cart-empty {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #aaa;
	font-size: 15px;
}
.pgp-cart-empty[hidden] { display: none; }

/* ---- Order form ------------------------------------------- */
.pgp-order-form {
	margin-top: 8px;
}

.pgp-form-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

.pgp-form-group input[type="text"],
.pgp-form-group input[type="email"],
.pgp-form-group input[type="tel"],
.pgp-form-group textarea {
	width: 100%;
	padding: 9px 12px;
	border: 1px solid #ccc;
	border-radius: 5px;
	font-size: 14px;
	font-family: inherit;
}
.pgp-form-group input:focus,
.pgp-form-group textarea:focus {
	outline: none;
	border-color: #555;
}

.pgp-required {
	color: #e53e3e;
}

.pgp-form-error {
	background: #fff5f5;
	border: 1px solid #fed7d7;
	color: #c53030;
	padding: 10px 14px;
	border-radius: 5px;
	font-size: 13px;
	margin-bottom: 14px;
}
.pgp-form-error[hidden] { display: none; }

.pgp-order-summary {
	background: #f7f7f7;
	border-radius: 6px;
	padding: 12px 16px;
	margin-bottom: 20px;
	font-size: 13px;
}
.pgp-order-summary table {
	width: 100%;
	border-collapse: collapse;
}
.pgp-order-summary td {
	padding: 4px 0;
}
.pgp-order-summary .pgp-sum-price {
	text-align: right;
	font-weight: 600;
}
.pgp-order-summary .pgp-sum-total td {
	border-top: 1px solid #ddd;
	padding-top: 8px;
	font-weight: 700;
}

/* ---- Order success ---------------------------------------- */
.pgp-order-success {
	text-align: center;
	padding: 20px 0;
}
.pgp-order-success[hidden] { display: none; }

.pgp-success-icon {
	width: 60px;
	height: 60px;
	background: #48bb78;
	color: #fff;
	border-radius: 50%;
	font-size: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 16px;
}
.pgp-order-success h3 {
	margin: 0 0 8px;
	font-size: 20px;
}

/* ---- Lightbox floating order button ----------------------- */
/* Sits above the cart button; only visible when lightbox shows a known photo.
   z-index must beat Elementor's lightbox (~100000). */
.pgp-lightbox-order-btn {
	position: fixed;
	bottom: 96px;   /* 28 cart-bottom + 58 cart-height + 10 gap */
	right: 28px;
	width: 58px;
	height: 58px;
	background: #fff;
	border: 2px solid #1a1a1a;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	z-index: 999990;
	box-shadow: 0 2px 12px rgba(0,0,0,0.35);
	user-select: none;
	/* hidden by default — JS adds .pgp-lob-visible */
	opacity: 0;
	transform: scale(0.75) translateY(6px);
	pointer-events: none;
	transition: opacity 0.2s, transform 0.22s, background-color 0.18s, border-color 0.18s;
}
/* Explicit SVG fill — do NOT use currentColor; theme CSS overrides it */
.pgp-lightbox-order-btn svg {
	width: 26px;
	height: 26px;
	display: block;
	fill: #1a1a1a;
	transition: fill 0.18s;
}
.pgp-lightbox-order-btn.pgp-lob-visible {
	opacity: 1;
	transform: scale(1) translateY(0);
	pointer-events: auto;
}
.pgp-lightbox-order-btn:hover {
	background: #555;
	border-color: #555;
	transform: scale(1.1);
}
.pgp-lightbox-order-btn:hover svg {
	fill: #fff;
}

/* ---- Post-add notification (appears after adding from lightbox) */
.pgp-lightbox-added-notice {
	position: fixed;
	bottom: 165px;  /* above the two floating buttons */
	right: 20px;
	background: #2c2c2c;
	color: #fff;
	border-radius: 8px;
	padding: 12px 16px 12px 14px;
	font-size: 13px;
	z-index: 99985;
	max-width: 220px;
	box-shadow: 0 4px 20px rgba(0,0,0,0.3);
	line-height: 1.5;
}
.pgp-lightbox-added-notice a {
	color: #90cdf4;
	text-decoration: underline;
	cursor: pointer;
}
.pgp-lightbox-added-notice .pgp-notice-close {
	position: absolute;
	top: 6px;
	right: 8px;
	background: none;
	border: none;
	color: #aaa;
	cursor: pointer;
	font-size: 16px;
	line-height: 1;
	padding: 0;
}

/* ---- Responsive ------------------------------------------- */
@media (max-width: 600px) {
	.pgp-form-row {
		grid-template-columns: 1fr;
	}
	.pgp-cart-panel {
		max-width: 100%;
	}
	.pgp-modal-box {
		padding: 20px;
	}
	.pgp-cart-btn {
		bottom: 16px;
		right: 16px;
	}
	.pgp-lightbox-order-btn {
		bottom: 84px;   /* 16 + 58 + 10 */
		right: 16px;
	}
}
