/*
 * Single product page (loaded only there). Overrides WooCommerce with selectors of the same or higher
 * specificity; !important only where the upload plugin uses it. Colours come from the theme variables.
 *
 * Rhythm of the buy box (golden scale): 12 → 20 → 32 → 52px between related, grouped and separate parts.
 */

/* ==========================================================
   0. Hidden parts
   ========================================================== */
.woocommerce div.product .woocommerce-variation-price,
.woocommerce div.product .woocommerce-product-gallery__trigger,
.woocommerce div.product .select2-container {
	display: none;
}

/* ==========================================================
   1. Layout: gallery and buy box
   ========================================================== */
.maxend-product-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 2rem;
	align-items: start;
}

/* The gallery column is exactly thumbnails + a square that fits the window (it stays in view while the buy box
   scrolls), at most 56% of the row; the buy box takes the rest, so no empty band opens between them. */
@media (min-width: 1024px) {
	.maxend-product-layout {
		grid-template-columns: min(56%, calc(100svh - 12rem + 5.75rem)) minmax(0, 1fr);
		gap: 3rem;
	}
}

@media (min-width: 1280px) {
	.maxend-product-layout {
		gap: 4rem;
	}
}

.woocommerce div.product div.summary.maxend-buybox {
	float: none;
	width: auto;
	margin: 0;
}

/* ==========================================================
   2. Gallery
   ========================================================== */
.woocommerce div.product div.images.woocommerce-product-gallery {
	float: none;
	width: 100%;
	margin: 0;
	opacity: 1;
	display: flex;
	flex-direction: column-reverse;
	gap: 0.75rem;
}

@media (min-width: 768px) {
	.woocommerce div.product div.images.woocommerce-product-gallery {
		display: grid;
		grid-template-columns: 76px minmax(0, 1fr);
		gap: 1rem;
		align-items: start;
	}

	.woocommerce div.product div.images.woocommerce-product-gallery.is-single {
		grid-template-columns: minmax(0, 1fr);
	}
}

.woocommerce div.product div.images .woocommerce-product-gallery__wrapper {
	grid-column: -2 / -1;
	margin: 0;
	border-radius: 1rem;
	overflow: hidden;
	background: var(--color-stone-50);
	box-shadow: inset 0 0 0 1px var(--color-stone-200);
}

/* One photo at a time; WooCommerce would otherwise lay the rest out as 25% tiles under the first. */
.woocommerce div.product div.images .woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image {
	display: none;
	width: 100%;
	margin: 0;
}

.woocommerce div.product div.images .woocommerce-product-gallery__wrapper:not(.custom-gallery-ready) .woocommerce-product-gallery__image:first-child,
.woocommerce div.product div.images .woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image.is-active {
	display: block;
	animation: maxend-fade 0.25s ease-out;
}

.woocommerce div.product div.images .woocommerce-product-gallery__image a {
	display: block;
	cursor: zoom-in;
}

/* One photo at a time beside the thumbnail column (the user's preferred gallery): square and filled, so switching
   photos never makes the page jump. From 1024px the square fits the window height, because the gallery
   stays in view next to the buy box (.maxend-product-layout sizes its column for that). */
.woocommerce div.product div.images .woocommerce-product-gallery__image img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: cover;
}

.maxend-custom-thumbnails {
	display: flex;
	gap: 0.625rem;
	overflow-x: auto;
	scrollbar-width: none;
	padding: 2px;
}

.maxend-custom-thumbnails::-webkit-scrollbar {
	display: none;
}

@media (min-width: 768px) {
	.maxend-custom-thumbnails {
		grid-column: 1 / 2;
		grid-row: 1;
		flex-direction: column;
		overflow-x: visible;
	}
}

.maxend-thumb-item {
	flex-shrink: 0;
	width: 64px;
	height: 64px;
	padding: 0;
	border: 0;
	border-radius: 0.75rem;
	overflow: hidden;
	cursor: pointer;
	background: var(--color-stone-50);
	box-shadow: inset 0 0 0 1px var(--color-stone-200);
	opacity: 0.7;
	transition: opacity 0.2s, box-shadow 0.2s;
}

@media (min-width: 768px) {
	.maxend-thumb-item {
		width: 76px;
		height: 76px;
	}
}

.maxend-thumb-item:hover,
.maxend-thumb-item.is-active {
	opacity: 1;
	box-shadow: 0 0 0 2px var(--color-ink);
}

.maxend-thumb-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

@keyframes maxend-fade {
	from { opacity: 0.4; }
	to { opacity: 1; }
}

