/* ==========================================================================
   Sharp-Rite — My Account dashboard
   Loaded only on the WooCommerce My Account pages.
   ========================================================================== */

:root {
	--sr-navy: #1a2233;
	--sr-navy-light: #212b40;
	--sr-red: #e23744;
	--sr-red-dark: #c92230;
	--sr-bg: #f4f4f4;
	--sr-border: #e5e5e5;
}

/* ---- Account nav menu (Flatsome already provides the .large-3 / .large-9
   two-column layout via page-my-account.php — we only restyle the menu
   itself and the boxes appended after it). ---- */
.woocommerce-account .woocommerce-MyAccount-navigation ul {
	list-style: none;
	margin: 0 0 20px;
	padding: 0;
	background: #fff;
	border: 1px solid var(--sr-border);
	border-radius: 10px;
	overflow: hidden;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li {
	border-bottom: 1px solid var(--sr-border);
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li:last-child {
	border-bottom: none;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li a {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 13px 18px;
	color: var(--sr-navy);
	font-weight: 600;
	font-size: 0.95em;
	text-decoration: none;
	transition: background 0.15s ease, color 0.15s ease;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li a:hover {
	background: var(--sr-bg);
	color: var(--sr-red);
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li.is-active a {
	background: var(--sr-navy);
	color: #fff;
}

/* ---- Mobile / tablet: content first, menu as a dropdown selector ---- */
.sr-acc-select { display: none; }
.sr-acc-select__label {
	position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

@media (max-width: 849px) {
	/* Let the nav, the select and the info boxes be ordered against the content column. */
	.woocommerce-account .large-3.col.col-border { display: contents; }
	.woocommerce-account .large-9.col { order: 2; }

	.woocommerce-account .woocommerce-MyAccount-navigation { display: none; }

	.woocommerce-account .sr-acc-select {
		display: block;
		order: 1;
		flex: 0 0 calc(100% - 30px);
		margin: 0 15px 18px;
		position: relative;
	}
	.woocommerce-account .sr-acc-select::after {
		content: "";
		position: absolute; right: 18px; top: 50%;
		width: 9px; height: 9px; margin-top: -7px;
		border-right: 2px solid var(--sr-navy); border-bottom: 2px solid var(--sr-navy);
		transform: rotate(45deg);
		pointer-events: none;
	}
	.woocommerce-account .sr-acc-select select {
		display: block; width: 100%; margin: 0;
		height: 52px; padding: 0 46px 0 18px;
		background: #fff; color: var(--sr-navy);
		border: 1px solid var(--sr-border); border-radius: 16px;
		font-size: 16px; font-weight: 700;
		box-shadow: 0 1px 2px rgba(20, 19, 18, .04);
		-webkit-appearance: none; appearance: none;
	}
	.woocommerce-account .sr-acc-select select:focus { outline: 2px solid var(--sr-red); outline-offset: 2px; border-color: var(--sr-red); }

	/* On the dashboard itself the greeting and tiles come first, the selector follows. */
	.sr-acc-dashboard .sr-acc-select { order: 3; margin-top: 4px; }

	.woocommerce-account .sr-account-sidebar-box {
		order: 5;
		flex: 0 0 calc(100% - 30px);
		width: calc(100% - 30px);
		margin: 0 15px 20px;
	}
	.woocommerce-account .sr-account-sidebar-box:first-of-type { margin-top: 0; }
}

/* ---- Sidebar info boxes (appended after the nav menu) ----
   Flatsome floats .woocommerce-MyAccount-navigation left inside the
   .large-3 column, so anything after it needs float:none + clear:both
   to drop below the nav instead of wrapping beside it. */
.large-3.col.col-border {
	overflow: hidden;
}

.sr-account-sidebar-box {
	clear: both;
	float: none;
	width: 100%;
	box-sizing: border-box;
	background: #fff;
	border: 1px solid var(--sr-border);
	border-radius: 10px;
	padding: 20px;
	margin: 0 0 20px;
}

.sr-account-sidebar-box:first-of-type {
	margin-top: 20px;
}

.sr-account-sidebar-box h4 {
	margin: 0 0 12px;
	font-size: 0.95em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: var(--sr-navy);
}

.sr-account-sidebar-box .sr-phone-button {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: var(--sr-navy);
	color: #fff;
	text-decoration: none;
	font-weight: 700;
	padding: 12px;
	border-radius: 8px;
	margin-bottom: 10px;
	transition: background 0.15s ease;
}

.sr-account-sidebar-box .sr-phone-button:hover {
	background: var(--sr-navy-light);
	color: #fff;
}

.sr-account-sidebar-box .sr-contact-button {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: #fff;
	color: var(--sr-navy);
	text-decoration: none;
	font-weight: 700;
	padding: 11px;
	border: 1px solid var(--sr-navy);
	border-radius: 8px;
	margin-bottom: 10px;
	transition: all 0.15s ease;
}

.sr-account-sidebar-box .sr-contact-button:hover {
	background: var(--sr-navy);
	color: #fff;
}

.sr-account-sidebar-box .sr-services-button {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: var(--sr-red);
	color: #fff;
	text-decoration: none;
	font-weight: 700;
	padding: 12px;
	border-radius: 8px;
	transition: background 0.15s ease;
}

.sr-account-sidebar-box .sr-services-button:hover {
	background: var(--sr-red-dark);
	color: #fff;
}

.sr-account-sidebar-box svg {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
}

.sr-hours-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9em;
}

.sr-hours-table td {
	padding: 6px 0;
	border-bottom: 1px solid var(--sr-border);
	color: var(--sr-navy);
}

.sr-hours-table tr:last-child td {
	border-bottom: none;
}

.sr-hours-table td:first-child {
	font-weight: 600;
}

.sr-hours-table td:last-child {
	text-align: right;
}

.sr-hours-closed {
	color: var(--sr-red);
	font-weight: 700;
}

.sr-hours-dot {
	display: inline-block;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--sr-red);
	margin-right: 6px;
}

/* ---- Dashboard content ---- */
.sr-dashboard-greeting h1 {
	font-size: 1.9em;
	font-weight: 800;
	color: var(--sr-navy);
	margin: 0 0 6px;
}

.sr-dashboard-greeting p {
	color: #666;
	margin: 0 0 28px;
	font-size: 1.05em;
}

.sr-dashboard-cards {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
	margin-bottom: 28px;
}

@media only screen and (max-width: 849px) {
	.sr-dashboard-cards {
		grid-template-columns: repeat(2, 1fr);
	}
}

.sr-dashboard-card {
	display: block;
	background: var(--sr-navy);
	color: #fff;
	text-decoration: none;
	border-radius: 10px;
	padding: 26px 18px;
	text-align: center;
	transition: transform 0.15s ease, background 0.15s ease;
}

.sr-dashboard-card:hover {
	background: var(--sr-red);
	color: #fff;
	transform: translateY(-2px);
}

.sr-dashboard-card svg {
	width: 30px;
	height: 30px;
	margin-bottom: 10px;
}

.sr-dashboard-card strong {
	display: block;
	font-size: 0.98em;
	margin-bottom: 4px;
}

.sr-dashboard-card span {
	display: block;
	font-size: 0.8em;
	text-decoration: underline;
	opacity: 0.85;
}

.sr-dashboard-panel {
	background: var(--sr-bg);
	border-radius: 10px;
	padding: 22px;
	margin-bottom: 20px;
}

.sr-dashboard-panel h3 {
	margin: 0 0 14px;
	font-size: 1.05em;
	font-weight: 800;
	color: var(--sr-navy);
}

.sr-dashboard-panel address {
	font-style: normal;
	line-height: 1.7;
	color: #333;
}

.sr-dashboard-panel address strong {
	display: block;
	margin-bottom: 4px;
	color: var(--sr-navy);
}

.sr-dashboard-panel .sr-manage-data {
	display: inline-block;
	margin-top: 12px;
	font-weight: 700;
	color: var(--sr-red);
	text-decoration: none;
}

.sr-dashboard-panel .sr-manage-data:hover {
	text-decoration: underline;
}

.sr-orders-table {
	width: 100%;
	border-collapse: collapse;
}

.sr-orders-table th {
	text-align: left;
	font-size: 0.85em;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #888;
	font-weight: 700;
	padding: 0 0 10px;
	border-bottom: 2px solid var(--sr-border);
}

.sr-orders-table td {
	padding: 14px 10px 14px 0;
	border-bottom: 1px solid var(--sr-border);
	vertical-align: middle;
}

.sr-orders-table tr:last-child td {
	border-bottom: none;
}

.sr-order-status {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 20px;
	font-size: 0.82em;
	font-weight: 700;
	background: #e7f6ec;
	color: #1f8a4c;
}

.sr-order-status.status-pending,
.sr-order-status.status-on-hold {
	background: #fdf2e0;
	color: #b3760c;
}

.sr-order-status.status-cancelled,
.sr-order-status.status-failed,
.sr-order-status.status-refunded {
	background: #fbe6e7;
	color: var(--sr-red-dark);
}

.sr-order-view {
	display: inline-block;
	background: var(--sr-navy);
	color: #fff;
	text-decoration: none;
	font-weight: 700;
	font-size: 0.85em;
	padding: 8px 16px;
	border-radius: 20px;
	transition: background 0.15s ease;
}

.sr-order-view:hover {
	background: var(--sr-red);
	color: #fff;
}

.sr-no-orders {
	color: #777;
}

.sr-no-orders a {
	color: var(--sr-red);
	font-weight: 700;
}

/* ---------------------------------------------------------------------
   Orders and Addresses pages: buttons no longer collide with the table
   cells, titles or the notice bar above.
   ------------------------------------------------------------------- */
body.sr-account .woocommerce-notices-wrapper { position: relative; z-index: 1; }
body.sr-account .woocommerce-notices-wrapper:empty { display: none; }
body.sr-account .woocommerce-message,
body.sr-account .woocommerce-info,
body.sr-account .woocommerce-error {
	position: static !important;
	margin: 0 0 18px !important;
	padding: 14px 18px !important;
	border-radius: 14px;
	display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
	line-height: 1.4;
}
body.sr-account .woocommerce-message .button,
body.sr-account .woocommerce-info .button,
body.sr-account .woocommerce-error .button {
	position: static !important; float: none !important; margin: 0 0 0 auto !important; flex: none;
}

body.sr-account table.woocommerce-orders-table { width: 100%; table-layout: auto; border-collapse: separate; border-spacing: 0; }
body.sr-account table.woocommerce-orders-table th,
body.sr-account table.woocommerce-orders-table td { padding: 14px 12px; vertical-align: middle; }
body.sr-account table.woocommerce-orders-table td.woocommerce-orders-table__cell-order-actions {
	display: table-cell;
	white-space: normal;
}
body.sr-account .woocommerce-orders-table__cell-order-actions,
body.sr-account .woocommerce-orders-table__header-order-actions { min-width: 150px; }
body.sr-account .woocommerce-orders-table .woocommerce-button,
body.sr-account .woocommerce-orders-table a.button,
body.sr-account .woocommerce-MyAccount-content .woocommerce-pagination .button,
body.sr-account .woocommerce-Addresses a.edit,
body.sr-account .woocommerce-MyAccount-content a.edit {
	display: inline-flex !important; align-items: center; justify-content: center;
	height: 38px; min-height: 0; line-height: 1 !important;
	padding: 0 18px !important; margin: 0 6px 6px 0 !important;
	border-radius: 999px !important; font-size: 13.5px; font-weight: 600;
	text-transform: none; letter-spacing: 0; white-space: nowrap;
	float: none !important; position: static !important;
}
body.sr-account .woocommerce-orders-table a.button.view,
body.sr-account .woocommerce-orders-table a.woocommerce-button.view { background: var(--sr-ink, #111) !important; color: #fff !important; border: 0 !important; }
body.sr-account .woocommerce-orders-table a.button.pay { background: var(--sr-red) !important; color: #fff !important; border: 0 !important; }
body.sr-account .woocommerce-orders-table a.button.cancel { background: transparent !important; color: var(--sr-ink, #111) !important; border: 1.5px solid #d6d2cc !important; }

/* Addresses: the Edit link becomes a tidy pill beside the heading */
body.sr-account .woocommerce-Addresses { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 0 !important; }
body.sr-account .woocommerce-Addresses .col-1,
body.sr-account .woocommerce-Addresses .col-2,
body.sr-account .woocommerce-Addresses .woocommerce-Address {
	float: none !important; width: auto !important; max-width: none !important; padding: 20px !important;
	background: var(--sr-bg, #f6f4f1); border-radius: 18px; margin: 0 !important;
}
body.sr-account .woocommerce-Address-title { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
body.sr-account .woocommerce-Address-title h3,
body.sr-account .woocommerce-Address-title h2 { margin: 0 !important; font-size: 19px; flex: 1 1 auto; min-width: 0; }
body.sr-account .woocommerce-Addresses a.edit { margin: 0 !important; background: #fff !important; color: var(--sr-ink, #111) !important; border: 1.5px solid #d6d2cc !important; }
body.sr-account .woocommerce-Addresses a.edit:hover { background: var(--sr-ink, #111) !important; color: #fff !important; border-color: var(--sr-ink, #111) !important; }
body.sr-account .woocommerce-Address address { font-style: normal; line-height: 1.6; }
body.sr-account .woocommerce-address-fields .button,
body.sr-account .woocommerce-MyAccount-content button[type="submit"] { margin-top: 8px; }

@media (max-width: 849px) {
	body.sr-account .woocommerce-Addresses { grid-template-columns: 1fr; }
	/* Orders become stacked cards, each cell on its own labelled line */
	body.sr-account table.woocommerce-orders-table thead { display: none; }
	body.sr-account table.woocommerce-orders-table,
	body.sr-account table.woocommerce-orders-table tbody { display: block; }
	body.sr-account table.woocommerce-orders-table tr {
		display: block; margin: 0 0 14px; padding: 6px 4px; background: var(--sr-bg, #f6f4f1); border-radius: 18px; border: 0;
	}
	body.sr-account table.woocommerce-orders-table td {
		display: flex !important; align-items: center; justify-content: space-between; gap: 12px;
		padding: 9px 14px; border: 0 !important; text-align: right !important;
	}
	body.sr-account table.woocommerce-orders-table td::before {
		content: attr(data-title); float: none; font-weight: 600; color: #6d6863; text-align: left; flex: none;
	}
	body.sr-account table.woocommerce-orders-table td.woocommerce-orders-table__cell-order-actions {
		display: flex !important; flex-wrap: wrap; justify-content: flex-end; padding-top: 12px;
	}
	body.sr-account table.woocommerce-orders-table td.woocommerce-orders-table__cell-order-actions::before { display: none; }
	body.sr-account .woocommerce-orders-table .woocommerce-button,
	body.sr-account .woocommerce-orders-table a.button { margin: 0 0 0 8px !important; }
}
