/* Qoss WooCommerce Bridge - base styling for the cart drawer + custom checkout.
   Colors/spacing are deliberately plain CSS variables so a theme can
   override them without touching this file. */

:root {
	--qoss-color-primary: #1d2327;
	--qoss-color-primary-contrast: #ffffff;
	--qoss-color-border: #e1e1e1;
	--qoss-color-bg: #ffffff;
	--qoss-color-muted: #6b7280;
	--qoss-color-error-bg: #fdecea;
	--qoss-color-error-text: #b32d2e;
	--qoss-radius: 6px;
}

/* ---------------------------------------------------------------- *
 * Shared buttons
 * ---------------------------------------------------------------- */

.qoss-btn {
	display: inline-block;
	width: 100%;
	box-sizing: border-box;
	text-align: center;
	padding: 12px 16px;
	border-radius: var(--qoss-radius);
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	border: 1px solid transparent;
}

.qoss-btn--primary {
	background: var(--qoss-color-primary);
	color: var(--qoss-color-primary-contrast);
}

.qoss-btn--secondary {
	background: transparent;
	color: var(--qoss-color-primary);
	border-color: var(--qoss-color-border);
	margin-top: 8px;
}

/* ---------------------------------------------------------------- *
 * Cart toggle button (floating)
 * ---------------------------------------------------------------- */

.qoss-cart-toggle {
	position: fixed;
	bottom: 24px;
	right: 24px;
	z-index: 9998;
	display: flex;
	align-items: center;
	gap: 6px;
	background: var(--qoss-color-primary);
	color: var(--qoss-color-primary-contrast);
	border: none;
	border-radius: 999px;
	padding: 12px 18px;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
	font-size: 15px;
}

.qoss-cart-toggle__icon {
	font-size: 18px;
}

.qoss-cart-count {
	background: rgba(255, 255, 255, 0.2);
	border-radius: 999px;
	padding: 1px 8px;
	font-size: 13px;
}

/* ---------------------------------------------------------------- *
 * Cart drawer
 * ---------------------------------------------------------------- */

.qoss-cart-drawer {
	position: fixed;
	inset: 0;
	z-index: 9999;
	visibility: hidden;
	pointer-events: none;
}

.qoss-cart-drawer--open {
	visibility: visible;
	pointer-events: auto;
}

.qoss-cart-drawer__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
	opacity: 0;
	transition: opacity 0.2s ease;
}

.qoss-cart-drawer--open .qoss-cart-drawer__overlay {
	opacity: 1;
}

.qoss-cart-drawer__panel {
	position: absolute;
	top: 0;
	right: 0;
	height: 100%;
	width: 100%;
	max-width: 400px;
	background: var(--qoss-color-bg);
	box-shadow: -4px 0 16px rgba(0, 0, 0, 0.15);
	display: flex;
	flex-direction: column;
	transform: translateX(100%);
	transition: transform 0.25s ease;
}

.qoss-cart-drawer--open .qoss-cart-drawer__panel {
	transform: translateX(0);
}

.qoss-cart-drawer__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	border-bottom: 1px solid var(--qoss-color-border);
}

.qoss-cart-drawer__header h2 {
	margin: 0;
	font-size: 18px;
}

.qoss-cart-drawer__close {
	background: none;
	border: none;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	color: var(--qoss-color-muted);
}

.qoss-cart-drawer__body {
	flex: 1;
	overflow-y: auto;
	padding: 16px 20px;
	display: flex;
	flex-direction: column;
}

.qoss-cart-drawer__empty {
	color: var(--qoss-color-muted);
	text-align: center;
	margin-top: 40px;
}

.qoss-cart-drawer__items {
	list-style: none;
	margin: 0 0 16px;
	padding: 0;
}

.qoss-cart-drawer__item {
	display: grid;
	grid-template-columns: 64px 1fr auto;
	gap: 12px;
	padding: 14px 0;
	border-bottom: 1px solid var(--qoss-color-border);
	transition: opacity 0.15s ease;
}

.qoss-cart-drawer__item--loading {
	opacity: 0.5;
	pointer-events: none;
}

