/* ==========================================================
   EDD Product Table – Safepath Compliance Theme
   Colors: #FE5A0E (orange), #ffb700 (gold), #015294 (dark blue)
   Fonts:  DM Sans, Inter, Work Sans
   ========================================================== */

/* ---------- Wrapper & Search Bar ---------- */

.edd-product-table-wrapper {
	width: 100%;
	font-family: "DM Sans", "Inter", "Work Sans", sans-serif;
	color: #1e2023;
}

.edd-table-top-bar {
	display: flex;
	justify-content: flex-end;
	margin-bottom: 1rem;
}

.edd-table-search {
	width: 280px;
	padding: 0.55rem 1rem;
	font-family: inherit;
	font-size: 0.875rem;
	color: #1e2023;
	background: #fff;
	border: 1.5px solid #dde1e7;
	border-radius: 8px;
	outline: none;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.edd-table-search:focus {
	border-color: #FE5A0E;
	box-shadow: 0 0 0 3px rgba(254, 90, 14, 0.12);
}

/* ---------- Scroll container (horizontal scroll on mobile) ---------- */

.edd-table-scroll {
	width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	border-radius: 12px;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

/* ---------- Table ---------- */

.edd-product-table {
	width: 100%;
	border-collapse: collapse;
	background: #fff;
	min-width: 640px;
}

/* Header */
.edd-product-table thead tr {
	background: #015294;
}

.edd-product-table thead th {
	padding: 1rem 1.25rem;
	font-size: 0.78rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #fff;
	text-align: left;
	white-space: nowrap;
}

/* Body rows */
.edd-product-table tbody tr {
	border-bottom: 1px solid #f0f2f5;
	transition: background 0.15s;
}

.edd-product-table tbody tr:last-child {
	border-bottom: none;
}

.edd-product-table tbody tr:hover {
	background: #fafbfc;
}

.edd-product-table td {
	padding: 1rem 1.25rem;
	vertical-align: middle;
}

/* Column sizing */
.col-image  { width: 88px; }
.col-title  { width: 24%; }
.col-price  { width: 14%; white-space: nowrap; }
.col-summary{ }
.col-buy    { width: 190px; text-align: center; }

/* ---------- Product Image ---------- */

.product-thumb {
	display: block;
	width: 64px;
	height: 64px;
	object-fit: cover;
	border-radius: 8px;
}

.product-no-image {
	width: 64px;
	height: 64px;
	background: #e8f0f8;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.5rem;
	font-weight: 700;
	color: #015294;
	text-transform: uppercase;
}

/* ---------- Title ---------- */

.product-title-link {
	color: #1e2023;
	text-decoration: none;
	font-weight: 600;
	font-size: 0.95rem;
	line-height: 1.4;
	transition: color 0.2s;
}

.product-title-link:hover {
	color: #FE5A0E;
}

/* ---------- Price ---------- */

.product-price {
	font-size: 1rem;
	font-weight: 700;
	color: #1e2023;
}

.product-price.free {
	color: #1a9e5c;
}

.variable-prices-display {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
}

.price-variant {
	font-size: 0.8rem;
	color: #666;
	display: flex;
	flex-direction: column;
	gap: 1px;
}

.price-variant strong {
	color: #1e2023;
	font-size: 0.875rem;
}

/* ---------- Excerpt ---------- */

.product-excerpt {
	font-size: 0.875rem;
	color: #555;
	line-height: 1.55;
}

/* ---------- Buy Now Buttons ---------- */

.edd-pt-add-to-cart,
.edd-pt-checkout-btn {
	display: inline-block;
	padding: 10px 18px;
	font-family: inherit;
	font-size: 0.85rem;
	font-weight: 600;
	border-radius: 8px;
	cursor: pointer;
	text-decoration: none;
	text-align: center;
	white-space: nowrap;
	border: none;
	transition: background 0.2s, transform 0.2s, box-shadow 0.2s, color 0.2s;
	line-height: 1.2;
}

/* Add to Cart – gold */
.edd-pt-add-to-cart {
	background: #ffb700;
	color: #fff;
}

.edd-pt-add-to-cart:hover:not(:disabled) {
	background: #e6a300;
	transform: translateY(-2px);
	box-shadow: 0 4px 14px rgba(255, 183, 0, 0.4);
}

.edd-pt-add-to-cart:disabled,
.edd-pt-add-to-cart.loading {
	opacity: 0.65;
	cursor: not-allowed;
	transform: none !important;
	box-shadow: none !important;
}

.edd-pt-add-to-cart.added {
	background: #1a9e5c;
	color: #fff;
}

/* Checkout – orange */
.edd-pt-checkout-btn {
	background: #FE5A0E;
	color: #fff !important;
}

.edd-pt-checkout-btn:hover {
	background: #e04f0b;
	transform: translateY(-2px);
	box-shadow: 0 4px 14px rgba(254, 90, 14, 0.38);
	color: #fff !important;
}

/* ---------- Variable Pricing (in table) ---------- */

.edd-variable-options {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	align-items: flex-start;
}

.edd-price-option-label {
	display: flex;
	align-items: center;
	gap: 0.45rem;
	font-size: 0.8rem;
	color: #555;
	cursor: pointer;
	line-height: 1.3;
}

.edd-price-option-label input[type="radio"] {
	accent-color: #FE5A0E;
	width: 14px;
	height: 14px;
	flex-shrink: 0;
}

/* ---------- Search: hide non-matching rows ---------- */

.edd-product-row.edd-row-hidden {
	display: none;
}

/* ---------- CART OVERLAY ---------- */

#edd-cart-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: stretch;
	justify-content: flex-end;
	/* Hidden state */
	visibility: hidden;
	pointer-events: none;
}

#edd-cart-overlay.edd-overlay-active {
	visibility: visible;
	pointer-events: all;
}

