/**
 * Quick View Modal - Consolidated Styles
 * 
 * All styles scoped to .qv-modal to avoid affecting other components.
 * 
 * @package RinnoTools
 */

/* ============================================
   MODAL OVERLAY/BACKDROP
   ============================================ */

/* Default state: Completely hidden and non-interactive */
.qv-modal {
	display: none !important;
	visibility: hidden;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: -1; /* Negative z-index when hidden to ensure it doesn't interfere */
	background: rgba(0, 0, 0, 0.5);
	backdrop-filter: none; /* Theme: Remove blur to match theme */
	-webkit-backdrop-filter: none;
	overflow-y: auto;
	opacity: 0;
	pointer-events: none; /* Prevent any interaction when hidden */
	transition: opacity 0.3s ease;
}

/* Active state: Visible and interactive */
.qv-modal.qv-modal--show {
	display: block !important;
	visibility: visible;
	z-index: 9999; /* Restore high z-index when shown */
	opacity: 1;
	pointer-events: auto; /* Enable interaction when shown */
	animation: none; /* Theme: Remove heavy animations */
}

/* ============================================
   MODAL DIALOG & CONTENT
   ============================================ */

.qv-modal-dialog {
	max-width: 1000px; /* Theme: Match theme container */
	width: 95%;
	margin: 40px auto;
	padding: 20px;
	position: relative;
}

@media (max-width: 991px) {
	.qv-modal-dialog {
		margin: 20px auto;
		padding: 15px;
	}
}

.qv-modal-content {
	/* Theme: Match product-card styling */
	background: #fff;
	border-radius: 2px; /* Theme standard: 2px */
	box-shadow: inset 0 0 0 1px #ededed; /* Same as product-card */
	overflow: hidden;
	position: relative;
	/* Theme: Remove heavy animations, use theme transitions */
	transform: none;
	opacity: 1;
	transition: box-shadow 0.2s ease;
}

.qv-modal-content:before {
	content: "";
	display: block;
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	z-index: 1;
	pointer-events: none;
	border-radius: 2px;
	box-shadow: inset 0 0 0 1px #ededed;
	transition: box-shadow 0.2s;
}

.qv-modal.qv-modal--show .qv-modal-content {
	transform: none;
	opacity: 1;
	animation: none; /* Theme: Remove heavy animations */
}

/* ============================================
   MODAL HEADER
   ============================================ */