.qoss-cart-drawer__item-image img {
	width: 64px;
	height: 64px;
	object-fit: cover;
	border-radius: var(--qoss-radius);
}

.qoss-cart-drawer__item-name a {
	color: inherit;
	text-decoration: none;
	font-weight: 600;
}

.qoss-cart-drawer__item-qty {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 8px;
}

.qoss-qty-btn {
	width: 24px;
	height: 24px;
	border-radius: 4px;
	border: 1px solid var(--qoss-color-border);
	background: var(--qoss-color-bg);
	cursor: pointer;
	line-height: 1;
}

.qoss-qty-value {
	min-width: 18px;
	text-align: center;
}

.qoss-cart-drawer__item-remove {
	margin-left: auto;
	background: none;
	border: none;
	color: var(--qoss-color-muted);
	text-decoration: underline;
	cursor: pointer;
	font-size: 13px;
}

.qoss-cart-drawer__item-total {
	font-weight: 600;
	white-space: nowrap;
}

.qoss-cart-drawer__footer {
	margin-top: auto;
	padding-top: 16px;
	border-top: 1px solid var(--qoss-color-border);
}

.qoss-cart-drawer__subtotal {
	display: flex;
	justify-content: space-between;
	font-weight: 700;
	font-size: 16px;
	margin-bottom: 6px;
}

.qoss-cart-drawer__note {
	color: var(--qoss-color-muted);
	font-size: 13px;
	margin: 0 0 12px;
}

/* ---------------------------------------------------------------- *
 * Custom checkout
 * ---------------------------------------------------------------- */

.qoss-checkout-form {
	max-width: 1100px;
	margin: 0 auto;
}

.qoss-checkout-notices:empty {
	display: none;
}

.qoss-checkout-notices .woocommerce-error,
.qoss-checkout-notices .woocommerce-message {
	list-style: none;
	margin: 0 0 20px;
	padding: 14px 16px;
	border-radius: var(--qoss-radius);
	background: var(--qoss-color-error-bg);
	color: var(--qoss-color-error-text);
}

.qoss-checkout-grid {
	display: grid;
	grid-template-columns: 1.4fr 1fr;
	gap: 40px;
	align-items: start;
}

@media (max-width: 782px) {
	.qoss-checkout-grid {
		grid-template-columns: 1fr;
	}
}

.qoss-checkout-grid__fields .form-row {
	margin-bottom: 14px;
}

.qoss-checkout-grid__fields label {
	display: block;
	margin-bottom: 4px;
	font-weight: 600;
	font-size: 13px;
}

.qoss-checkout-grid__fields input[type="text"],
.qoss-checkout-grid__fields input[type="email"],
.qoss-checkout-grid__fields input[type="tel"],
.qoss-checkout-grid__fields select,
.qoss-checkout-grid__fields textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 10px 12px;
	border: 1px solid var(--qoss-color-border);
	border-radius: var(--qoss-radius);
}

.woocommerce-shipping-fields h3 {
	margin-top: 28px;
}

.qoss-checkout-grid__review {
	background: #fafafa;
	border: 1px solid var(--qoss-color-border);
	border-radius: var(--qoss-radius);
	padding: 20px;
	position: sticky;
	top: 20px;
}

.woocommerce-checkout-review-order-table {
	width: 100%;
	border-collapse: collapse;
}

.woocommerce-checkout-review-order-table th,
.woocommerce-checkout-review-order-table td {
	padding: 8px 0;
	border-bottom: 1px solid var(--qoss-color-border);
	text-align: left;
}

.woocommerce-checkout-payment {
	margin-top: 16px;
}

.woocommerce-checkout-payment ul.payment_methods {
	list-style: none;
	margin: 0 0 12px;
	padding: 0;
}

.woocommerce-checkout-payment ul.payment_methods li {
	padding: 10px 0;
	border-bottom: 1px solid var(--qoss-color-border);
}

#place_order {
	width: 100%;
	padding: 14px 16px;
	border-radius: var(--qoss-radius);
	border: none;
	background: var(--qoss-color-primary);
	color: var(--qoss-color-primary-contrast);
	font-weight: 700;
	font-size: 16px;
	cursor: pointer;
}