/* Backdrop */
.edd-overlay-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0);
	cursor: pointer;
	transition: background 0.35s ease;
}

#edd-cart-overlay.edd-overlay-active .edd-overlay-backdrop {
	background: rgba(0, 0, 0, 0.5);
}

/* Slide-in panel */
.edd-overlay-panel {
	position: relative;
	width: 100%;
	max-width: 400px;
	height: 100vh;
	background: #fff;
	box-shadow: -6px 0 30px rgba(0, 0, 0, 0.14);
	display: flex;
	flex-direction: column;
	overflow-y: auto;
	/* Slide from right */
	transform: translateX(100%);
	transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
}

#edd-cart-overlay.edd-overlay-active .edd-overlay-panel {
	transform: translateX(0);
}

/* Header – brand dark blue, matching the table header */
.edd-overlay-header {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 1.2rem 1.5rem;
	background: #015294;
	flex-shrink: 0;
}

.edd-overlay-success-icon {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.2);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.edd-overlay-success-icon svg {
	width: 15px;
	height: 15px;
	stroke: #fff;
}

.edd-overlay-header h3 {
	flex: 1;
	margin: 0;
	font-size: 1rem;
	font-weight: 700;
	color: #fff;
	font-family: "DM Sans", "Inter", sans-serif;
}

/* Close button – use !important to defeat any theme button styles.
   Sits on the dark blue (#015294) header so colours are inverted. */
.edd-overlay-close,
#edd-cart-overlay .edd-overlay-close {
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 32px !important;
	height: 32px !important;
	padding: 0 !important;
	margin: 0 !important;
	background: rgba(255, 255, 255, 0.15) !important;
	border: none !important;
	border-radius: 6px !important;
	box-shadow: none !important;
	font-size: 1.35rem !important;
	line-height: 1 !important;
	font-family: inherit !important;
	color: #fff !important;
	cursor: pointer !important;
	text-transform: none !important;
	letter-spacing: 0 !important;
	min-width: unset !important;
	min-height: unset !important;
	transition: background 0.2s !important;
	flex-shrink: 0 !important;
}

.edd-overlay-close:hover,
#edd-cart-overlay .edd-overlay-close:hover {
	background: rgba(255, 255, 255, 0.28) !important;
	color: #fff !important;
	transform: none !important;
}

/* Item row */
.edd-overlay-item {
	display: flex;
	gap: 1rem;
	padding: 1.4rem 1.5rem;
	border-bottom: 1px solid #f0f2f5;
	flex-shrink: 0;
}

.edd-overlay-item-image {
	width: 80px;
	height: 80px;
	border-radius: 8px;
	overflow: hidden;
	background: #e8f0f8;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.edd-overlay-item-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.edd-overlay-item-placeholder svg {
	width: 30px;
	height: 30px;
	stroke: #9eb5cc;
}

.edd-overlay-item-info {
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 0.35rem;
}

.edd-overlay-item-title {
	font-size: 0.95rem;
	font-weight: 600;
	color: #1e2023;
	margin: 0;
	line-height: 1.4;
}

