/**
 * Flycart — My Account.
 *
 * Loaded on every account page (see fcx_account_enqueue_assets). The
 * subscription-card rules below were moved here verbatim from the inline
 * <style> block in myaccount/my-subscriptions.php: the dashboard renders the
 * same cards and never loads that template, so the CSS could not stay there.
 * Being a real stylesheet also means it is cached rather than re-sent inside
 * the HTML on every request.
 *
 * Sections:
 *   1. Subscription cards           (moved from my-subscriptions.php)
 *   2. Attention cards + Renew Now  (new)
 *   3. Dashboard subscriptions      (new)
 *   4. Addresses / Account details  (new)
 *   5. Focus states                 (new)
 */

/* =========================================================================
   1. SUBSCRIPTION CARDS — moved from myaccount/my-subscriptions.php
   ========================================================================= */

/* ── Subscriptions Card Layout ── */
.wcs-subscriptions-wrapper { max-width: 960px; }
.wcs-subscriptions-wrapper *,
.wcs-subscriptions-wrapper *::before,
.wcs-subscriptions-wrapper *::after { box-sizing: border-box; }

.wcs-subscriptions-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.wcs-subscriptions-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}
.wcs-subscription-count {
    font-size: 13px;
    color: #64748b;
    background: #e2e8f0;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 500;
}

/* ── Card ── */
.wcs-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.wcs-card:hover {
    box-shadow: 0 4px 16px rgba(31, 135, 255, 0.08);
    border-color: #c7d2fe;
}

.wcs-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0 24px;
}
.wcs-card-top-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wcs-sub-id {
    font-size: 14px;
    font-weight: 600;
    color: #1f87ff;
    text-decoration: none;
}
.wcs-sub-id:hover { text-decoration: underline; }