#place_order.loading,
.single_add_to_cart_button.loading {
	opacity: 0.6;
	cursor: wait;
}

.qoss-checkout--updating .qoss-checkout-grid__review {
	opacity: 0.6;
	pointer-events: none;
	transition: opacity 0.15s ease;
}

/* ---------------------------------------------------------------- *
 * Custom single product page
 * ---------------------------------------------------------------- */

.qoss-product {
	max-width: 1200px;
	margin: 0 auto;
}

.qoss-product__layout {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 48px;
	align-items: start;
}

@media (max-width: 782px) {
	.qoss-product__layout {
		grid-template-columns: 1fr;
		gap: 24px;
	}
}

.qoss-product__gallery {
	position: sticky;
	top: 20px;
}

.qoss-product__gallery .woocommerce-product-gallery {
	border-radius: var(--qoss-radius);
	overflow: hidden;
}

.qoss-product__gallery img {
	width: 100%;
	height: auto;
	display: block;
	border-radius: var(--qoss-radius);
}

.qoss-product__summary .product_title {
	font-size: 28px;
	margin: 0 0 8px;
}

.qoss-product__summary .price {
	font-size: 24px;
	font-weight: 700;
	color: var(--qoss-color-primary);
	margin-bottom: 16px;
	display: block;
}

.qoss-product__summary .woocommerce-product-details__short-description {
	color: var(--qoss-color-muted);
	margin-bottom: 20px;
}

.qoss-product__summary .stock {
	display: inline-block;
	margin-bottom: 12px;
	font-weight: 600;
}

.qoss-product__summary .stock.out-of-stock {
	color: var(--qoss-color-error-text);
}

.qoss-product__summary form.cart {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin-bottom: 20px;
}

.qoss-product__summary form.cart .quantity {
	display: inline-flex;
}

.qoss-product__summary form.cart .qty {
	width: 70px;
	padding: 10px 12px;
	border: 1px solid var(--qoss-color-border);
	border-radius: var(--qoss-radius);
}

.qoss-product__summary .single_add_to_cart_button {
	background: var(--qoss-color-primary);
	color: var(--qoss-color-primary-contrast);
	border: none;
	border-radius: var(--qoss-radius);
	padding: 12px 28px;
	font-weight: 700;
	font-size: 15px;
	cursor: pointer;
}

.qoss-product__summary .product_meta {
	font-size: 13px;
	color: var(--qoss-color-muted);
	border-top: 1px solid var(--qoss-color-border);
	padding-top: 16px;
	margin-top: 16px;
}

.qoss-product__summary .variations {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 12px;
}

.qoss-product__summary .variations td {
	padding: 6px 0;
}

.qoss-product__summary .variations select {
	width: 100%;
	max-width: 280px;
	padding: 8px 10px;
	border: 1px solid var(--qoss-color-border);
	border-radius: var(--qoss-radius);
}

.qoss-product__details {
	margin-top: 56px;
}

.qoss-product__details .woocommerce-tabs ul.tabs {
	list-style: none;
	display: flex;
	gap: 24px;
	padding: 0;
	margin: 0 0 20px;
	border-bottom: 1px solid var(--qoss-color-border);
}

.qoss-product__details .woocommerce-tabs ul.tabs li a {
	display: inline-block;
	padding: 10px 0;
	text-decoration: none;
	color: var(--qoss-color-muted);
	font-weight: 600;
}

.qoss-product__details .woocommerce-tabs ul.tabs li.active a {
	color: var(--qoss-color-primary);
	border-bottom: 2px solid var(--qoss-color-primary);
}

.qoss-product__details .related.products {
	margin-top: 48px;
}

.qoss-product__details .related.products ul.products {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 24px;
	list-style: none;
	padding: 0;
}

.qoss-product__details .related.products ul.products li.product a {
	text-decoration: none;
	color: inherit;
	display: block;
}

.qoss-product__details .related.products ul.products img {
	width: 100%;
	height: auto;
	border-radius: var(--qoss-radius);
	margin-bottom: 8px;
}
