/* Quick View off-canvas styles. Mirrors cart drawer behavior */

html.quickview-pull-page {
	overflow: hidden;
}

#quickview-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background: rgba(0,0,0,.35);
	z-index: 16000000;
	display: none;
}

#quickview-sidebar {
    font-family: 'Gilroy', sans-serif;
	position: fixed;
	top: 0;
	right: 0;
	width: 420px;
	max-width: 92vw;
	height: 100vh;
	height: 100dvh; /* account for mobile dynamic UI */
	background: #fff;
	box-shadow: -8px 0 24px rgba(0,0,0,.15);
	z-index: 16000005;
	transform: translateX(100%);
	will-change: transform;
	transition: transform .3s ease;
	display: flex;
	flex-direction: column;
    overscroll-behavior: contain;
}

@media (max-width: 768px) {
	#quickview-sidebar { width: 100vw; }
}

html.quickview-pull-page #quickview-sidebar {
	transform: translateX(0);
}

html.quickview-pull-page #quickview-overlay { display: block; }

.quickview-header { padding: 0 16px; }
.quickview-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 0;
}
.quickview-title { font-size: 18px; margin: 0; }
.quickview-close-btn {
	font-size: 24px;
	text-decoration: none;
	line-height: 1;
	color: #333;
    position: absolute;
    top: 0;
    right: 0;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease-in-out;
    border-bottom-left-radius: 15px;
    height: 48px;
    width: 48px;
    padding: 8px;
}
.quickview-close-btn:hover {
    background: #f5efeb;
}
.quickview-body {
	flex: 1;
	overflow: auto;
	padding: 16px;
}
.quickview-variation-title { margin: 0 0 8px;}
/* Quickview header and content stacked */
.qv-header { display: grid; grid-template-columns: 140px 1fr; gap: 16px; align-items: start; margin-bottom: 8px;}
.qv-thumb img { width: 110px; height: 110px; object-fit: cover; border-radius: 12px; display: block; }
.quickview-brand { margin-bottom: 16px; }
.quickview-brand img { height: 22px; width: auto; }
.quickview-title-h3 { font-size: 18px; line-height: 1.25; color: #171717; font-weight: 700; }
.qv-content { margin-top: 8px; }
.quickview-qty .qv-qty-input { width: 36px; height: 42px; border: none; text-align: center; font-weight: 700; }

.quickview-excerpt { color: #171717; font-size: 16px; }
.quickview-excerpt .quickview-excerpt-text {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.quickview-excerpt .quickview-excerpt-more {
  display: none; margin-top: 6px; font-size: 14px; font-weight: 600; text-decoration: underline;
}
.quickview-excerpt .quickview-excerpt-more.visible { display: inline-block; }

/* Variations — self-contained styles (no dependency on PDP classes) */
.quickview-variation-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
/* Make 1 or 2 items stretch full width nicely */
.quickview-variation-options[data-count="1"] { grid-template-columns: 1fr; }
.quickview-variation-options[data-count="2"] { grid-template-columns: 1fr 1fr; }
.quickview-variation-option { background: transparent; border: 0; padding: 0; cursor: pointer; display: block; width: 100%; text-align: left; }
.qv-var-card { background: #F3EEEB; border-radius: 8px; padding: 16px 8px; display: grid; grid-template-columns: 48px 1fr; gap: 8px; align-items: start; box-sizing: border-box; height: 100%; }
.qv-var-card.no-thumb { grid-template-columns: 1fr; }
.quickview-variation-option.is-out { cursor: not-allowed; }
.quickview-variation-option.is-out .qv-var-card { opacity: .5; filter: grayscale(1); }
.qv-var-badge { display: inline-block; margin-top: 4px; font-size: 11px; font-weight: 600; color: #A00; }
.qv-var-thumb { width: 48px; height: 48px; border-radius: 8px; overflow: hidden; }
.qv-var-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.qv-var-info { display: block; }
.qv-var-text { display: flex; flex-direction: column; gap: 4px; }
.qv-var-title { margin: 0; font-size: 14px; font-weight: 700; color: #171717; line-height: normal;}
.qv-var-price { font-size: 14px; color: #008541; white-space: nowrap; }
.qv-var-desc { margin: 0; font-size: 10px; color: #444; }
.qv-var-price s {
    color: #999;
    margin-left: 4px;
    font-weight: 600;
    font-size: 12px;
}
.quickview-variation-option.active .qv-var-card { outline: 1px solid #171717; }


.quickview-footer {
	padding: 16px;
	border-top: 1px solid #eee;
	position: sticky;
	bottom: 0;
	background: #fff;
	padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    z-index: 1;
}

/* Footer layout */
.quickview-footer-inner { display: flex; flex-direction: column; gap: 12px; }
.quickview-qtyline { display: flex; align-items: center; justify-content: space-between; }
.quickview-qty-label { font-size: 16px; font-weight: 600; color: #171717; }

/* Quantity (styled independently but matching cart look) */
.qv-quantity { display:flex; align-items:center; justify-content:center; width: 96px; border:1px solid #171717; border-radius:8px; box-sizing:border-box; font-family: inherit; font-size:16px; }
.qv-qty-input { width:36px; height: 100%; text-align:center; font-weight:700; font-size:16px; line-height:1; border:none; background:transparent; appearance:textfield; outline:none; padding:0; margin:0; box-sizing:border-box; pointer-events:none; }
.qv-numb { font-size:16px; font-weight:700; color:#171717; line-height:1; padding:0; user-select:none; display:flex; align-items:center; justify-content:center; width:18px; border:none; background:transparent; }
.qv-numb:hover { background: transparent; }
.qv-numb.qv-numb-minus { margin-left:8px; cursor: pointer; }
.qv-numb.qv-numb-plus { margin-right:8px; cursor: pointer; }

/* Add To Cart full width */
.quickview-actions .btn { width: 100%; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; }
.quickview-actions .btn svg { margin-right: 8px; }

/* View details link */
.quickview-details-link { text-align: center; display: block; text-decoration: underline; margin-top: 4px; }

.quickview-loader {
	padding: 48px 24px;
	text-align: center;
	color: #666;
    font-size: 16px;
}

.quickview-gallery img { width: 100%; height: auto; border-radius: 8px; }

.quickview-meta h3 { margin: 0 0 8px; font-size: 18px; }
.quickview-price { font-size: 18px; font-weight: 600; color: #008541; margin-bottom: 8px; }
.quickview-oldprice { font-size: 14px; text-decoration: line-through; color: #999; margin-left: 10px; }
.quickview-variations { margin: 12px 0; }
.quickview-variation-group { margin: 10px 0; }
 .quickview-variation-options { display: flex; flex-wrap: wrap; gap: 8px; }
 /* Default: up to 2 in a row */
 .quickview-variation-options .quickview-variation-option { flex: 1 1 calc((100% - 8px)/2); max-width: calc((100% - 8px)/2); }
/* If only 1 or 2 total options in the group – stretch */
.quickview-variation-options[data-count="1"] .quickview-variation-option { flex-basis: 100%; max-width: 100%; }
.quickview-variation-options[data-count="2"] .quickview-variation-option { flex-basis: calc((100% - 8px)/2); max-width: calc((100% - 8px)/2); }
.quickview-variation-option { cursor: pointer; }
.quickview-variation-option.active { border-color: #333; }

.quickview-actions { display: flex; gap: 8px; margin-top: 8px; }
.quickview-actions .btn { flex: 1; height: 48px; background: var(--clr-atc-bgr, #008541); color: #fff; border: 0; border-radius: 8px; }
.quickview-actions .btn:hover { background: var(--clr-atc-bgr-hover, #016835); }
.quickview-body { -webkit-overflow-scrolling: touch; }
/* Inline trigger inside product card (injected via JS) */
.quickview-fab {
	position: absolute;
	right: 16px;
	top: 16px;
	width: 36px;
	max-width: 180px;
	height: 36px;
	border-radius: 18px;
	background: rgba(255,255,255,.9);
	box-shadow: 0 2px 10px rgba(0,0,0,.1);
	border: 1px solid #eee;
	cursor: pointer;
	padding: 0;
	text-indent: -9999px;
	z-index: 10;
	transition: background-color .2s ease, box-shadow .2s ease, transform .08s ease, width .18s ease;
	overflow: hidden;
}
.quickview-fab:hover,
.quickview-fab:focus-visible {
	background: rgba(255, 131, 56, 0.9);
	box-shadow: 0 4px 16px rgba(0,0,0,.18);
}
.quickview-fab:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba(255,131,56,.35), 0 4px 16px rgba(0,0,0,.18);
}
.quickview-fab:active {
	transform: translateY(0) scale(0.98);
	box-shadow: 0 2px 8px rgba(0,0,0,.14);
}
.quickview-fab:after{
	content: '';
	position: absolute;
	left: 9px;
	top: 9px;
	width: 18px;
	height: 18px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24'%3E%3Cpath fill='%23333' d='M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5A6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5S14 7.01 14 9.5S11.99 14 9.5 14'/%3E%3C/svg%3E") no-repeat center center;
}
.quickview-fab:hover:after,
.quickview-fab:focus-visible:after{
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5A6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5S14 7.01 14 9.5S11.99 14 9.5 14'/%3E%3C/svg%3E") no-repeat center center;
}

.product-item-container.quickview-ready { position: relative; }

.quickview-fab:before{
	content: attr(data-label);
	position: absolute;
	left: 36px;
	top: 0;
	height: 36px;
	line-height: 36px;
	color: #333;
	display: inline-flex;
	align-items: center;
	text-indent: 0;
	pointer-events: none;
	font-size: 13px;
	white-space: nowrap;
	opacity: 0;
	transform: translateX(8px);
	transition: opacity .18s ease, transform .18s ease;
}
@media (max-width: 767px) {
	.quickview-fab {
		right: 8px;
		top: 8px;
	}
}
@media (prefers-reduced-motion: reduce) {
	.quickview-fab {
		transition: none;
	}
}

/* Desktop-only expansion on card hover */
@media (hover: hover) and (pointer: fine) and (min-width: 1024px) {
	.product-item-container:hover .quickview-fab {
		width: 120px;
	}
	.product-item-container:hover .quickview-fab:before{
		opacity: 1;
		transform: translateX(0);
		color: #333;
	}

}

/* Цвет, фон и инверсия иконки меняем только при ховере самой кнопки */
.quickview-fab:hover,
.quickview-fab:focus-visible {
    border: 1px solid rgba(255, 131, 56, 0.9);
	background: rgba(255, 131, 56, 0.9);
	box-shadow: 0 4px 16px rgba(0,0,0,.18);
	color: #fff;
}
.quickview-fab:hover:before,
.quickview-fab:focus-visible:before { color: #fff!important; }
.quickview-fab:hover:after,
.quickview-fab:focus-visible:after{
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5A6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5S14 7.01 14 9.5S11.99 14 9.5 14'/%3E%3C/svg%3E") no-repeat center center;
}