/* The upload plugin indents its box (wrapper padding, handler margin); here it lines up with the label. */
.woocommerce div.product .wc-dnd-file-upload {
	padding: 0;
}

.woocommerce div.product .wc-dnd-file-upload .codedropz-upload-handler {
	margin: 0 !important;
}

.woocommerce div.product .wc-dnd-file-upload .codedropz-upload-container {
	padding: 0 !important;
}

/* ==========================================================
   3. Buy box: title, price
   ========================================================== */
.maxend-buybox__price {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem;
	margin-top: 1.25rem;
}

.woocommerce div.product .maxend-buybox__price .price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0 0.625rem;
	margin: 0;
	font-family: var(--font-display);
	font-size: 1.875rem;
	font-weight: 500;
	line-height: 1.1;
	color: var(--color-ink);
}

.woocommerce div.product .maxend-buybox__price .price ins {
	order: -1;
	text-decoration: none;
	font-weight: 500;
}

.woocommerce div.product .maxend-buybox__price .price del {
	font-family: var(--font-sans);
	font-size: 1rem;
	font-weight: 600;
	color: var(--color-stone-500);
	opacity: 1;
}

/* The heart sits at the row's end as an icon; its label stays for screen readers (the row would wrap otherwise). */
.maxend-buybox__price [data-maxend-favorite] {
	width: 44px;
	padding: 0;
	justify-content: center;
}

