/**
 * VapeShop Compatible Accessories Box — Front-End Styles
 * Loaded only on single product pages.
 *
 * Naming convention: .vapeshop-accessories-* / .vapeshop-acc-* / .vaposhop-*
 */

/* -------------------------------------------------------------------------
   Outer wrapper
   ------------------------------------------------------------------------- */
.vapeshop-accessories-box {
	margin-top: 2rem;
	margin-bottom: 1.5rem;
	width: 100%;
}

/* -------------------------------------------------------------------------
   Section heading
   ------------------------------------------------------------------------- */
.vapeshop-accessories-heading {
	font-size: 0.875rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: inherit;
	margin: 0 0 0.75rem;
	padding-bottom: 0.5rem;
	border-bottom: 1px solid #e0e0e0;
}

/* -------------------------------------------------------------------------
   Scrollable row of cards
   ------------------------------------------------------------------------- */
.vapeshop-accessories-row {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	gap: 0.75rem;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	padding-bottom: 0.5rem;
	scrollbar-width: thin;
	scrollbar-color: #cccccc transparent;
	align-items: flex-start; /* cards grow to their own height */
}

.vapeshop-accessories-row::-webkit-scrollbar {
	height: 4px;
}

.vapeshop-accessories-row::-webkit-scrollbar-thumb {
	background: #cccccc;
	border-radius: 4px;
}

/* -------------------------------------------------------------------------
   Individual card
   ------------------------------------------------------------------------- */
.vapeshop-acc-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.4rem;
	background: #ffffff;
	border: 1px solid #e5e5e5;
	border-radius: 8px;
	box-shadow: 0 1px 4px rgba( 0, 0, 0, 0.07 );
	padding: 12px;
	min-width: 160px;
	max-width: 190px;
	flex: 0 0 auto;
	text-align: center;
	transition: box-shadow 0.2s ease, transform 0.15s ease;
}

/* Variable product cards are a touch wider to fit dropdowns comfortably */
.vapeshop-acc-card--variable {
	min-width: 180px;
	max-width: 210px;
}

.vapeshop-acc-card:hover {
	box-shadow: 0 4px 12px rgba( 0, 0, 0, 0.12 );
	transform: translateY( -2px );
}

/* -------------------------------------------------------------------------
   Thumbnail
   ------------------------------------------------------------------------- */
.vapeshop-acc-image-link {
	display: block;
	line-height: 0;
}

.vapeshop-acc-thumb {
	width: 80px;
	height: 80px;
	object-fit: contain;
	border-radius: 4px;
}

/* -------------------------------------------------------------------------
   Product title
   ------------------------------------------------------------------------- */
.vapeshop-acc-title {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-size: 0.8rem;
	font-weight: 600;
	line-height: 1.3;
	color: inherit;
	text-decoration: none;
	word-break: break-word;
}

.vapeshop-acc-title:hover {
	text-decoration: underline;
}

/* -------------------------------------------------------------------------
   Price
   ------------------------------------------------------------------------- */
.vapeshop-acc-price {
	font-size: 0.85rem;
	font-weight: 700;
	color: inherit;
	line-height: 1;
}

.vapeshop-acc-price .woocommerce-Price-amount {
	color: inherit;
}

/* -------------------------------------------------------------------------
   Stock badge
   ------------------------------------------------------------------------- */
