/*
 * PharmacyWire (theme override): ReOrder Line Item styling
 * Scoped to ReOrder only to avoid unintended global side effects.
 * Natural, less "AI-made" design with branded/generic side-by-side layout.
 */

.pwReOrderComponent .pw-reorder-line-items {
	display: grid;
	grid-template-columns: 1fr;
	gap: 20px;
	margin: 15px 0;
}

/* Both sections span the full width of the prescription card. */
.pwReOrderComponent .last-ordered,
.pwReOrderComponent .available-alternatives {
	width: 100%;
	max-width: 100%;
	color: #111827;
}

@media (min-width: 768px) {
	.pwReOrderComponent .last-ordered .pw-reorder-line-items,
	.pwReOrderComponent .available-alternatives .pw-reorder-line-items {
		grid-template-columns: 1fr 1fr;
		/* Pack items from the top so we don't get blank gaps due to DOM ordering */
		grid-auto-flow: row dense;
		gap: 20px;
		align-items: start;
	}

	/* Brand on the left, generic on the right, matching how products are laid out
	 * elsewhere on the site. Scoped to the alternatives because that is the only
	 * section where both kinds appear; in the prescribed section every card is the
	 * same drug, so pinning them to one column would strand an empty half. */
	.pwReOrderComponent .available-alternatives .pw-reorder-line-items .pw-reorder-branded {
		grid-column: 1;
	}

	.pwReOrderComponent .available-alternatives .pw-reorder-line-items .pw-reorder-generic {
		grid-column: 2;
	}
}

.pwReOrderComponent .pw-reorder-line-item-card {
	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	padding: 0;
	overflow: visible;
	position: relative;
}

/* Brand drug cards - greenish background */
.pwReOrderComponent .pw-reorder-branded {
	background: #f3f9f4;
	border-color: #008815;
}

/* Generic drug cards - orangish background */
.pwReOrderComponent .pw-reorder-generic {
	background: #f86d110d;
	border-color: #f86d11;
}

/* Less "perfect" shadow - more natural */
.pwReOrderComponent .pw-reorder-line-item-card {
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.pwReOrderComponent .pw-reorder-card-content {
	padding: 16px;
}

.pwReOrderComponent .pw-reorder-product-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	margin-bottom: 14px;
	gap: 10px;
}

.pwReOrderComponent .pw-reorder-product-name {
	font-size: 17px;
	font-weight: 700;
	line-height: 1.4;
	color: #111827;
	margin: 0;
	flex: 1;
	letter-spacing: -0.01em;
}

.pwReOrderComponent .pw-reorder-badge {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 4px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	white-space: nowrap;
	flex-shrink: 0;
}

.pwReOrderComponent .pw-reorder-badge-brand {
	background: #008815;
	color: #ffffff;
}

.pwReOrderComponent .pw-reorder-badge-generic {
	background: #f86d11;
	color: #ffffff;
}

.pwReOrderComponent .pw-reorder-details {
	margin-bottom: 14px;
}

.pwReOrderComponent .pw-reorder-detail-row {
	display: flex;
	justify-content: space-between;
 	align-items: center;
	margin-bottom: 12px;
	gap: 12px;
	padding-bottom: 8px;
	border-bottom: 1px solid #f3f4f6;
}

.pwReOrderComponent .pw-reorder-detail-row:last-child {
	border-bottom: none;
	padding-bottom: 0;
}


.pwReOrderComponent .pw-reorder-qty-row {
	align-items: center;
}

.pwReOrderComponent .pw-reorder-label {
	font-weight: 600;
	color: #374151;
	font-size: 13px;
	letter-spacing: 0.01em;
	flex-shrink: 0;
	text-transform: none;
}

.pwReOrderComponent .pw-reorder-value {
	color: #111827;
	font-size: 15px;
	font-weight: 500;
	text-align: right;
	flex: 1;
	line-height: 1.5;
}

.pwReOrderComponent .pw-reorder-select-wrapper {
	flex: 1;
	min-width: 0;
	display: flex;
	justify-content: flex-end;
	align-items: center;
}

.pwReOrderComponent .pw-reorder-select-wrapper select {
	margin: 0;
}
/* Select styling - ensure it doesn't get trimmed */
.pwReOrderComponent .pw-reorder-select,
.pwReOrderComponent select.selected-tier {
	width: 100%;
	min-width: 180px;
	max-width: 100%;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	padding: 9px 10px;
	background: #fff;
	color: #111827;
	font-size: 15px;
	font-weight: 500;
	box-shadow: none;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23374151' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 10px center;
	background-size: 12px;
	padding-right: 32px;
	line-height: 1.5;
}

.pwReOrderComponent .pw-reorder-select:focus,
.pwReOrderComponent select.selected-tier:focus {
	outline: none;
	border-color: #0ea5e9;
	box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.2);
}

/* Meta info */
.pwReOrderComponent .pw-reorder-meta {
	margin-top: 14px;
	padding-top: 14px;
	border-top: 1px solid #e5e7eb;
	display: flex;
	flex-direction: column;
	gap: 8px;
	font-size: 12px;
}

.pwReOrderComponent .pw-reorder-meta-item {
	display: flex;
	gap: 6px;
}