.maxend-buybox__price [data-maxend-favorite-label] {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.maxend-buybox__badge {
	display: inline-flex;
	align-items: center;
	height: 1.75rem;
	padding: 0 0.75rem;
	border-radius: 999px;
	background: var(--color-brand-100);
	color: var(--color-brand-800);
	font-size: 13px;
	font-weight: 700;
}

.maxend-buybox__form {
	margin-top: 1.25rem;
	padding-top: 2rem;
	border-top: 1px solid var(--color-stone-200);
}

.woocommerce div.product .maxend-buybox form.cart {
	display: flex;
	flex-direction: column;
	margin: 0;
}

/* ==========================================================
   4. Options as buttons (assets/js/product.js)
   ========================================================== */
.woocommerce div.product form.cart table.variations {
	width: 100%;
	margin: 0 0 2rem;
	border: 0;
}

.woocommerce div.product form.cart table.variations tbody {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

.woocommerce div.product form.cart table.variations tr,
.woocommerce div.product form.cart table.variations th,
.woocommerce div.product form.cart table.variations td {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	text-align: left;
	line-height: 1.4;
}

.woocommerce div.product form.cart table.variations th.label {
	margin-bottom: 0.75rem;
}

.woocommerce div.product form.cart table.variations th.label label,
.woocommerce div.product .wc-dnd-file-upload > label {
	display: block;
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	color: var(--color-ink);
}

/* The select stays for WooCommerce and for no-JS visitors; with the buttons in place it is only visually hidden. */
.woocommerce div.product form.cart table.variations select {
	width: 100%;
	max-width: 100%;
	height: 48px;
	margin: 0;
	padding: 0 1rem;
	border: 1px solid var(--color-stone-300);
	border-radius: 0.75rem;
	background-color: #fff;
	font-size: 15px;
	font-weight: 600;
	color: var(--color-ink);
}

.woocommerce div.product form.cart table.variations select.maxend-options-select {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	border: 0;
	white-space: nowrap;
}

.maxend-options {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.maxend-option {
	min-width: 4.5rem;
	height: 44px;
	padding: 0 1rem;
	border: 1px solid var(--color-stone-300);
	border-radius: 999px;
	background: #fff;
	color: var(--color-ink);
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}

.maxend-option:hover {
	border-color: var(--color-ink);
}

.maxend-option.is-selected {
	border-color: var(--color-ink);
	background: var(--color-ink);
	color: #fff;
}

.maxend-option.is-unavailable {
	border-style: dashed;
	color: var(--color-stone-400);
	text-decoration: line-through;
	cursor: not-allowed;
}

.woocommerce div.product form.cart .reset_variations {
	display: inline-block;
	margin-top: 0.75rem;
	font-size: 13px;
	font-weight: 600;
	color: var(--color-stone-600);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.woocommerce div.product form.cart .reset_variations:hover {
	color: var(--color-ink);
}

.woocommerce div.product form.cart .single_variation_wrap .woocommerce-variation-description:not(:empty) {
	margin-bottom: 1.25rem;
	font-size: 14px;
	color: var(--color-stone-700);
}

/* ==========================================================
   5. Photo upload (Drag and Drop Multiple File Upload)
   ========================================================== */
.woocommerce div.product .wc-dnd-file-upload {
	grid-area: upload;
	width: 100%;
	margin: 0;
}

.woocommerce div.product .wc-dnd-file-upload > label {
	margin-bottom: 0.75rem;
}

.codedropz-upload-wrapper,
.codedropz-upload-handler {
	width: 100% !important;
	box-sizing: border-box !important;
}

.codedropz-upload-handler {
	border: 0 !important;
	padding: 0 !important;
}

.codedropz-upload-inner {
	display: flex !important;
	flex-direction: column !important;
	align-items: center !important;
	justify-content: center !important;
	width: 100% !important;
	padding: 2rem 1rem !important;
	border: 1.5px dashed var(--color-stone-300) !important;
	border-radius: 1rem !important;
	background: var(--color-paper) !important;
	color: var(--color-stone-600) !important;
	font-weight: 600 !important;
	text-align: center !important;
	transition: border-color 0.2s ease, background-color 0.2s ease !important;
}

.codedropz-upload-inner:hover {
	border-color: var(--color-brand-500) !important;
	background: var(--color-brand-50) !important;
}

/* Turkish copy is long: on narrow screens the button wraps below instead of overflowing the box. */
.wc-dnd-file-upload .codedropz-upload-inner .codedropz-label {
	flex-wrap: wrap;
	row-gap: 0.5rem;
	font-size: 15px;
	line-height: 1.5;
}

.wc-dnd-file-upload .wc-upload-wrap .codedropz-upload-inner a.cd-upload-btn {
	padding: 0.55rem 1.15rem;
	border-radius: 999px;
	background-color: var(--color-ink);
	font-size: 13px;
	font-weight: 700;
	transition: background-color 0.2s ease;
}

.wc-dnd-file-upload .wc-upload-wrap .codedropz-upload-inner a.cd-upload-btn:hover {
	background-color: var(--color-brand-700);
}

.codedropz-upload-wrapper .codedropz--results {
	margin-top: 0.75rem;
}

/* Stock line (Maxend_Cart texts): "Stokta var", "Son 3 adet" or "Stokta yok" with a coloured dot. */
.woocommerce div.product p.stock {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0 0 1.25rem;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.3;
	color: #047857;
}

.woocommerce div.product p.stock::before {
	content: "";
	width: 8px;
	height: 8px;
	border-radius: 999px;
	background: currentColor;
}

.woocommerce div.product p.stock.maxend-stock-low {
	color: #b45309;
}

.woocommerce div.product p.stock.out-of-stock {
	color: #b91c1c;
}

.woocommerce div.product .maxend-stock-hint {
	margin: -0.5rem 0 1.25rem;
}

/* ==========================================================
   6. Purchase: quantity, add to cart, buy now
   ========================================================== */
.woocommerce div.product .woocommerce-variation-add-to-cart,
.woocommerce div.product form.cart.maxend-purchase-grid {
	display: grid;
	grid-template-columns: 8.25rem minmax(0, 1fr);
	grid-template-areas:
		"upload upload"
		"qty add"
		"buy buy";
	gap: 0.75rem;
	width: 100%;
}

/* One left: WooCommerce prints a hidden field, so the empty pill states the quantity itself. */
.woocommerce div.product form.cart div.quantity:has(> input.qty[type="hidden"])::after {
	content: "1 adet";
	margin: auto;
	font-size: 15px;
	font-weight: 700;
	color: var(--color-ink);
}

/* "Stokta en fazla 3 adet var" (product.js) gets its own row under quantity and add to cart. */
.woocommerce div.product .woocommerce-variation-add-to-cart:has(.maxend-qty-limit),
.woocommerce div.product form.cart.maxend-purchase-grid:has(.maxend-qty-limit) {
	grid-template-areas:
		"upload upload"
		"qty add"
		"limit limit"
		"buy buy";
}

.woocommerce div.product .maxend-qty-limit {
	grid-area: limit;
	margin: -0.25rem 0 0;
	font-size: 13px;
	font-weight: 600;
	color: #b45309;
}

.woocommerce div.product .woocommerce-variation-add-to-cart .wc-dnd-file-upload,
.woocommerce div.product form.cart.maxend-purchase-grid .wc-dnd-file-upload {
	margin-bottom: 1.25rem;
}

.woocommerce div.product form.cart div.quantity {
	grid-area: qty;
	float: none;
	display: flex;
	align-items: center;
	height: 52px;
	margin: 0;
	border: 1px solid var(--color-stone-300);
	border-radius: 999px;
	background: #fff;
	overflow: hidden;
}

.woocommerce div.product form.cart div.quantity .qty {
	flex: 1;
	min-width: 0;
	width: auto;
	height: 100%;
	padding: 0;
	border: 0;
	background: transparent;
	font-size: 16px;
	font-weight: 700;
	color: var(--color-ink);
	text-align: center;
	-moz-appearance: textfield;
	appearance: textfield;
}

.woocommerce div.product form.cart div.quantity .qty::-webkit-inner-spin-button,
.woocommerce div.product form.cart div.quantity .qty::-webkit-outer-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.maxend-qty-btn {
	flex-shrink: 0;
	width: 40px;
	height: 100%;
	border: 0;
	background: transparent;
	color: var(--color-ink);
	font-size: 20px;
	font-weight: 500;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.15s;
}

.maxend-qty-btn:hover {
	background: var(--color-stone-100);
}

.woocommerce div.product form.cart .single_add_to_cart_button.button {
	grid-area: add;
	float: none;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 52px;
	margin: 0;
	padding: 0 1.25rem;
	border: 1.5px solid var(--color-ink);
	border-radius: 999px;
	background: #fff;
	color: var(--color-ink);
	font-size: 15px;
	font-weight: 700;
	line-height: 1;
	text-transform: none;
	letter-spacing: 0;
	transition: background-color 0.2s, color 0.2s;
}

.woocommerce div.product form.cart .single_add_to_cart_button.button:hover {
	background: var(--color-ink);
	color: #fff;
}

.woocommerce div.product form.cart .single_add_to_cart_button.button.disabled,
.woocommerce div.product form.cart .single_add_to_cart_button.button.disabled:hover {
	opacity: 0.45;
	background: #fff;
	color: var(--color-ink);
	cursor: not-allowed;
}

.maxend-buy-now-btn {
	grid-area: buy;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 56px;
	border: 0;
	border-radius: 999px;
	background: var(--color-ink);
	color: #fff;
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
	transition: background-color 0.2s;
}

.maxend-buy-now-btn:hover {
	background: var(--color-brand-700);
}

/* WooCommerce marks the box until a variation is chosen; "Satın Al" looks as unavailable as "Sepete Ekle". */
.woocommerce-variation-add-to-cart-disabled .maxend-buy-now-btn,
.woocommerce-variation-add-to-cart-disabled .maxend-buy-now-btn:hover {
	opacity: 0.45;
	background: var(--color-ink);
	cursor: not-allowed;
}

.maxend-product-assurance {
	margin-top: 2rem;
}

/* ==========================================================
   7. Details row: description, reviews, studio steps
   ========================================================== */
.maxend-product-details {
	margin-top: 3.25rem;
}

@media (min-width: 768px) {
	.maxend-product-details {
		margin-top: 5.25rem;
	}
}

.product-description-content p {
	margin-bottom: 1rem;
}

.product-description-content p:last-child {
	margin-bottom: 0;
}

.product-description-content ul {
	list-style: disc;
	padding-left: 1.25rem;
	margin-bottom: 1rem;
}

.maxend-product-reviews .woocommerce-Reviews-title {
	display: none;
}

.maxend-product-reviews .woocommerce-noreviews {
	padding: 1.5rem;
	border-radius: 1rem;
	background: var(--color-stone-50);
	color: var(--color-stone-600);
	font-size: 15px;
	font-weight: 600;
}

.maxend-product-reviews .commentlist {
	margin: 0;
	padding: 0;
	list-style: none;
}

.maxend-product-reviews .commentlist li {
	margin-bottom: 1rem;
	padding: 1.25rem;
	border-radius: 1rem;
	background: #fff;
	box-shadow: inset 0 0 0 1px var(--color-stone-200);
}

.maxend-product-reviews .commentlist .comment_container {
	display: flex;
	gap: 1rem;
	align-items: flex-start;
}

.maxend-product-reviews .commentlist img.avatar {
	width: 44px;
	height: 44px;
	border-radius: 50%;
}

.maxend-product-reviews .comment-text {
	flex-grow: 1;
}

.maxend-product-reviews .commentlist .meta {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 0.5rem;
	font-size: 13px;
	color: var(--color-stone-600);
}

.maxend-product-reviews .commentlist .meta strong {
	color: var(--color-ink);
	font-weight: 700;
	font-size: 15px;
}

.maxend-product-reviews .commentlist .description {
	font-size: 15px;
	color: var(--color-stone-700);
	line-height: 1.7;
}

.maxend-product-reviews .commentlist .description p {
	margin-bottom: 0;
}

.maxend-product-reviews .star-rating {
	float: right;
	overflow: hidden;
	position: relative;
	height: 1em;
	line-height: 1;
	font-size: 14px;
	width: 5.4em;
	font-family: star;
	color: var(--color-brand-500);
}

.maxend-product-reviews .star-rating::before {
	content: "\73\73\73\73\73";
	color: var(--color-stone-200);
	float: left;
	top: 0;
	left: 0;
	position: absolute;
}

.maxend-product-reviews .star-rating span {
	overflow: hidden;
	float: left;
	top: 0;
	left: 0;
	position: absolute;
	padding-top: 1.5em;
}

.maxend-product-reviews .star-rating span::before {
	content: "\53\53\53\53\53";
	top: 0;
	position: absolute;
	left: 0;
	color: var(--color-brand-500);
}

/* "Yorum Yazın" (product.js) stands where the folded form would start. */
#reviews > .maxend-btn-outline {
	margin-top: 1.5rem;
}

#review_form_wrapper {
	margin-top: 1.5rem;
	padding: 1.5rem;
	border-radius: 1rem;
	background: var(--color-stone-50);
}

.comment-reply-title {
	display: block;
	margin-bottom: 1.25rem;
	font-family: var(--font-display);
	font-weight: 500;
	font-size: 20px;
	color: var(--color-ink);
}

.comment-form p {
	margin-bottom: 1rem;
}

.comment-form label {
	display: block;
	margin-bottom: 0.5rem;
	font-weight: 600;
	font-size: 13px;
	color: var(--color-stone-700);
}

.comment-form .comment-form-cookies-consent {
	display: flex;
	align-items: flex-start;
	gap: 0.6rem;
}

.comment-form .comment-form-cookies-consent input {
	margin-top: 0.2rem;
	accent-color: var(--color-ink);
}

.comment-form .comment-form-cookies-consent label {
	margin: 0;
	font-weight: 500;
	line-height: 1.5;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form textarea {
	width: 100%;
	padding: 0.875rem 1rem;
	border: 1px solid var(--color-stone-300);
	border-radius: 0.75rem;
	background: #fff;
	color: var(--color-ink);
	font-weight: 600;
	outline: none;
}

.comment-form input:focus,
.comment-form textarea:focus {
	border-color: var(--color-brand-500);
}

.comment-form .form-submit input[type="submit"] {
	padding: 0.875rem 1.5rem;
	border: 0;
	border-radius: 999px;
	background: var(--color-ink);
	color: #fff;
	font-weight: 700;
	cursor: pointer;
}

.comment-form .form-submit input[type="submit"]:hover {
	background: var(--color-brand-700);
}

/* ==========================================================
   8. Related products and the phone buy bar
   ========================================================== */
.maxend-related:not(:has(section)) {
	display: none;
}

.maxend-sticky-buy {
	position: fixed;
	inset: auto 0 0 0;
	z-index: 40;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
	background: rgb(255 255 255 / 0.96);
	backdrop-filter: blur(8px);
	border-top: 1px solid var(--color-stone-200);
	box-shadow: 0 -12px 30px -18px color-mix(in srgb, var(--color-ink) 35%, transparent);
	transform: translateY(110%);
	transition: transform 0.3s ease;
}

.maxend-sticky-buy.is-visible {
	transform: translateY(0);
}

.maxend-sticky-buy__price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0 0.4rem;
	min-width: 0;
	font-size: 17px;
	font-weight: 700;
	color: var(--color-ink);
	line-height: 1.2;
}

.maxend-sticky-buy__price del {
	margin: 0;
	font-size: 12px;
	color: var(--color-stone-500);
}

.maxend-sticky-buy__price ins {
	order: -1;
	font-size: 17px;
	text-decoration: none;
}

.maxend-sticky-buy__btn {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	height: 48px;
	text-decoration: none;
	padding: 0 1.75rem;
	border: 0;
	border-radius: 999px;
	background: var(--color-ink);
	color: #fff;
	font-weight: 700;
	font-size: 14px;
	cursor: pointer;
}

.maxend-sticky-buy__btn:hover {
	background: var(--color-brand-700);
}

/* Gallery and form stack below 1024px; the bar brings the form back on tablets too. */
@media (max-width: 1023px) {
	body.single-product {
		padding-bottom: 76px;
	}
}

@media (min-width: 1024px) {
	.maxend-sticky-buy {
		display: none;
	}
}