.vapeshop-acc-badge {
	display: inline-block;
	font-size: 0.7rem;
	font-weight: 600;
	padding: 2px 7px;
	border-radius: 4px;
	line-height: 1.4;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.vapeshop-acc-badge--instock {
	background: #e6f5ec;
	color: #1a7a3c;
}

.vapeshop-acc-badge--outofstock {
	background: #fdecea;
	color: #c0392b;
}

/* -------------------------------------------------------------------------
   Inline form wrapper (both simple and variable)
   ------------------------------------------------------------------------- */
.vapeshop-acc-form {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	width: 100%;
	margin-top: 0.2rem;
}

/* -------------------------------------------------------------------------
   Attribute dropdowns (variable products)
   ------------------------------------------------------------------------- */
.vaposhop-attr-row {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
	width: 100%;
}

.vaposhop-attr-label {
	font-size: 0.7rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #555;
}

.vaposhop-attr-select {
	width: 100%;
	font-size: 0.78rem;
	padding: 4px 6px;
	border: 1px solid #d0d0d0;
	border-radius: 4px;
	background: #fafafa;
	color: inherit;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 8px center;
	background-size: 8px;
	padding-right: 22px;
}

.vaposhop-attr-select:focus {
	outline: 2px solid #999;
	outline-offset: 1px;
}

/* -------------------------------------------------------------------------
   Quantity row
   ------------------------------------------------------------------------- */
.vapeshop-acc-qty-row,
.vaposhop-qty-wrap {
	display: flex;
	align-items: center;
	gap: 0;
	width: 100%;
}

.vapeshop-acc-qty-wrap,
.vaposhop-qty-wrap {
	display: flex;
	align-items: center;
	border: 1px solid #d0d0d0;
	border-radius: 4px;
	overflow: hidden;
	width: 100%;
}

.vaposhop-qty-btn {
	background: #f0f0f0;
	border: none;
	width: 28px;
	min-width: 28px;
	height: 30px;
	font-size: 1rem;
	line-height: 1;
	cursor: pointer;
	color: #444;
	flex-shrink: 0;
	transition: background 0.15s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}

.vaposhop-qty-btn:hover {
	background: #e0e0e0;
}

.vaposhop-qty-input {
	flex: 1;
	min-width: 0;
	border: none;
	border-left: 1px solid #d0d0d0;
	border-right: 1px solid #d0d0d0;
	text-align: center;
	font-size: 0.82rem;
	height: 30px;
	padding: 0 2px;
	-moz-appearance: textfield;
	background: #fff;
	color: inherit;
}

.vaposhop-qty-input::-webkit-inner-spin-button,
.vaposhop-qty-input::-webkit-outer-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* -------------------------------------------------------------------------
   Add to Cart / Select Options button
   Inherits .button and .button.alt from the active WooCommerce theme.
   We only override size & shape so it matches the theme's own colors.
   ------------------------------------------------------------------------- */
.vapeshop-acc-atc-btn.button {
	display: block;
	width: 100%;
	padding: 7px 10px;
	font-size: 0.78rem;
	text-align: center;
	border-radius: 4px;
	line-height: 1.4;
	margin-top: auto;
	cursor: pointer;
	text-decoration: none;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: opacity 0.2s ease;
}

/* Variable product button — also a <button> element, not <a> */
button.vapeshop-acc-atc-btn {
	display: block;
	width: 100%;
	padding: 7px 10px;
	font-size: 0.78rem;
	text-align: center;
	border-radius: 4px;
	line-height: 1.4;
	cursor: pointer;
	transition: opacity 0.2s ease;
}

button.vapeshop-acc-atc-btn:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.vapeshop-acc-atc-btn.button:hover,
button.vapeshop-acc-atc-btn:not(:disabled):hover {
	opacity: 0.88;
	text-decoration: none;
}

/* Post-add checkmark state */
.vapeshop-acc-atc-btn.vapeshop-acc-added,
button.vapeshop-acc-atc-btn.vapeshop-acc-added {
	opacity: 0.8;
	pointer-events: none;
}

/* -------------------------------------------------------------------------
   Mobile: wrap cards below 600px
   ------------------------------------------------------------------------- */
@media ( max-width: 600px ) {
	.vapeshop-accessories-row {
		flex-wrap: wrap;
		overflow-x: visible;
	}

	.vapeshop-acc-card,
	.vapeshop-acc-card--variable {
		min-width: calc( 50% - 0.375rem );
		max-width: calc( 50% - 0.375rem );
		flex: 0 0 calc( 50% - 0.375rem );
	}
}

@media ( max-width: 360px ) {
	.vapeshop-acc-card,
	.vapeshop-acc-card--variable {
		min-width: 100%;
		max-width: 100%;
		flex: 0 0 100%;
	}
}