/* ── Status Badges ── */
.wcs-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    letter-spacing: 0.02em;
    text-transform: capitalize;
}
.wcs-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.wcs-badge-active { background: #ecfdf5; color: #065f46; }
.wcs-badge-active::before { background: #10b981; }
.wcs-badge-on-hold { background: #fef9c3; color: #854d0e; }
.wcs-badge-on-hold::before { background: #eab308; }
.wcs-badge-pending-cancel,
.wcs-badge-pending-cancellation { background: #fef2f2; color: #991b1b; }
.wcs-badge-pending-cancel::before,
.wcs-badge-pending-cancellation::before { background: #ef4444; }
.wcs-badge-cancelled,
.wcs-badge-expired { background: #f1f5f9; color: #475569; }
.wcs-badge-cancelled::before,
.wcs-badge-expired::before { background: #94a3b8; }

/* ── Card Body ── */
.wcs-card-body { padding: 12px 24px 20px 24px; }
.wcs-product-name {
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 4px;
}
.wcs-product-name a { color: #0f172a; text-decoration: none; }
.wcs-product-name a:hover { color: #1f87ff; }
.wcs-product-variant {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 16px;
}
.wcs-product-variant strong { color: #475569; font-weight: 600; }

.wcs-meta-row {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
}
.wcs-meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.wcs-meta-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
}
.wcs-meta-value {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}
.wcs-meta-value .wcs-period {
    font-weight: 400;
    color: #64748b;
    font-size: 13px;
}
.wcs-meta-value .wcs-payment-method {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: #94a3b8;
    margin-top: 2px;
}

/* ── Card Footer ── */
.wcs-card-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 24px;
    border-top: 1px solid #f1f5f9;
    background: #fafbfc;
}

.wcs-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
    line-height: 1.4;
}
.wcs-btn svg { width: 15px; height: 15px; }
.wcs-btn-primary { background: #1f87ff; color: #ffffff; }
.wcs-btn-primary:hover {
    background: #0b6fde;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(31, 135, 255, 0.25);
}
.wcs-btn-outline {
    background: #ffffff;
    color: #475569;
    border: 1px solid #e2e8f0;
}
.wcs-btn-outline:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
}

/* Hook-rendered buttons (Upgrade, Resubscribe, etc.) */
.wcs-card-footer a.wcs-switch-link {
    margin-top: 0 !important;
}
.wcs-card-footer a.button,
.wcs-card-footer button.button,
.wcs-card-footer .woocommerce-button,
.wcs-card-footer a.wcs-switch-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #475569;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
    line-height: 1.4;
}
.wcs-card-footer a.button:hover,
.wcs-card-footer button.button:hover,
.wcs-card-footer .woocommerce-button:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
}
/* Upgrade button — light green highlighted */
.wcs-card-footer a.button.wcs-switch-link,
.wcs-card-footer a.wcs-switch-link {
    background: #f0fdf4 !important;
    color: #16a34a !important;
    border: 1px solid #bbf7d0 !important;
}
.wcs-card-footer a.button.wcs-switch-link:hover,
.wcs-card-footer a.wcs-switch-link:hover {
    background: #dcfce7 !important;
    color: #15803d !important;
    border-color: #86efac !important;
}

/* ── Empty State ── */
.wcs-empty-state {
    text-align: center;
    padding: 60px 24px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}
.wcs-empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: #eff6ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.wcs-empty-icon svg { width: 28px; height: 28px; color: #1f87ff; }
.wcs-empty-state h3 {
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 6px;
}
.wcs-empty-state p {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 20px;
}

/* ── Pagination ── */
.wcs-pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 24px;
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .wcs-card-top { flex-direction: column; align-items: flex-start; gap: 8px; }
    .wcs-meta-row { gap: 20px; }
    .wcs-meta-item { min-width: 100px; }
    .wcs-card-footer { flex-direction: column; }
    .wcs-card-footer .wcs-btn { width: 100%; justify-content: center; }
    .wcs-subscriptions-header { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* =========================================================================
   1b. SUBSCRIPTION DETAIL CARDS — moved from myaccount/view-subscription.php

   These .wvs-* rules used to live in that template's inline <style>. The
   Addresses and Account details pages reuse .wvs-card for their panels and
   never load that template, so the cards rendered unstyled and the header
   icons — SVGs with no intrinsic size — expanded to the full container width.
   Every selector here is scoped under .wvs-, so moving it changes nothing on
   the subscription page.
   ========================================================================= */

/* ══════════════════════════════════════════
   WVS — View Subscription Card Layout
   ══════════════════════════════════════════ */
.wvs-wrapper *, .wvs-wrapper *::before, .wvs-wrapper *::after { box-sizing: border-box; }
.wvs-wrapper {
	max-width: 960px;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
	             Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	color: #1e293b;
	line-height: 1.5;
}

/* ── Page Header ── */
.wvs-page-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 24px;
	flex-wrap: wrap;
	gap: 12px;
}
.wvs-page-header-left {
	display: flex;
	align-items: center;
	gap: 12px;
}
.wvs-page-header h2 {
	font-size: 22px;
	font-weight: 700;
	color: #0f172a;
	margin: 0;
	padding: 0;
}
.wvs-back-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	font-weight: 600;
	color: #64748b;
	text-decoration: none;
	padding: 6px 14px;
	border-radius: 8px;
	border: 1px solid #e2e8f0;
	background: #ffffff;
	transition: all 0.15s ease;
}
.wvs-back-link:hover {
	background: #f8fafc;
	border-color: #cbd5e1;
	color: #1e293b;
}
.wvs-back-link svg { width: 14px; height: 14px; }

/* ── Status Badges ── */
.wvs-badge {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 12px;
	font-weight: 600;
	padding: 4px 12px;
	border-radius: 20px;
	letter-spacing: 0.02em;
	text-transform: capitalize;
}
.wvs-badge::before {
	content: "";
	width: 6px;
	height: 6px;
	border-radius: 50%;
	flex-shrink: 0;
}
.wvs-badge-active { background: #ecfdf5; color: #065f46; }
.wvs-badge-active::before { background: #10b981; }
.wvs-badge-on-hold { background: #fef9c3; color: #854d0e; }
.wvs-badge-on-hold::before { background: #eab308; }
.wvs-badge-pending-cancel,
.wvs-badge-pending-cancellation { background: #fef2f2; color: #991b1b; }
.wvs-badge-pending-cancel::before,
.wvs-badge-pending-cancellation::before { background: #ef4444; }
.wvs-badge-cancelled,
.wvs-badge-expired { background: #f1f5f9; color: #475569; }
.wvs-badge-cancelled::before,
.wvs-badge-expired::before { background: #94a3b8; }

/* ── Card ── */
.wvs-card {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	margin-bottom: 20px;
	overflow: hidden;
	transition: box-shadow 0.2s ease;
}
.wvs-card:hover {
	box-shadow: 0 4px 16px rgba(31, 135, 255, 0.06);
}
.wvs-card-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 24px;
	border-bottom: 1px solid #f1f5f9;
	background: #fafbfc;
}
.wvs-card-header h3 {
	font-size: 15px;
	font-weight: 700;
	color: #0f172a;
	margin: 0;
	display: flex;
	align-items: center;
	gap: 8px;
}
.wvs-card-header h3 svg { width: 18px; height: 18px; color: #94a3b8; }
.wvs-card-body { padding: 20px 24px; }

/* ── Details Grid ── */
.wvs-details-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 20px;
}
.wvs-detail-item {
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.wvs-detail-label {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #94a3b8;
}
.wvs-detail-value {
	font-size: 14px;
	font-weight: 600;
	color: #1e293b;
}

/* ── Auto Renew Toggle (preserve original behavior) ── */
.wvs-card .wcs-auto-renew-toggle {
	display: flex;
	align-items: center;
	gap: 8px;
}

/* ── Actions Row ── */
.wvs-actions-row {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 16px 24px;
	border-top: 1px solid #f1f5f9;
	background: #fafbfc;
	flex-wrap: wrap;
}

/* ── Buttons ── */
.wvs-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	font-weight: 600;
	padding: 8px 18px;
	border-radius: 8px;
	border: none;
	cursor: pointer;
	text-decoration: none !important;
	transition: all 0.15s ease;
	line-height: 1.4;
}
.wvs-btn svg { width: 15px; height: 15px; }
.wvs-btn-primary { background: #1f87ff; color: #ffffff !important; }
.wvs-btn-primary:hover {
	background: #0b6fde;
	color: #ffffff !important;
	box-shadow: 0 2px 8px rgba(31, 135, 255, 0.25);
}
.wvs-btn-outline {
	background: #ffffff;
	color: #475569 !important;
	border: 1px solid #e2e8f0;
}
.wvs-btn-outline:hover {
	background: #f8fafc;
	border-color: #cbd5e1;
	color: #1e293b !important;
}
.wvs-btn-danger,
.wvs-btn-muted {
	background: #f8fafc !important;
	color: #94a3b8 !important;
	border: 1px solid #e2e8f0 !important;
}
.wvs-btn-danger:hover,
.wvs-btn-muted:hover {
	background: #f1f5f9 !important;
	border-color: #cbd5e1 !important;
	color: #64748b !important;
}
.wvs-btn-success {
	background: #16a34a !important;
	color: #ffffff !important;
	border: 1px solid #16a34a !important;
	box-shadow: 0 1px 3px rgba(22, 163, 74, 0.2);
}
.wvs-btn-success:hover {
	background: #15803d !important;
	color: #ffffff !important;
	border-color: #15803d !important;
	box-shadow: 0 2px 8px rgba(22, 163, 74, 0.3);
}

/* Hook-rendered buttons inside actions row */
.wvs-actions-row a.button,
.wvs-actions-row button.button,
.wvs-actions-row .woocommerce-button,
.wvs-actions-row a.wcs-switch-link {
	display: inline-flex !important;
	align-items: center;
	gap: 6px;
	font-size: 13px !important;
	font-weight: 600 !important;
	padding: 8px 18px !important;
	border-radius: 8px !important;
	border: 1px solid #e2e8f0 !important;
	background: #ffffff !important;
	color: #475569 !important;
	cursor: pointer;
	text-decoration: none !important;
	transition: all 0.15s ease;
	line-height: 1.4 !important;
	margin: 0 !important;
}
.wvs-actions-row a.button:hover,
.wvs-actions-row button.button:hover,
.wvs-actions-row .woocommerce-button:hover,
.wvs-actions-row a.wcs-switch-link:hover {
	background: #f8fafc !important;
	border-color: #cbd5e1 !important;
	color: #1e293b !important;
}

/* ── Subscription Totals Table ── */
.wvs-card table.shop_table,
.wvs-card table.order_details {
	width: 100% !important;
	border: none !important;
	border-collapse: collapse !important;
	margin: 0 !important;
	border-radius: 0 !important;
}
.wvs-card table.shop_table thead,
.wvs-card table.order_details thead {
	background: #f8fafc !important;
}
.wvs-card table.shop_table thead th,
.wvs-card table.order_details thead th {
	font-size: 11px !important;
	font-weight: 600 !important;
	text-transform: uppercase !important;
	letter-spacing: 0.05em !important;
	color: #64748b !important;
	padding: 12px 24px !important;
	border-bottom: 1px solid #e2e8f0 !important;
	background: transparent !important;
}
.wvs-card table.shop_table tbody td,
.wvs-card table.order_details tbody td {
	font-size: 14px !important;
	color: #1e293b !important;
	padding: 14px 24px !important;
	border-bottom: 1px solid #f1f5f9 !important;
	vertical-align: middle !important;
	background: #ffffff !important;
}
.wvs-card table.shop_table tbody td a,
.wvs-card table.order_details tbody td a {
	color: #1f87ff !important;
	text-decoration: none !important;
	font-weight: 500;
}
.wvs-card table.shop_table tbody td a:hover,
.wvs-card table.order_details tbody td a:hover {
	text-decoration: underline !important;
}
.wvs-card table.shop_table tbody td .remove,
.wvs-card table.order_details tbody td .remove {
	color: #dc2626 !important;
	font-size: 18px !important;
	text-decoration: none !important;
}
.wvs-card table.shop_table tfoot th,
.wvs-card table.order_details tfoot th {
	font-size: 13px !important;
	font-weight: 600 !important;
	color: #64748b !important;
	padding: 12px 24px !important;
	border-top: 1px solid #e2e8f0 !important;
	text-align: left !important;
	background: #fafbfc !important;
}
.wvs-card table.shop_table tfoot td,
.wvs-card table.order_details tfoot td {
	font-size: 14px !important;
	font-weight: 700 !important;
	color: #0f172a !important;
	padding: 12px 24px !important;
	border-top: 1px solid #e2e8f0 !important;
	background: #fafbfc !important;
}

/* Product quantity styling */
.wvs-card .product-quantity {
	font-weight: 500 !important;
	color: #64748b !important;
}

/* ── Related Orders Table ── */
.wvs-card table.shop_table_responsive tbody td[data-title]::before {
	font-size: 11px !important;
	font-weight: 600 !important;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #94a3b8 !important;
}
.wvs-card table.shop_table tbody tr:last-child td,
.wvs-card table.order_details tbody tr:last-child td {
	border-bottom: none !important;
}

/* Order actions buttons inside table */
.wvs-card table.shop_table a.button,
.wvs-card table.shop_table a.woocommerce-button {
	display: inline-flex !important;
	align-items: center;
	font-size: 12px !important;
	font-weight: 600 !important;
	padding: 5px 14px !important;
	border-radius: 6px !important;
	border: 1px solid #e2e8f0 !important;
	background: #ffffff !important;
	color: #475569 !important;
	text-decoration: none !important;
	transition: all 0.15s ease;
	line-height: 1.4 !important;
	margin: 2px 4px 2px 0 !important;
}
.wvs-card table.shop_table a.button:hover,
.wvs-card table.shop_table a.woocommerce-button:hover {
	background: #f8fafc !important;
	border-color: #cbd5e1 !important;
	color: #1e293b !important;
}

/* ── Customer Address ── */
.wvs-card .woocommerce-columns {
	margin: 0 !important;
	padding: 0 !important;
}
.wvs-card .woocommerce-columns .woocommerce-column {
	margin: 0 !important;
	padding: 0 !important;
	float: none !important;
	width: 100% !important;
}
.wvs-card .woocommerce-columns .woocommerce-column h2 {
	display: none !important;
}
.wvs-card .woocommerce-column address {
	font-size: 14px !important;
	line-height: 1.7 !important;
	color: #475569 !important;
	font-style: normal !important;
	padding: 0 !important;
	border: none !important;
	background: none !important;
}
.wvs-card .woocommerce-column address p {
	margin: 0 0 4px !important;
}

/* ── Subscription Updates ── */
.wvs-card .woocommerce-OrderUpdates {
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
}
.wvs-card .woocommerce-OrderUpdate {
	padding: 12px 0 !important;
	border-bottom: 1px solid #f1f5f9 !important;
	margin: 0 !important;
}
.wvs-card .woocommerce-OrderUpdate:last-child {
	border-bottom: none !important;
}
.wvs-card .woocommerce-OrderUpdate-meta {
	font-size: 12px !important;
	color: #94a3b8 !important;
	margin-bottom: 4px !important;
}
.wvs-card .woocommerce-OrderUpdate-description p {
	font-size: 14px !important;
	color: #475569 !important;
	margin: 0 !important;
}

/* ── Hide duplicate h2 rendered by hook templates inside cards ── */
.wvs-card .wvs-card-body h2,
.wvs-card .wvs-card-body > h2 {
	display: none !important;
}

/* ── Upgrade / Switch link inside totals table ── */
.wvs-card table.shop_table a.button.wcs-switch-link,
.wvs-card table.order_details a.button.wcs-switch-link,
.wvs-card table.shop_table a.wcs-switch-link,
.wvs-card table.order_details a.wcs-switch-link {
	display: inline-flex !important;
	align-items: center;
	font-size: 11px !important;
	font-weight: 600 !important;
	padding: 4px 12px !important;
	border-radius: 5px !important;
	border: 1px solid #bbf7d0 !important;
	background: #f0fdf4 !important;
	color: #16a34a !important;
	text-decoration: none !important;
	transition: all 0.15s ease;
	line-height: 1.4 !important;
	margin: 0 0 0 8px !important;
	gap: 4px;
}
.wvs-card table.shop_table a.button.wcs-switch-link:hover,
.wvs-card table.order_details a.button.wcs-switch-link:hover,
.wvs-card table.shop_table a.wcs-switch-link:hover,
.wvs-card table.order_details a.wcs-switch-link:hover {
	background: #dcfce7 !important;
	border-color: #86efac !important;
	color: #15803d !important;
	box-shadow: 0 2px 6px rgba(22, 163, 74, 0.15);
}

/* ── Related Orders Card (rendered by hook outside card wrapper) ── */
.wvs-related-orders-wrap {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	margin-bottom: 20px;
	overflow: hidden;
	transition: box-shadow 0.2s ease;
}
.wvs-related-orders-wrap:hover {
	box-shadow: 0 4px 16px rgba(31, 135, 255, 0.06);
}
.wvs-related-orders-wrap:empty {
	display: none;
}
/* Style the header h2 rendered by related-orders.php */
.wvs-related-orders-wrap > header,
.wvs-related-orders-wrap > .woocommerce-subscription-related-orders > header {
	display: flex;
	align-items: center;
	padding: 16px 24px;
	border-bottom: 1px solid #f1f5f9;
	background: #fafbfc;
}
.wvs-related-orders-wrap > header h2,
.wvs-related-orders-wrap > .woocommerce-subscription-related-orders > header h2,
.wvs-related-orders-wrap h2 {
	font-size: 15px !important;
	font-weight: 700 !important;
	color: #0f172a !important;
	margin: 0 !important;
	padding: 0 !important;
}
/* Style the table inside Related Orders */
.wvs-related-orders-wrap table.shop_table,
.wvs-related-orders-wrap table.order_details {
	width: 100% !important;
	border: none !important;
	border-collapse: collapse !important;
	margin: 0 !important;
	border-radius: 0 !important;
}
.wvs-related-orders-wrap table.shop_table thead {
	background: #f8fafc !important;
}
.wvs-related-orders-wrap table.shop_table thead th {
	font-size: 11px !important;
	font-weight: 600 !important;
	text-transform: uppercase !important;
	letter-spacing: 0.05em !important;
	color: #64748b !important;
	padding: 12px 24px !important;
	border-bottom: 1px solid #e2e8f0 !important;
	background: transparent !important;
}
.wvs-related-orders-wrap table.shop_table tbody td {
	font-size: 14px !important;
	color: #1e293b !important;
	padding: 14px 24px !important;
	border-bottom: 1px solid #f1f5f9 !important;
	vertical-align: middle !important;
	background: #ffffff !important;
}
.wvs-related-orders-wrap table.shop_table tbody td a {
	color: #1f87ff !important;
	text-decoration: none !important;
	font-weight: 500;
}
.wvs-related-orders-wrap table.shop_table tbody td a:hover {
	text-decoration: underline !important;
}
.wvs-related-orders-wrap table.shop_table tbody tr:last-child td {
	border-bottom: none !important;
}
/* View button in Related Orders table */
.wvs-related-orders-wrap table.shop_table a.button,
.wvs-related-orders-wrap table.shop_table a.woocommerce-button {
	display: inline-flex !important;
	align-items: center;
	gap: 4px;
	font-size: 12px !important;
	font-weight: 600 !important;
	padding: 6px 14px !important;
	border-radius: 6px !important;
	border: 1px solid #e2e8f0 !important;
	background: #ffffff !important;
	color: #475569 !important;
	text-decoration: none !important;
	transition: all 0.15s ease;
	line-height: 1.4 !important;
	margin: 0 !important;
}
.wvs-related-orders-wrap table.shop_table a.button:hover,
.wvs-related-orders-wrap table.shop_table a.woocommerce-button:hover {
	background: #f8fafc !important;
	border-color: #cbd5e1 !important;
	color: #1e293b !important;
}
/* Responsive data-title labels */
.wvs-related-orders-wrap table.shop_table_responsive tbody td[data-title]::before {
	font-size: 11px !important;
	font-weight: 600 !important;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #94a3b8 !important;
}

/* ── Responsive ── */
@media (max-width: 640px) {
	.wvs-page-header { flex-direction: column; align-items: flex-start; }
	.wvs-details-grid { grid-template-columns: 1fr 1fr; }
	.wvs-actions-row { flex-direction: column; }
	.wvs-actions-row .wvs-btn,
	.wvs-actions-row a.button {
		width: 100% !important;
		justify-content: center;
	}
}

/* =========================================================================
   2. ATTENTION CARDS + RENEW NOW
   On-hold and pending-cancel subscriptions. The red border says something is
   wrong; the strip says what, and carries the action that fixes it.
   ========================================================================= */

.wcs-card--attention {
    border-color: #fecaca;
    border-left: 4px solid #ef4444;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.07);
}
.wcs-card--attention:hover {
    border-color: #fca5a5;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.13);
}
.wcs-card--attention .wcs-card-top { padding-top: 16px; }

.wcs-alert {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 20px 12px 24px;
    background: #fef2f2;
    border-bottom: 1px solid #fee2e2;
    font-size: 13px;
    line-height: 1.5;
    color: #991b1b;
}
.wcs-alert > svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    color: #ef4444;
}
.wcs-alert-text { flex: 1 1 auto; min-width: 0; }
.wcs-alert b { font-weight: 600; }
.wcs-alert .wcs-alert-sub {
    display: block;
    color: #b45309;
    margin-top: 2px;
}
.wcs-alert .wcs-btn { flex-shrink: 0; }

/* Red rather than green: this is the button on a card that is already flagged
   red, and it has to win against the blue View button beside it. */
.wcs-btn-renew {
    background: #dc2626;
    color: #ffffff;
    border: 1px solid #dc2626;
    box-shadow: 0 1px 3px rgba(220, 38, 38, 0.22);
}
.wcs-btn-renew:hover {
    background: #b91c1c;
    border-color: #b91c1c;
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(220, 38, 38, 0.3);
}

/* The same action on the subscription detail page. */
.wvs-renew-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    background: #ffffff;
    border: 1px solid #fecaca;
    border-left: 4px solid #ef4444;
    border-radius: 12px;
    padding: 18px 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.07);
}
.wvs-renew-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fef2f2;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.wvs-renew-icon svg { width: 20px; height: 20px; color: #ef4444; }
.wvs-renew-text { flex: 1 1 300px; min-width: 0; }
.wvs-renew-text h4 {
    margin: 0 0 3px;
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
}
.wvs-renew-text p { margin: 0; font-size: 13.5px; color: #64748b; }
.wvs-btn-renew {
    background: #dc2626 !important;
    color: #ffffff !important;
    border: 1px solid #dc2626 !important;
    box-shadow: 0 1px 3px rgba(220, 38, 38, 0.22);
}
.wvs-btn-renew:hover {
    background: #b91c1c !important;
    color: #ffffff !important;
    border-color: #b91c1c !important;
    box-shadow: 0 2px 10px rgba(220, 38, 38, 0.3);
}
.wvs-renew-banner .wvs-btn { padding: 10px 22px; font-size: 14px; }

/* =========================================================================
   3. DASHBOARD SUBSCRIPTIONS
   ========================================================================= */

.fcx-dash-subs { margin: 0 0 36px; }
.fcx-dash-subs-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e2e8f0;
}
.fcx-dash-subs-head h2 {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}
.fcx-dash-counts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fcx-dash-count {
    font-size: 13px;
    color: #64748b;
    background: #e2e8f0;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 500;
}
.fcx-dash-count--alert { background: #fee2e2; color: #991b1b; }
.fcx-dash-more { margin: 4px 0 0; font-size: 14px; }
.fcx-dash-more a { color: #0b6fde; font-weight: 600; text-decoration: none; }
.fcx-dash-more a:hover { text-decoration: underline; }

/* =========================================================================
   4. ADDRESSES / ACCOUNT DETAILS
   Field styling mirrors assets/css/checkout.css (1.5px border, 9px radius) so
   account forms and checkout forms read as one system.
   ========================================================================= */

/*
 * box-sizing is scoped, not global, everywhere else in this theme
 * (.wvs-wrapper *, .wcs-subscriptions-wrapper *). Without the same reset here
 * every input was its column width PLUS 28px of padding and 3px of border, so
 * the two-up name fields overlapped by 10px and full-width fields overflowed
 * the card by 6px. Not visible at a glance; obvious when measured.
 */
.fly-acc,
.fly-acc *,
.fly-acc *::before,
.fly-acc *::after { box-sizing: border-box; }

.fly-acc { max-width: 760px; }
.fly-acc-head { margin-bottom: 22px; }
.fly-acc-head h2 {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 4px;
}
.fly-acc-head p { font-size: 14px; color: #64748b; margin: 0; }

.wvs-card-header--split {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.fly-card-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid #f1f5f9;
    background: #fafbfc;
}
.fly-card-footer .note {
    margin-right: auto;
    font-size: 12.5px;
    color: #64748b;
}

/*
 * Two columns, not auto-fit. auto-fit produced three at this width, so a
 * First/Last name pair sat in two of three columns with a dead third — the
 * fields ended up two thirds the width of the full-width ones below them.
 * WooCommerce's own form-row-first/last pairing is two-up, so match it.
 */
.fly-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 20px;
}
.fly-field,
.fly-form-grid .form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    margin: 0;
    padding: 0;
    float: none;
    width: auto;
}
.fly-field.is-full,
.fly-form-grid .form-row-wide { grid-column: 1 / -1; }
.fly-field label,
.fly-form-grid .form-row label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    display: block;
}
.fly-field label .required,
.fly-form-grid .form-row label .required {
    color: #dc2626;
    text-decoration: none;
    border: 0;
}
.fly-field input[type="text"],
.fly-field input[type="email"],
.fly-field input[type="tel"],
.fly-field input[type="password"],
.fly-field select,
.fly-form-grid .form-row input.input-text,
.fly-form-grid .form-row select {
    appearance: none;
    -webkit-appearance: none;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 9px;
    box-shadow: none;
    color: #0f172a;
    font-family: inherit;
    font-size: 15px;
    padding: 11px 14px;
    width: 100%;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.fly-field select,
.fly-form-grid .form-row select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m19.5 8.25-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 38px;
}
.fly-field input:focus,
.fly-field select:focus,
.fly-form-grid .form-row input.input-text:focus,
.fly-form-grid .form-row select:focus {
    outline: none;
    border-color: #1f87ff;
    box-shadow: 0 0 0 3px rgba(31, 135, 255, 0.15);
}
.fly-field .hint,
.fly-form-grid .form-row .description,
.fly-form-grid .form-row span em {
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
    font-style: normal;
}
.fly-form-grid .form-row.woocommerce-invalid input.input-text,
.fly-form-grid .form-row.woocommerce-invalid select { border-color: #dc2626; }

/*
 * Password fields.
 *
 * WooCommerce's JS wraps every password input in <span class="password-input">
 * and appends <span class="show-password-input"> as the eye toggle. Left alone,
 * that span is inline and un-positioned, so the toggle lands outside the field
 * instead of inside it — a grey box hanging off the right edge, sitting on top
 * of whatever a password manager adds there too.
 *
 * Make the wrapper a full-width positioning context, reserve room inside the
 * input for the toggle, and pin the toggle in that space.
 */
.fly-form-grid .form-row .password-input {
    display: block;
    position: relative;
    width: 100%;
}
.fly-form-grid .form-row .password-input input.input-text {
    /* Room for the eye, plus a password manager's own badge beside it. */
    padding-right: 76px;
}
.fly-form-grid .form-row .show-password-input {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
    cursor: pointer;
    opacity: 0.55;
    transition: opacity 0.15s ease;
}
.fly-form-grid .form-row .show-password-input:hover,
.fly-form-grid .form-row .show-password-input.display-password { opacity: 1; }
.fly-form-grid .form-row .show-password-input::after {
    /* Own icon rather than the theme font, so it cannot arrive as a glyph box. */
    content: "";
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.8' stroke='%23475569'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.64 0 8.577 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.64 0-8.577-3.007-9.963-7.178Z'/%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z'/%3E%3C/svg%3E") no-repeat center / 20px 20px;
    font-family: inherit;
    color: transparent;
}
.fly-form-grid .form-row .show-password-input.display-password::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.8' stroke='%231f87ff'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M3.98 8.223A10.477 10.477 0 0 0 1.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.451 10.451 0 0 1 12 4.5c4.756 0 8.773 3.162 10.065 7.498a10.522 10.522 0 0 1-4.293 5.774M6.228 6.228 3 3m3.228 3.228 3.65 3.65m7.894 7.894L21 21m-3.228-3.228-3.65-3.65m0 0a3 3 0 1 0-4.243-4.243'/%3E%3C/svg%3E");
}
.fly-form-grid .form-row .show-password-input:focus-visible {
    outline: 2px solid #1f87ff;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Select2, which WooCommerce uses for country and state. */
.fly-form-grid .select2-container--default .select2-selection--single {
    border: 1.5px solid #e2e8f0;
    border-radius: 9px;
    height: auto;
    padding: 8px 6px;
}
.fly-form-grid .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 1.5;
    color: #0f172a;
    font-size: 15px;
}
.fly-form-grid .select2-container--default .select2-selection--single .select2-selection__arrow { top: 8px; }

.fly-address { font-size: 14.5px; line-height: 1.75; color: #334155; font-style: normal; }
.fly-address .name { display: block; font-weight: 600; color: #0f172a; }
.fly-address-meta {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}
.fly-address-empty { font-size: 14px; color: #64748b; margin: 0; }

/* =========================================================================
   5. FOCUS STATES
   Keyboard users get a visible ring on everything clickable.
   ========================================================================= */

.wcs-btn:focus-visible,
.wcs-sub-id:focus-visible,
.fly-card-footer a:focus-visible,
.fly-acc a:focus-visible,
.fcx-dash-more a:focus-visible {
    outline: 2px solid #1f87ff;
    outline-offset: 2px;
    border-radius: 8px;
}

@media (max-width: 640px) {
    .wcs-alert { padding: 12px 16px; flex-wrap: wrap; }
    .wcs-alert .wcs-btn { width: 100%; justify-content: center; margin-top: 4px; }
    .wvs-renew-banner .wvs-btn { width: 100%; justify-content: center; }
    .fcx-dash-subs-head { flex-direction: column; align-items: flex-start; gap: 8px; }
    .fly-form-grid { grid-template-columns: 1fr; }
    .fly-card-footer { flex-direction: column-reverse; align-items: stretch; }
    .fly-card-footer .note { margin-right: 0; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
    .wcs-card,
    .wcs-btn,
    .fly-field input,
    .fly-field select { transition: none; }
}