.pwReOrderComponent .pw-reorder-meta-label {
	font-weight: 600;
	color: #4b5563;
	font-size: 14px;
	letter-spacing: 0.01em;
}

.pwReOrderComponent .pw-reorder-meta-value {
	color: #111827;
	font-weight: 500;
	font-size: 14px;
}

/* Full-width button at bottom */
.pwReOrderComponent .pw-reorder-cta-full {
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid #e5e7eb;
}

/* Note under the add to cart button */
.pwReOrderComponent .pw-reorder-cart-note {
	margin: 10px 0 0;
	color: #6b7280;
	font-size: 13px;
	line-height: 1.5;
	text-align: center;
}

.pwReOrderComponent .pw-reorder-cart-link {
	color: #0b4a6f;
	font-weight: 600;
	text-decoration: underline;
	white-space: nowrap;
}

.pwReOrderComponent .pw-reorder-cart-link:hover,
.pwReOrderComponent .pw-reorder-cart-link:focus {
	color: #09304a;
}

.pwReOrderComponent .pw-reorder-cta-full .add-to-cart-control {
	width: 100%;
	border-radius: 6px;
	background-color: #0b4a6f;
	border: 1px solid #0b4a6f;
	color: #ffffff;
	font-weight: 600;
	font-size: 14px;
	padding: 12px 16px;
	min-height: 44px;
	box-shadow: none;
	transition: background-color 0.2s ease, border-color 0.2s ease;
}
.pw-button button.add-to-cart-control.primary {
	background-color: #0b4a6f;
	border-color: #0b4a6f;
	color: #ffffff;
}
/* :not(.pw-ignore-plugin-button-styles) .pw-pharmacy-wrap .pw-button:not(.pw-ignore-plugin-styles).primary {
	background-color: #0b4a6f;
	border-color: #0b4a6f;
	color: #ffffff;
} */
.pwReOrderComponent .pw-reorder-cta-full .add-to-cart-control:hover {
	background: #09304a;
	border-color: #09304a;
}

.pwReOrderComponent .pw-reorder-cta-full .add-to-cart-control:focus {
	outline: none;
	box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.25);
}

.pwReOrderComponent .pw-reorder-empty {
	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-left: 3px solid #ff6b35;
	border-radius: 6px;
	padding: 16px;
	color: #111827;
	font-size: 14px;
}

/* Special styling for "Last Filled Product" cards - eye-catching borders */
.pwReOrderComponent .pw-reorder-last-filled .pw-reorder-highlighted {
	border: 1px solid #0ea5e9;
	border-radius: 12px;
	box-shadow: 0 2px 1px rgba(14, 165, 233, 0.25), 0 1px 2px rgba(14, 165, 233, 0.15);
	position: relative;
	/* background: linear-gradient(to bottom, #ffffff 0%, #f0f9ff 100%); */
	transition: all 0.3s ease;
    background: #0ea5e90d;
}

.pwReOrderComponent .pw-reorder-last-filled .pw-reorder-highlighted:hover {
	border-color: #0284c7;
	box-shadow: 0 6px 16px rgba(14, 165, 233, 0.35), 0 4px 8px rgba(14, 165, 233, 0.2);
	transform: translateY(-2px);
}

/* Hover effects for Available Alternatives cards */
.pwReOrderComponent .available-alternatives .pw-reorder-line-item-card {
	transition: all 0.3s ease;
	cursor: pointer;
}

.pwReOrderComponent .available-alternatives .pw-reorder-line-item-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Specific hover border colors for each card type */
.pwReOrderComponent .available-alternatives .pw-reorder-branded:hover {
	border-color: #006b1a;
}

.pwReOrderComponent .available-alternatives .pw-reorder-generic:hover {
	border-color: #c44100;
}

/* Add a subtle "Recommended" indicator for Last Filled Product */
.pwReOrderComponent .pw-reorder-last-filled .pw-reorder-highlighted::before {
	content: 'Previously Ordered';
	position: absolute;
	top: -12px;
	left: 16px;
	background: #0ea5e9;
	color: #ffffff;
	padding: 4px 12px;
	border-radius: 12px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	box-shadow: 0 2px 4px rgba(14, 165, 233, 0.3);
	z-index: 1;
}

/* Ensure the card content has proper spacing with the badge */
.pwReOrderComponent .pw-reorder-last-filled .pw-reorder-highlighted .pw-reorder-card-content {
	padding-top: 24px;
}

/* Enhanced styling for the prescribed product section heading */
.pwReOrderComponent .last-ordered h4,
.pwReOrderComponent .available-alternatives h4 {
	color: #111827;
	font-weight: 700;
	font-size: 19px;
	margin-bottom: 18px;
	display: flex;
	align-items: center;
	gap: 8px;
	letter-spacing: -0.02em;
}

.pwReOrderComponent .last-ordered h4 {
	color: #0ea5e9;
}

/* Helper line that sits under a section heading */
.pwReOrderComponent .pw-reorder-section-note {
	margin: 0 0 18px;
	color: #6b7280;
	font-size: 14px;
	line-height: 1.5;
}

.pwReOrderComponent .last-ordered h4:has(+ .pw-reorder-section-note),
.pwReOrderComponent .available-alternatives h4:has(+ .pw-reorder-section-note) {
	margin-bottom: 6px;
}

