/**
 * Oceaniclink Purchase History Tab
 * Extends WooCommerce My Account / shop table base styles.
 * Keeps table inside .woocommerce-MyAccount-content.
 */

/* Purchase History page only: hide My Account sidebar nav and make content full width */
.woocommerce-MyAccount-content:has(.oceaniclink-purchase-history-tab) {
	width: 100%;
	max-width: 100%;
}
.woocommerce-account:has(.oceaniclink-purchase-history-tab) .woocommerce-MyAccount-navigation {
	display: none !important;
}

/* Contain inside My Account content box */
.woocommerce-MyAccount-content .oceaniclink-purchase-history-tab {
	max-width: 100%;
	margin: 0 0 2em;
	overflow: hidden;
	box-sizing: border-box;
}

/* Scrollable table wrapper – table stays inside content box, scrolls horizontally if needed */
.woocommerce-MyAccount-content .oceaniclink-purchase-history-tab .oceaniclink-ph-table-wrapper {
	width: 100%;
	max-width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	margin-bottom: 0;
	box-sizing: border-box;
}

/* Table – build on WooCommerce .shop_table */
.woocommerce .oceaniclink-purchase-history-tab .shop_table.oceaniclink-ph-table {
	min-width: 640px;
	width: 100%;
	border: 1px solid var(--woocommerce-table-border, #e5e5e5);
	border-collapse: collapse;
	border-spacing: 0;
	background: #fff;
	margin-bottom: 0;
}

.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table thead {
	background: var(--woocommerce-table-header-bg, #f7f7f7);
}

.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table th {
	padding: 0.75em 1em;
	text-align: left;
	font-weight: 600;
	border-bottom: 2px solid var(--woocommerce-table-border, #e5e5e5);
	color: var(--woocommerce-table-header-color, #333);
}

.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table td {
	padding: 1em;
	border-bottom: 1px solid var(--woocommerce-table-border, #e5e5e5);
	vertical-align: middle;
}

.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table tbody tr:last-child td {
	border-bottom: none;
}

.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table tbody tr:hover {
	background: var(--woocommerce-table-row-hover, #fafafa);
}

/* Image column */
.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table .ph-image {
	width: 80px;
}

.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table .ph-image a {
	display: inline-block;
	line-height: 0;
}

.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table .ph-image img {
	width: 60px;
	height: 60px;
	object-fit: cover;
	display: block;
	border-radius: 4px;
}

/* Name – link style aligned with WooCommerce */
.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table .ph-name {
	min-width: 140px;
}

.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table .ph-name a {
	font-weight: 500;
	color: var(--woocommerce-link-color, #0073aa);
	text-decoration: none;
}

.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table .ph-name a:hover {
	text-decoration: underline;
	color: var(--woocommerce-link-hover-color, #005177);
}

.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table .ph-name .ph-product-category {
	display: block;
	margin-top: 0.25em;
	font-size: 0.85em;
	color: var(--woocommerce-text-muted, #666);
}

/* SKU */
.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table .ph-sku {
	color: var(--woocommerce-text-muted, #666);
	white-space: nowrap;
}

/* Price – use WooCommerce price styling; allow multiple lines for MOQ tiers */
.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table .ph-price {
	width: 1%;
	min-width: 180px;
	max-width: 180px;
	white-space: normal;
	font-weight: 600;
	word-wrap: break-word;
}

.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table .ph-price .ph-price-line {
	display: block;
	line-height: 1.5;
}

.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table .ph-price .woocommerce-Price-amount {
	font-weight: 600;
}

/* Year columns */
.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table .ph-year {
	text-align: center;
	width: 100px;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

/* Qty & form */
.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table .ph-qty {
	width: 100px;
}

.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table .ph-in-cart {
	width: 70px;
	text-align: center;
	vertical-align: middle;
	font-weight: 600;
}

.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table .ph-qty .oceaniclink-ph-add-to-cart-form {
	margin: 0;
}

.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table .ph-qty .quantity {
	display: inline-flex;
	align-items: center;
	gap: 0;
	vertical-align: middle;
}

.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table .ph-qty .quantity .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	border: 0;
}

.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table .ph-qty .quantity .minus,
.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table .ph-qty .quantity .plus {
	width: 2em;
	height: 2.4em;
	padding: 0;
	font-size: 1em;
	line-height: 1;
	cursor: pointer;
	border: 1px solid var(--woocommerce-input-border, #ddd);
	background: var(--woocommerce-input-bg, #f7f7f7);
	color: #333;
	border-radius: 0;
	-webkit-appearance: none;
	appearance: none;
}

.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table .ph-qty .quantity .minus {
	border-right: 0;
	border-radius: 4px 0 0 4px;
}

.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table .ph-qty .quantity .plus {
	border-left: 0;
	border-radius: 0 4px 4px 0;
}

.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table .ph-qty .quantity input.qty {
	width: 3.5em;
	min-height: 2.4em;
	padding: 0.5em 0.4em;
	text-align: center;
	border: 1px solid var(--woocommerce-input-border, #ddd);
	border-radius: 0;
	font-size: 1em;
	line-height: 1.4;
	-moz-appearance: textfield;
}

.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table .ph-qty .quantity input.qty::-webkit-outer-spin-button,
.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table .ph-qty .quantity input.qty::-webkit-inner-spin-button {
	margin: 0;
	-webkit-appearance: none;
	appearance: none;
}

/* Add to cart button – WooCommerce .button */
.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table .ph-actions {
	width: 120px;
}

.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table .ph-actions .button {
	padding: 0.5em 1em;
	font-size: 0.8125rem;
	white-space: nowrap;
	line-height: 1.4;
	cursor: pointer;
}

.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table .ph-actions .button.loading {
	opacity: 0.7;
	pointer-events: none;
}

.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table .ph-out-of-stock {
	color: var(--woocommerce-text-muted, #666);
	font-size: 0.9em;
}

/* Tab title */
.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-title {
	margin: 0 0 1em;
	font-size: 1.5em;
	font-weight: 600;
	color: var(--woocommerce-body-color, #333);
}

/* Empty state – no purchases in last 2 years */
.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-empty-message {
	margin: 2em 0 0;
	padding: 1.5em 1.25em;
	background: var(--woocommerce-table-header-bg, #f7f7f7);
	border: 1px solid var(--woocommerce-table-border, #e5e5e5);
	border-radius: 4px;
	color: var(--woocommerce-text-muted, #666);
	font-size: 1em;
	line-height: 1.5;
	text-align: center;
}

/* Search and category filters – single line */
.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-filters {
	margin-bottom: 1.25em;
}

.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-filters-row {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 0.75em 1em;
	margin: 0;
}

.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-filters-row .oceaniclink-ph-back {
	margin-right: 0.5em;
	text-decoration: none;
	display: inline-block;
	text-align: center;
}

.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-filters-row label {
	margin: 0;
	font-weight: 500;
}

.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-search-input {
	min-width: 180px;
	max-width: 250px;
	padding: 0.5em 0.75em;
	border: 1px solid var(--woocommerce-input-border, #ddd);
	border-radius: 4px;
}

.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-cat-select {
	width: 250px;
	min-width: 250px;
	padding: 0.5em 0.75em;
	border: 1px solid var(--woocommerce-input-border, #ddd);
	border-radius: 4px;
}

.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-cat-select + .select2-container,
.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-cat-select + .select2-container .select2-selection {
	width: 250px !important;
	min-width: 250px;
}

/* Pagination – aligned with woocommerce-pagination */
.woocommerce .oceaniclink-ph-pagination {
	margin-top: 1.5em;
	padding-top: 1em;
	border-top: 1px solid var(--woocommerce-table-border, #e5e5e5);
}

.woocommerce .oceaniclink-ph-pagination .oceaniclink-ph-pagination-info {
	margin: 0 0 0.75em;
	color: var(--woocommerce-text-muted, #666);
	font-size: 0.92em;
}

.woocommerce .oceaniclink-ph-pagination .page-numbers {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.375em;
	border: none;
}

.woocommerce .oceaniclink-ph-pagination .page-numbers li {
	margin: 0;
}

.woocommerce .oceaniclink-ph-pagination .page-numbers a,
.woocommerce .oceaniclink-ph-pagination .page-numbers span {
	display: inline-block;
	padding: 0.5em 0.875em;
	border: none;
	border-radius: 4px;
	text-decoration: none;
	color: var(--woocommerce-body-color, #333);
	font-size: 0.875rem;
	line-height: 1.4;
}

.woocommerce .oceaniclink-ph-pagination .page-numbers a:hover {
	background: var(--woocommerce-table-row-hover, #f7f7f7);
}

.woocommerce .oceaniclink-ph-pagination .page-numbers .current {
	background: var(--woocommerce-button-background, #333);
	color: var(--woocommerce-button-color, #fff);
	border: none;
}

/* ========== Order-list-style table & controls (matching .order_list_main) ========== */

/* Table borders and cells */
.woocommerce .oceaniclink-purchase-history-tab .shop_table.oceaniclink-ph-table {
	border: 1px solid #e4e4e4;
	width: 100%;
}

.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table thead th {
	background: #f5f5f5;
	border: 1px solid #eee !important;
	font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
	font-size: 15px;
	text-transform: capitalize;
	text-align: center;
}

.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table tbody tr td {
	background: #fff !important;
	border: 1px solid #eee;
	word-break: break-word;
}

/* Quantity – flex center, input styling */
.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table tbody .ph-qty .quantity {
	display: flex;
	margin-right: 0;
	width: 100%;
	justify-content: center;
}

.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table tbody .ph-qty .quantity input[type="number"] {
	text-align: center;
	width: 75px;
	background: #fff;
}

.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table tbody .ph-qty .quantity input {
	margin-right: 2px;
	background: #f5f5f5;
	border-radius: 0;
	font-weight: 400 !important;
	color: #000;
	padding: 6% 10%;
	border: 1px solid #eaeaea !important;
	margin: 0 -1px !important;
}

.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table tbody .ph-qty .quantity input.input-text.qty {
	border-left: 1px solid #eaeaea;
	border-right: 1px solid #eaeaea;
	background: #fff;
	color: #000;
	font-weight: 500;
	font-size: 14px;
}

.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table tbody .ph-qty .quantity input:focus {
	outline: none;
}

/* Select2 in purchase history – consistent height */
.woocommerce .oceaniclink-purchase-history-tab .select2-container--default .select2-selection--single .select2-selection__rendered {
	line-height: 40px !important;
	color: #333 !important;
}

.woocommerce .oceaniclink-purchase-history-tab .select2-container--default .select2-selection--single .select2-selection__arrow,
.woocommerce .oceaniclink-purchase-history-tab .select2-container .select2-selection--single {
	height: 40px !important;
}

/* Add to cart button – order-list style */
.woocommerce .oceaniclink-purchase-history-tab .ph-actions .button.oceaniclink-ph-add-to-cart {
	color: #fff;
	background-color: #0360a5;
	border: 0;
	padding: 8px 20px;
	font-size: 16px;
	font-weight: 500;
	cursor: pointer;
	border-radius: 5px;
}

.woocommerce .oceaniclink-purchase-history-tab .ph-actions .button.oceaniclink-ph-add-to-cart:focus {
	outline: none;
}

.woocommerce .oceaniclink-purchase-history-tab .ph-actions .button.oceaniclink-ph-add-to-cart:hover {
	background-color: #000;
}

.woocommerce .oceaniclink-purchase-history-tab .ph-actions .button.oceaniclink-ph-add-to-cart.loading,
.woocommerce .oceaniclink-purchase-history-tab .ph-actions .button.oceaniclink-ph-add-to-cart[disabled],
.woocommerce .oceaniclink-purchase-history-tab .ph-actions .button.oceaniclink-ph-add-to-cart[disabled]:hover {
	background: #0360a594;
	color: #fff;
	border-color: #0360a5;
}

/* Filter button */
.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-filters-row .button {
	color: #fff;
	border: 0;
	background: #0360a5;
	padding: 12px 20px;
	min-width: 150px;
	height: 100%;
	border-radius: 5px;
	text-align: center;
}

.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-filters-row .button:focus {
	outline: none;
}

.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-filters-row .button:hover {
	background: #000;
	color: #fff;
}

/* Pagination – order-list style */
.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-pagination {
	width: 100%;
	list-style: none;
	justify-content: center;
	margin-top: 50px;
	padding-top: 1em;
	border-top: 1px solid var(--woocommerce-table-border, #e5e5e5);
}

.woocommerce .oceaniclink-ph-pagination .page-numbers li {
	margin-right: 10px;
	border: none;
}

.woocommerce .oceaniclink-ph-pagination .page-numbers li a,
.woocommerce .oceaniclink-ph-pagination .page-numbers li span:not(.current) {
	border: 1px solid #eaeaea;
	padding: 5px 13px;
	text-decoration: none;
	color: #000;
	background-color: #f5f5f5;
	display: block;
	border-radius: 5px;
}

.woocommerce .oceaniclink-ph-pagination .page-numbers .current {
	color: #fff;
	background-color: #1d73be;
	border: 1px solid #1d73be;
	display: inline-block;
	padding: 5px 13px;
	text-decoration: none;
	border-radius: 5px;
}

.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table .ph-image {
	text-align: center;
}

.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table .ph-sku {
	text-align: center;
}

.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table .ph-year {
	text-align: center;
}

/* Responsive – quantity input width */
@media screen and (max-width: 1199px) {
	.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table tbody .ph-qty .quantity input[type="number"] {
		width: 50px;
	}
}

/* Responsive – WooCommerce shop_table_responsive pattern */
@media screen and (max-width: 768px) {
	.woocommerce .oceaniclink-purchase-history-tab .shop_table.oceaniclink-ph-table.shop_table_responsive {
		display: block;
	}

	.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table thead {
		display: none;
	}

	.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table tbody tr {
		display: block;
		border: 1px solid var(--woocommerce-table-border, #e5e5e5);
		margin-bottom: 1em;
		padding: 1em;
		border-radius: 4px;
		background: #fff;
	}

	.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table tbody tr:hover {
		background: var(--woocommerce-table-row-hover, #fafafa);
	}

	.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table td {
		display: flex;
		align-items: center;
		padding: 0.625em 0;
		border-bottom: 1px solid #eee;
	}

	.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table td:last-child {
		border-bottom: 0;
	}

	.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table td::before {
		content: attr(data-title);
		font-weight: 600;
		min-width: 100px;
		margin-right: 0.75em;
		color: var(--woocommerce-body-color, #333);
	}

	.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table .ph-image {
		justify-content: flex-start;
	}

	.woocommerce .oceaniclink-purchase-history-tab .oceaniclink-ph-table .ph-qty .oceaniclink-ph-add-to-cart-form {
		flex-wrap: wrap;
	}
}