.edd-overlay-item-price {
	font-size: 1.1rem;
	font-weight: 700;
	color: #ffb700;
	margin: 0;
}

/* Cart summary strip */
.edd-overlay-cart-summary {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0.85rem 1.5rem;
	background: #f5f8fc;
	border-bottom: 1px solid #eaedf1;
	font-size: 0.875rem;
	color: #555;
	flex-shrink: 0;
}

#edd-overlay-total {
	color: #1e2023;
	font-size: 0.95rem;
}

/* Action buttons – all !important to defeat theme resets */
.edd-overlay-actions {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	padding: 1.4rem 1.5rem;
	margin-top: auto;
	flex-shrink: 0;
}

.edd-overlay-btn,
#edd-cart-overlay .edd-overlay-btn {
	display: block !important;
	width: 100% !important;
	padding: 13px 20px !important;
	font-family: "DM Sans", "Inter", "Work Sans", sans-serif !important;
	font-size: 0.95rem !important;
	font-weight: 600 !important;
	border-radius: 8px !important;
	text-align: center !important;
	text-decoration: none !important;
	cursor: pointer !important;
	box-sizing: border-box !important;
	transition: background 0.2s, transform 0.2s, box-shadow 0.2s, color 0.2s, border-color 0.2s !important;
	line-height: 1.3 !important;
	/* Reset anything the theme might inject */
	text-transform: none !important;
	letter-spacing: normal !important;
}

/* Checkout – brand yellow */
.edd-overlay-checkout,
#edd-cart-overlay .edd-overlay-checkout {
	background: #ffb700 !important;
	color: #fff !important;
	border: none !important;
	box-shadow: none !important;
}

#edd-cart-overlay .edd-overlay-checkout:hover {
	background: #e6a300 !important;
	color: #fff !important;
	transform: translateY(-2px) !important;
	box-shadow: 0 4px 14px rgba(255, 183, 0, 0.4) !important;
}

/* Continue Shopping – outlined, uses brand blue on hover */
.edd-overlay-continue,
#edd-cart-overlay .edd-overlay-continue {
	background: #fff !important;
	color: #015294 !important;
	border: 2px solid #015294 !important;
	box-shadow: none !important;
}

#edd-cart-overlay .edd-overlay-continue:hover {
	background: #015294 !important;
	color: #fff !important;
	border-color: #015294 !important;
	transform: none !important;
}

/* ---------- Cart items list (other items already in cart) ---------- */

.edd-overlay-cart-list {
	border-bottom: 1px solid #f0f2f5;
	flex-shrink: 0;
}

.edd-overlay-cart-list-label {
	margin: 0;
	padding: 0.75rem 1.5rem 0.4rem;
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.07em;
	color: #999;
}

#edd-overlay-cart-list-items {
	list-style: none;
	margin: 0;
	padding: 0 0 0.5rem;
}

#edd-overlay-cart-list-items li {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.55rem 1.5rem;
	transition: background 0.15s;
}

#edd-overlay-cart-list-items li:hover {
	background: #fafbfc;
}

.edd-cl-thumb {
	width: 40px;
	height: 40px;
	border-radius: 6px;
	object-fit: cover;
	flex-shrink: 0;
	background: #e8f0f8;
	display: block;
}

.edd-cl-placeholder {
	width: 40px;
	height: 40px;
	border-radius: 6px;
	background: #e8f0f8;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.edd-cl-placeholder svg {
	width: 18px;
	height: 18px;
	stroke: #9eb5cc;
}

.edd-cl-title {
	flex: 1;
	font-size: 0.85rem;
	color: #1e2023;
	line-height: 1.35;
}

.edd-cl-price {
	font-size: 0.85rem;
	font-weight: 700;
	color: #ffb700;
	white-space: nowrap;
	flex-shrink: 0;
}

/* ---------- Responsive ---------- */

@media (max-width: 767px) {
	.edd-product-table {
		font-size: 0.85rem;
	}

	.edd-product-table thead th,
	.edd-product-table td {
		padding: 0.75rem 0.9rem;
	}

	.col-image { width: 60px; }
	.product-thumb { width: 52px; height: 52px; }

	/* Hide summary column on small screens to keep table readable */
	.col-summary,
	.edd-product-table td:nth-child(4) {
		display: none;
	}

	.edd-table-search {
		width: 100%;
	}

	.edd-overlay-panel {
		max-width: 100%;
	}
}