.qv-modal-header {
	padding: 18px 24px; /* Theme: Match product-card padding */
	background: #fff;
	border-bottom: 1px solid #ededed; /* Theme border color */
	box-shadow: none; /* Theme: Remove heavy shadow */
	position: relative;
	z-index: 2;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.qv-modal-title {
	font-size: 15px; /* Theme: Match product-card__name */
	font-weight: 500; /* Theme: Match theme */
	color: #3d464d; /* Theme dark color */
	letter-spacing: 0;
	margin: 0;
}

/* Close button - match theme icon buttons */
.qv-modal-close {
	width: calc(1.5rem + 2px); /* Match btn-svg-icon */
	height: calc(1.5rem + 2px);
	padding: 7px; /* Match product-card__quickview */
	background: transparent; /* Match theme */
	border: none;
	border-radius: 0 2px 0 2px; /* Match product-card__quickview */
	font-size: 18px;
	line-height: 1;
	color: #ccc; /* Match product-card__quickview */
	transition: background-color 0.2s, color 0.2s;
	box-shadow: none;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	outline: none;
}

.qv-modal-close:hover,
.qv-modal-close:focus {
	background: rgba(17, 112, 118, 1); /* Theme yellow */
	color: #3d464d; /* Theme dark */
	transform: none; /* Theme: Remove rotation */
	box-shadow: none;
	outline: none;
}

.qv-modal-close:active {
	background: #3d464d; /* Theme dark on active */
	color: #fff;
	transform: none;
}

.qv-modal-close:focus-visible {
	outline: 2px solid #ffd333;
	outline-offset: 2px;
}

/* ============================================
   MODAL BODY
   ============================================ */

.qv-modal-body {
	padding: 0;
	position: relative;
	z-index: 2;
}

/* ============================================
   PRODUCT GRID LAYOUT
   ============================================ */

.qv-modal .qv-product {
	display: flex;
    align-items: center;
    gap: 0;
    min-height: auto;
}

@media (max-width: 991px) {
	.qv-modal .qv-product {
		flex-direction: column;
	}
}

/* ============================================
   IMAGE SECTION
   ============================================ */

.qv-modal .qv-image {
	background: #fff;
	padding: 18px; /* Theme: Match product-card__image */
	display: flex;
	align-items: center;
	justify-content: center;
	border-right: 1px solid #ededed;
	position: relative;
}

@media (max-width: 991px) {
	.qv-modal .qv-image {
		border-right: none;
		border-bottom: 1px solid #ededed;
		padding: 18px;
	}
}

.qv-modal .qv-image-img {
	max-width: 100%;
	height: auto;
	border-radius: 0; /* Theme: Remove rounded corners to match theme */
	box-shadow: none; /* Theme: Remove heavy shadow */
	transition: none;
	object-fit: contain;
}

.qv-modal .qv-image:hover .qv-image-img {
	transform: none; /* Theme: Remove scale effect */
}

.qv-modal .qv-link {
	display: block;
	text-decoration: none;
	color: inherit;
}

.qv-modal .qv-link:hover {
	opacity: 0.9;
}

/* ============================================
   CONTENT SECTION
   ============================================ */

.qv-modal .qv-content {
	padding: 2px 24px 24px; /* Theme: Match product-card__info */
	display: flex;
	flex-direction: column;
	gap: 0;
	overflow-y: auto;
	max-height: calc(100vh - 200px);
	background: #fff;
}

@media (max-width: 991px) {
	.qv-modal .qv-content {
		padding: 2px 22px 24px;
		max-height: none;
		overflow-y: visible;
	}
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

.qv-modal .qv-title {
	margin: 0;
	line-height: 19px; /* Theme: Match product-card__name */
}

.qv-modal .qv-title .qv-link {
	font-size: 25px;
    color: #3d464d;
    line-height: 1.2;
    letter-spacing: 0;
    text-decoration: none;
    display: block;
    transition: color 0.15s;
    margin-bottom: 5px;
}

.qv-modal .qv-title .qv-link:hover {
	color: rgba(17, 112, 118, 1); /* Theme link hover */
}

/* Rating - match product-card__rating */
.qv-modal .qv-rating {
	margin-top: 6px;
	display: flex;
	align-items: center;
	gap: 9px;
	flex-wrap: wrap;
}

.qv-modal .qv-rating-stars {
	display: inline-flex;
	align-items: center;
	gap: 2px;
}

.qv-modal .qv-rating-stars .qv-star {
	display: inline-block;
	font-size: 14px;
	line-height: 1;
	color: #ffd333; /* Theme yellow for stars */
	width: 14px;
	height: 14px;
}

.qv-modal .qv-rating-stars .qv-star--full {
	color: #ffd333;
}

.qv-modal .qv-rating-stars .qv-star--half {
	color: #ffd333;
	opacity: 0.5;
}

.qv-modal .qv-rating-stars .qv-star--empty {
	color: #ededed;
}

.qv-modal .qv-reviews-count {
	font-size: 13px; /* Theme: Match product-card__rating-legend */
	line-height: 1;
	color: #b3b3b3; /* Match theme */
	font-weight: 500;
}

/* ============================================
   PRICE
   ============================================ */

.qv-modal .qv-price {
	font-size: inherit; /* Theme: Use theme default */
	font-weight: 700; /* Theme: Match product-card__prices */
	color: #3d464d; /* Theme: Match product-card__prices */
	display: block;
	line-height: 1;
	margin-top: 14px; /* Theme: Match product-card__prices */
	padding: 0;
	background: transparent;
	border: none;
	box-shadow: none;
	width: auto;
	letter-spacing: 0;
}


.qv-modal .qv-price del {
	font-size: 14px;
    color: #8b8b8b;
	font-weight: 400;
	text-decoration: line-through;
	margin-right: 8px;
}

.qv-modal .qv-price ins {
	text-decoration: none;
}


.qv-modal .qv-price ins span {
	font-size: 18px;
    color: #383838;
}

/* ============================================
   STOCK STATUS
   ============================================ */

.qv-modal .qv-stock-status {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin-top: 8px;
}

.qv-modal .qv-stock-status .text-success,
.qv-modal .qv-stock-status .text-danger,
.qv-modal .qv-stock-status .text-warning {
	display: inline-flex;
	align-items: center;
	padding: 5px 8px 4px; /* Theme: Match product-card__badge */
	border-radius: 1.5px; /* Theme: Match product-card__badge */
	font-size: 11px; /* Theme: Match product-card__badge */
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	line-height: 1;
	box-shadow: none;
	border: none;
	margin-bottom: 4px;
	margin-right: 4px;
}

.qv-modal .qv-stock-status .text-success {
	color: #fff;
}

.qv-modal .qv-stock-status .text-danger {
	color: #fff;
}

.qv-modal .qv-stock-status .text-warning {
	color: #fff;
}

/* ============================================
   DESCRIPTION
   ============================================ */

.qv-modal .qv-description {
	font-size: 15px;
    line-height: 1.4;
    color: #6c757d;
    margin: 10px 0 6px;
    max-height: none;
    overflow-y: visible;
}

.qv-modal .qv-description p {
	margin: 0 0 8px 0;
}

.qv-modal .qv-description p:last-child {
	margin-bottom: 0;
}

.qv-modal .qv-description::-webkit-scrollbar {
	display: none; /* Theme: Remove scrollbar */
}

/* ============================================
   VARIATIONS - BUTTONS/PILLS
   ============================================ */

.qv-modal .qv-variations {
	padding: 0;
	background: transparent;
	border: none;
	border-radius: 0;
	display: none;
	margin: 16px 0 0 0;
}

.qv-modal .qv-variations.qv-variations--show {
	display: block;
}

.qv-modal .qv-variation-attributes {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin: 0;
	padding: 0;
}

.qv-modal .qv-variation-field {
	display: flex;
	flex-direction: column;
	gap: 8px;
	background: transparent;
	border: none;
	padding: 0;
	margin: 0;
}

.qv-modal .qv-variation-label {
	font-size: 13px; /* Theme: Match theme secondary text */
	font-weight: 500;
	color: #3d464d; /* Theme dark */
	text-transform: none;
	letter-spacing: 0;
	margin-bottom: 0;
}

.qv-modal .qv-variation-select {
	display: none; /* Hidden - replaced by buttons via JS */
}

.qv-modal .qv-variation-options {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Variation buttons - match theme button style */
.qv-modal .qv-variation-option {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.25rem 0.5625rem; /* Theme: Match theme button small size */
	border: 1px solid #dee2e6; /* Theme: Match btn-secondary border */
	border-radius: 4px; /* Theme: Match theme buttons */
	font-size: 0.8125rem; /* Theme: Match theme button font */
	font-weight: 500;
	line-height: 1.25;
	height: calc(1.5rem + 2px); /* Theme: Match theme button height */
	color: #495057; /* Theme: Match btn-secondary */
	background: #f8f9fa; /* Theme: Match btn-secondary */
	cursor: pointer;
	transition: all 0.2s ease;
	outline: none;
	user-select: none;
	white-space: nowrap;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Theme: Match theme buttons */
}

.qv-modal .qv-variation-option:hover:not(.qv-variation-option--disabled) {
	border-color: #3d464d; /* Theme: Match btn-secondary:hover */
	background: #3d464d; /* Theme: Match btn-secondary:hover */
	color: #fff;
	transform: translateY(-2px); /* Theme: Match theme button hover */
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.qv-modal .qv-variation-option:active:not(.qv-variation-option--disabled) {
	transform: translateY(0);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Active/Selected State - match btn-primary */
.qv-modal .qv-variation-option.qv-variation-option--active {
	border-color: rgba(17, 112, 118, 1); /* Theme: Match btn-primary */
	background: rgba(17, 112, 118, 1); /* Theme: Match btn-primary */
	color: #3d464d; /* Theme: Match btn-primary text */
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.qv-modal .qv-variation-option.qv-variation-option--active:hover {
	background: #3d464d; /* Theme: Match btn-primary:hover */
	border-color: #3d464d;
	color: #fff;
}

/* Disabled/Unavailable State */
.qv-modal .qv-variation-option.qv-variation-option--disabled {
	opacity: 0.5;
	cursor: not-allowed;
	border-color: #dee2e6;
	background: #f8f9fa;
	color: #adb5bd;
	position: relative;
}

.qv-modal .qv-variation-option.qv-variation-option--disabled::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	height: 1px;
	background: #adb5bd;
	transform: translateY(-50%);
}

.qv-modal .qv-variation-option.qv-variation-option--disabled:hover {
	transform: none;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	border-color: #dee2e6;
	background: #f8f9fa;
	color: #adb5bd;
}

.qv-modal .qv-variation-option:focus-visible {
	outline: 2px solid #ffd333;
	outline-offset: 2px;
}

/* ============================================
   ACTIONS - BUTTONS
   ============================================ */

.qv-modal .qv-actions {
	display: flex;
	flex-direction: column;
	gap: 8px; /* Theme: Match product-card__buttons gap */
	margin-top: 24px; /* Theme: Match product-card__buttons */
	padding-top: 0;
	border-top: none;
	position: relative;
	bottom: auto;
	background: transparent;
	z-index: 2;
}

@media (max-width: 991px) {
	.qv-modal .qv-actions {
		position: relative;
		bottom: auto;
		background: transparent;
		padding: 0;
		border-top: none;
		box-shadow: none;
		margin-top: 24px;
	}
}

/* Primary Button - match product-card__buttons .btn-primary */
.qv-modal .qv-add-to-cart {
	width: 100%; /* Theme: Match product-card__buttons .btn */
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 12px 20px; /* Theme: Match product-card__buttons .btn */
	border-radius: 4px; /* Theme: Match product-card__buttons .btn */
	font-size: inherit;
	font-weight: 500;
	text-align: center;
	text-decoration: none;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	border: none;
	cursor: pointer;
	position: relative;
	overflow: hidden;
	background: linear-gradient(135deg, #217076 0%, #286d79 100%); /* Theme: Match product-card buttons */
	color: #fff;
	letter-spacing: 0;
}

.qv-modal .qv-add-to-cart:before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 0;
	height: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.3);
	transform: translate(-50%, -50%);
	transition: width 0.6s, height 0.6s;
}

.qv-modal .qv-add-to-cart:hover:before,
.qv-modal .qv-add-to-cart:focus:before {
	width: 300px;
	height: 300px;
}

.qv-modal .qv-add-to-cart:hover,
.qv-modal .qv-add-to-cart:focus {
	background: linear-gradient(135deg, #286d79 0%, #217076 100%);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	transform: translateY(-2px);
	color: #fff;
}

.qv-modal .qv-add-to-cart:active {
	transform: translateY(0);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.qv-modal .qv-add-to-cart:focus-visible {
	outline: 2px solid #ffd333;
	outline-offset: 2px;
}

/* Disabled state for add-to-cart button */
.qv-modal .qv-add-to-cart.is-disabled,
.qv-modal .qv-add-to-cart[aria-disabled="true"] {
	opacity: 0.45;
	cursor: not-allowed;
	pointer-events: none;
}

.qv-modal .qv-add-to-cart.is-disabled:hover,
.qv-modal .qv-add-to-cart.is-disabled:focus,
.qv-modal .qv-add-to-cart[aria-disabled="true"]:hover,
.qv-modal .qv-add-to-cart[aria-disabled="true"]:focus {
	background: linear-gradient(135deg, #217076 0%, #286d79 100%);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	transform: none;
}

/* Secondary Button - match product-card__buttons .btn-secondary */
.qv-modal .qv-view-product {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 12px 20px;
	border-radius: 4px;
	font-size: inherit;
	font-weight: 500;
	text-align: center;
	text-decoration: none;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	border: 1px solid #dee2e6; /* Theme: Match btn-secondary */
	cursor: pointer;
	background: #f8f9fa; /* Theme: Match btn-secondary */
	color: #495057; /* Theme: Match btn-secondary */
}

.qv-modal .qv-view-product:hover,
.qv-modal .qv-view-product:focus {
	background: #e9ecef; /* Theme: Match btn-secondary:hover */
	border-color: #adb5bd;
	color: #111827;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.qv-modal .qv-view-product:active {
	transform: translateY(0);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.qv-modal .qv-view-product:focus-visible {
	outline: 2px solid #ffd333;
	outline-offset: 2px;
}

/* Wishlist Button - match product-card__buttons .btn-light .btn-svg-icon */
.qv-modal .qv-wishlist {
	width: calc(1.5rem + 2px); /* Theme: Match btn-svg-icon */
	height: calc(1.5rem + 2px);
	padding: 10px; /* Theme: Match btn-svg-icon */
	border-radius: 4px;
	font-size: inherit;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s ease;
	cursor: pointer;
	border: none;
	background: #fff; /* Theme: Match btn-light */
	color: #6c757d; /* Theme: Match btn-light */
	outline: none;
	box-shadow: none; /* Theme: Match btn-light */
}

.qv-modal .qv-wishlist:hover,
.qv-modal .qv-wishlist:focus {
	background: transparent; /* Theme: Match btn-light:hover */
	color: #495057; /* Theme: Match btn-light:hover */
	transform: none;
	box-shadow: none;
}

.qv-modal .qv-wishlist.is-active {
	background: #fff;
	color: #ff2626; /* Theme: Use theme red for active */
	box-shadow: none;
}

.qv-modal .qv-wishlist.is-active:hover,
.qv-modal .qv-wishlist.is-active:focus {
	background: transparent;
	color: #ff2626;
}

.qv-modal .qv-wishlist:focus-visible {
	outline: 2px solid #ffd333;
	outline-offset: 2px;
}

/* Disabled state for wishlist button */
.qv-modal .qv-wishlist.is-disabled,
.qv-modal .qv-wishlist[aria-disabled="true"],
.qv-modal .qv-wishlist:disabled {
	opacity: 0.45;
	cursor: not-allowed;
	pointer-events: none;
}

.qv-modal .qv-wishlist.is-disabled:hover,
.qv-modal .qv-wishlist.is-disabled:focus,
.qv-modal .qv-wishlist[aria-disabled="true"]:hover,
.qv-modal .qv-wishlist[aria-disabled="true"]:focus,
.qv-modal .qv-wishlist:disabled:hover,
.qv-modal .qv-wishlist:disabled:focus {
	background: #f8f9fa;
	border-color: #e5e5e5;
	transform: none;
}

@media (max-width: 991px) {
	.qv-modal .qv-add-to-cart,
	.qv-modal .qv-view-product {
		width: 100%;
	}
	
	.qv-modal .qv-wishlist {
		width: calc(1.5rem + 2px);
		height: calc(1.5rem + 2px);
	}
}

/* ============================================
   RESPONSIVE ENHANCEMENTS
   ============================================ */

@media (max-width: 991px) {
	.qv-modal .qv-content {
		padding: 2px 22px 24px;
		gap: 0;
	}
	
	.qv-modal .qv-title .qv-link {
		font-size: 15px;
	}
	
	.qv-modal .qv-price {
		font-size: inherit;
	}
}

@media (max-width: 480px) {
	.qv-modal .qv-content {
		padding: 2px 18px 18px;
	}
	
	.qv-modal .qv-variation-option {
		padding: 0.25rem 0.5rem;
		font-size: 0.75rem;
		height: calc(1.375rem + 2px);
	}
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Focus visible for keyboard navigation */
.qv-modal *:focus-visible {
	outline: 2px solid #ffd333;
	outline-offset: 2px;
	border-radius: 4px;
}

/* Skip focus outline for mouse users */
.qv-modal *:focus:not(:focus-visible) {
	outline: none;
}

/* ============================================
   BODY SCROLL LOCK
   ============================================ */

body.qv-modal-open {
	overflow: hidden;
}

/* ============================================
   BOX SIZING
   ============================================ */

.qv-modal * {
	box-sizing: border-box;
}
