/* ===============================================================
   BABLI FASHION — ORDER DETAILS PAGE (view-order) — FULL REDESIGN v1
   2026-11-22 | Amazon / Flipkart inspired premium order summary.

   Scope: ONLY the customer "View Order" page.
     body.woocommerce-view-order  →  #main-content .woocommerce-MyAccount-content

   Layout (single source of truth, works for 1 or N items):
     ┌ .bfp-ov ───────────────────────────────────────────────┐
     │ .bfp-ov-head      order # · date · status · items count│
     │ .bfp-ov-items     one .bfp-ov-item card per product     │
     │ .bfp-ov-split     summary | delivery info (2 cols)      │
     │ .bfp-ov-actions   invoice download                     │
     │ (existing tracking + cancel/return zones stay as-is)    │
     └────────────────────────────────────────────────────────┘
   =============================================================== */

/* ---------- page shell ---------- */
body.woocommerce-view-order #main-content .woocommerce-MyAccount-content { padding: 0 !important; }
body.woocommerce-view-order .woocommerce-order-details__title,
body.woocommerce-view-order .woocommerce-order-details > table,
body.woocommerce-view-order .woocommerce-order-details > a.woocommerce-button.button,
body.woocommerce-view-order .woocommerce-customer-details { display: none !important; }

/* ---------- shared tokens (scoped) ---------- */
.bfp-ov {
	--ov-line: #f0e9e4;
	--ov-line-soft: #f6f1ed;
	--ov-ink: #17130f;
	--ov-muted: #8a807a;
	--ov-muted-2: #a8a19c;
	--ov-brand: #f0400f;
	--ov-brand-soft: #fff4ef;
	--ov-radius: 16px;
	--ov-radius-sm: 11px;
	font-family: inherit;
	color: var(--ov-ink);
	max-width: 100%;
}
.bfp-ov * { box-sizing: border-box; }

/* ---------- 1. HEADER ---------- */
.bfp-ov-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px 18px;
	padding: 20px 22px;
	background: linear-gradient(135deg, #fff9f6, #fffdfc);
	border: 1px solid var(--ov-line);
	border-radius: var(--ov-radius);
	margin: 0 0 18px;
}
.bfp-ov-head__main { min-width: 0; flex: 1 1 240px; }
.bfp-ov-head__eyebrow {
	display: block;
	font-size: 10.5px; font-weight: 800; letter-spacing: .8px;
	text-transform: uppercase; color: var(--ov-brand); margin-bottom: 4px;
}
.bfp-ov-head__title {
	margin: 0; font-size: 21px; font-weight: 800; line-height: 1.25;
	color: var(--ov-ink); word-break: break-word;
}
.bfp-ov-head__meta {
	margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 6px 16px;
	font-size: 12.5px; color: var(--ov-muted);
}
.bfp-ov-head__meta strong { color: #4a423d; font-weight: 700; }
.bfp-ov-head__side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.bfp-ov-badge {
	display: inline-block; padding: 5px 14px; border-radius: 999px;
	font-size: 11.5px; font-weight: 800; letter-spacing: .3px;
	text-transform: capitalize; white-space: nowrap;
	background: #e7f1fd; color: #1565c0;
}
.bfp-ov-badge.is-completed { background: #e8f7ee; color: #176b3a; }
.bfp-ov-badge.is-cancelled { background: #fdeaea; color: #c0392b; }
.bfp-ov-badge.is-on-hold   { background: #fff4dd; color: #a06a00; }
.bfp-ov-badge.is-refunded  { background: #f3e8fd; color: #7b2d9e; }
.bfp-ov-badge.is-shipped   { background: #eaf3ff; color: #0b5aa5; }
.bfp-ov-badge.is-pending,
.bfp-ov-badge.is-failed    { background: #f1ece8; color: #8a807a; }
.bfp-ov-head__count {
	font-size: 11.5px; font-weight: 700; color: var(--ov-muted);
	background: #fff; border: 1px solid var(--ov-line);
	border-radius: 999px; padding: 4px 12px; white-space: nowrap;
}

/* ---------- 2. ITEMS ---------- */
.bfp-ov-items { display: block; margin: 0 0 18px; }
.bfp-ov-items__title {
	display: flex; align-items: center; gap: 9px;
	margin: 0 0 10px; font-size: 12px; font-weight: 800;
	letter-spacing: .7px; text-transform: uppercase; color: #6f6660;
}
.bfp-ov-items__title::after {
	content: ""; flex: 1; height: 1px; background: var(--ov-line-soft);
}
.bfp-ov-item {
	display: grid;
	grid-template-columns: 92px minmax(0, 1fr) auto;
	column-gap: 16px;
	align-items: start;
	padding: 16px;
	background: #fff;
	border: 1px solid var(--ov-line);
	border-radius: var(--ov-radius);
	margin: 0 0 12px;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.bfp-ov-item:hover {
	border-color: #e2d5cc;
	box-shadow: 0 10px 26px -20px rgba(28, 22, 18, .45);
}
.bfp-ov-item:last-child { margin-bottom: 0; }

.bfp-ov-thumb {
	width: 92px; height: 92px; border-radius: 13px; overflow: hidden;
	background: #faf8f7; border: 1px solid var(--ov-line-soft);
	display: flex; align-items: center; justify-content: center;
}
.bfp-ov-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bfp-ov-thumb--none::after {
	content: ""; width: 30px; height: 30px; border-radius: 8px; background: #ece6e2;
}

.bfp-ov-item__body { min-width: 0; }
.bfp-ov-item__name {
	margin: 0; font-size: 15px; font-weight: 700; line-height: 1.4;
}
.bfp-ov-item__name a { color: var(--ov-ink) !important; text-decoration: none !important; }
.bfp-ov-item__name a:hover { color: var(--ov-brand) !important; }
.bfp-ov-item__desc {
	margin: 5px 0 0; font-size: 12.5px; line-height: 1.55; color: var(--ov-muted);
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.bfp-ov-item__tags { margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.bfp-ov-tag {
	display: inline-flex; align-items: center; gap: 5px;
	font-size: 11.5px; font-weight: 600; color: #6f6660;
	background: #f8f4f2; border: 1px solid var(--ov-line-soft);
	border-radius: 999px; padding: 3px 10px;
}
.bfp-ov-tag b { color: #4a423d; font-weight: 800; }
.bfp-ov-item__qty {
	margin: 9px 0 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.bfp-ov-item__qty .lbl {
	font-size: 10.5px; font-weight: 800; letter-spacing: .6px;
	text-transform: uppercase; color: var(--ov-muted-2);
}
.bfp-ov-item__qty .val { font-size: 13.5px; font-weight: 800; color: var(--ov-ink); }
.bfp-ov-item__qty .unit { font-size: 11.5px; color: var(--ov-muted); }

.bfp-ov-item__amt { text-align: right; white-space: nowrap; padding-left: 6px; }
.bfp-ov-item__amt .now {
	font-size: 16.5px; font-weight: 800; color: var(--ov-ink);
	font-variant-numeric: tabular-nums;
}
.bfp-ov-item__amt .was {
	display: block; font-size: 12px; color: var(--ov-muted-2);
	text-decoration: line-through; margin-top: 2px;
}
.bfp-ov-item__amt .each {
	display: block; font-size: 11.5px; color: var(--ov-muted); margin-top: 3px;
}

/* ---------- 3. TWO-COLUMN BLOCK: summary + delivery ---------- */
.bfp-ov-split {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 16px;
	margin: 0 0 18px;
	align-items: start;
}
.bfp-ov-card {
	background: #fff; border: 1px solid var(--ov-line);
	border-radius: var(--ov-radius); padding: 18px;
}
.bfp-ov-card__title {
	margin: 0 0 14px; font-size: 12px; font-weight: 800;
	letter-spacing: .7px; text-transform: uppercase; color: #6f6660;
}
.bfp-ov-rows { margin: 0; }
.bfp-ov-row {
	display: flex; align-items: baseline; justify-content: space-between;
	gap: 14px; padding: 9px 0; font-size: 13.5px;
	border-bottom: 1px dashed var(--ov-line-soft);
}
.bfp-ov-row:last-child { border-bottom: 0; }
.bfp-ov-row dt, .bfp-ov-row .k { color: var(--ov-muted); min-width: 0; }
.bfp-ov-row dd, .bfp-ov-row .v {
	margin: 0; font-weight: 700; color: var(--ov-ink);
	text-align: right; font-variant-numeric: tabular-nums; word-break: break-word;
}
.bfp-ov-row--total {
	border-top: 1px solid var(--ov-line) !important;
	margin-top: 6px; padding-top: 13px;
}
.bfp-ov-row--total .k { font-size: 14px; font-weight: 800; color: var(--ov-ink); }
.bfp-ov-row--total .v { font-size: 18px; font-weight: 800; }
.bfp-ov-row--save .v { color: #176b3a; }
.bfp-ov-addr { font-size: 13.5px; line-height: 1.6; }
.bfp-ov-addr strong { display: block; margin-bottom: 3px; font-size: 14px; }
.bfp-ov-addr span { display: block; color: var(--ov-muted); }
.bfp-ov-addr .ic {
	display: inline-flex; align-items: flex-start; gap: 8px;
	margin-top: 7px; color: #4a423d;
}
.bfp-ov-addr .ic svg { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 2px; color: var(--ov-brand); }
.bfp-ov-note {
	margin: 12px 0 0; padding: 11px 13px; border-radius: var(--ov-radius-sm);
	background: #fffaf6; border: 1px solid #f7e6dc;
	font-size: 12.5px; line-height: 1.55; color: #6f6660;
}
.bfp-ov-note b { color: #4a423d; }

/* ---------- 4. ACTION BAR ---------- */
.bfp-ov-actions {
	display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
	padding: 16px 18px; margin: 0 0 18px;
	background: #fff; border: 1px solid var(--ov-line);
	border-radius: var(--ov-radius);
}
.bfp-ov-actions__label {
	font-size: 12px; font-weight: 800; letter-spacing: .7px;
	text-transform: uppercase; color: #6f6660;
}
.bfp-ov-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 42px; padding: 0 20px; border-radius: var(--ov-radius-sm);
	font-size: 13.5px; font-weight: 700; text-decoration: none !important;
	cursor: pointer; border: 1.5px solid transparent; transition: background .16s ease, border-color .16s ease;
}
.bfp-ov-btn svg { width: 17px; height: 17px; flex: 0 0 auto; }
.bfp-ov-btn--primary {
	background: linear-gradient(135deg, #ff4b1f, #ff6a35); color: #fff !important;
	box-shadow: 0 8px 18px -10px rgba(255, 75, 31, .65);
}
.bfp-ov-btn--primary:hover { background: #f0400f; }
.bfp-ov-actions .bfp-ov-btn { margin-left: auto; }

/* ---------- 5. RESPONSIVE ---------- */
@media (max-width: 900px) {
	.bfp-ov-split { grid-template-columns: minmax(0, 1fr); }
	.bfp-ov-head { padding: 17px 16px; }
	.bfp-ov-head__title { font-size: 19px; }
	.bfp-ov-head__side { flex-direction: row; align-items: center; flex-wrap: wrap; width: 100%; }
}
@media (max-width: 640px) {
	.bfp-ov-item {
		grid-template-columns: 74px minmax(0, 1fr);
		row-gap: 10px; padding: 14px;
	}
	.bfp-ov-thumb { width: 74px; height: 74px; border-radius: 11px; }
	.bfp-ov-item__name { font-size: 14px; }
	.bfp-ov-item__desc { -webkit-line-clamp: 3; font-size: 12px; }
	.bfp-ov-item__amt {
		grid-column: 1 / -1;
		text-align: right; padding: 10px 0 0;
		border-top: 1px dashed var(--ov-line-soft); margin-top: 2px;
		display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
	}
	.bfp-ov-item__amt:empty { display: none; }
	.bfp-ov-item__amt .each { margin-top: 0; }
	.bfp-ov-card { padding: 15px; }
	.bfp-ov-row { font-size: 13px; }
	.bfp-ov-row--total .v { font-size: 17px; }
	.bfp-ov-actions { padding: 14px; }
	.bfp-ov-actions .bfp-ov-btn { margin-left: 0; width: 100%; }
	.bfp-ov-head__meta { font-size: 12px; gap: 4px 12px; }
}
@media (max-width: 360px) {
	.bfp-ov-item { grid-template-columns: 64px minmax(0, 1fr); }
	.bfp-ov-thumb { width: 64px; height: 64px; }
	.bfp-ov-head__title { font-size: 17px; }
}
/* ---- ICON SIZE FIX (2026-11-22): theme/global SVG rules were stretching the
   inline contact icons to full column width. Pin them. ---- */
.bfp-ov .bfp-ov-addr .ic svg,
.bfp-ov svg {
	width: 15px !important;
	height: 15px !important;
	min-width: 15px !important;
	max-width: 15px !important;
	min-height: 15px !important;
	max-height: 15px !important;
	flex: 0 0 auto !important;
	display: inline-block !important;
}
.bfp-ov .bfp-ov-btn svg {
	width: 17px !important;
	height: 17px !important;
	min-width: 17px !important;
	max-width: 17px !important;
	min-height: 17px !important;
	max-height: 17px !important;
}
.bfp-ov .bfp-ov-addr .ic {
	display: flex !important;
	align-items: center !important;
	gap: 8px !important;
	margin-top: 8px !important;
}
.bfp-ov .bfp-ov-addr .ic svg { margin-top: 0 !important; }

/* Delivery card must keep icons inline with their text, never full-width. */
.bfp-ov .bfp-ov-card .bfp-ov-addr { display: block; }
.bfp-ov .bfp-ov-addr span { display: block; }
.bfp-ov .bfp-ov-addr .ic > span { display: inline !important; }

/* ---- The other module's "Shipping and returns" block duplicates our
   cancel/return zones — hide it on the premium layout. ---- */
body.woocommerce-view-order #opp-order-options { display: none !important; }

/* ===============================================================
   HARD OVERRIDES (2026-11-22)
   bfp-myaccount.css sets `display:block !important` on the old order
   table for mobile — these win by selector weight + !important, and are
   declared last so they always land.
   =============================================================== */
body.woocommerce-view-order #main-content .woocommerce-MyAccount-content .woocommerce-order-details > table,
body.woocommerce-view-order #main-content .woocommerce-MyAccount-content .woocommerce-order-details table.shop_table,
body.woocommerce-view-order #main-content .woocommerce-MyAccount-content .woocommerce-order-details > .woocommerce-order-details__title,
body.woocommerce-view-order #main-content .woocommerce-MyAccount-content .woocommerce-customer-details,
body.woocommerce-view-order #main-content .woocommerce-MyAccount-content .woocommerce-order-details > a.woocommerce-button.button {
	display: none !important;
	visibility: hidden !important;
	height: 0 !important;
	overflow: hidden !important;
}

/* Address lines: the newlines we converted to <span></span> must not render. */
.bfp-ov .bfp-ov-addr > span:empty { display: none !important; }
.bfp-ov .bfp-ov-addr span + span { display: block !important; }

/* Contact rows: phone + email side by side when they fit. */
.bfp-ov .bfp-ov-addr .ic svg { flex: 0 0 15px !important; }
.bfp-ov .bfp-ov-addr { word-break: break-word; }

/* Contact rows: each on its own line, icon + text properly aligned. */
.bfp-ov .bfp-ov-addr .ic {
	display: flex !important;
	align-items: center !important;
	gap: 9px !important;
	margin: 9px 0 0 !important;
	line-height: 1.45 !important;
}
.bfp-ov .bfp-ov-addr .ic:first-of-type { margin-top: 12px !important; }
.bfp-ov .bfp-ov-addr .ic > span {
	display: block !important;
	flex: 1 1 auto !important;
	min-width: 0 !important;
	word-break: break-word !important;
	color: #4a423d !important;
	font-size: 13px !important;
}
.bfp-ov .bfp-ov-addr .ic svg {
	width: 15px !important;
	height: 15px !important;
	min-width: 15px !important;
	max-width: 15px !important;
	flex: 0 0 15px !important;
	color: #f0400f !important;
	margin: 0 !important;
}
.bfp-ov .bfp-ov-addr { margin-bottom: 2px; }
.bfp-ov .bfp-ov-addr > span {
	display: block !important;
	color: #8a807a !important;
	font-size: 13px !important;
	line-height: 1.55 !important;
}

/* Contact rows are SIBLINGS of .bfp-ov-addr (not children) — target them on
   the card itself and force one row per contact. */
.bfp-ov-card .bfp-ov-addr + .ic,
.bfp-ov .bfp-ov-addr ~ .ic {
	display: flex !important;
	align-items: center !important;
	gap: 9px !important;
	margin: 9px 0 0 !important;
	line-height: 1.45 !important;
	width: 100% !important;
}
.bfp-ov-card .bfp-ov-addr + .ic:first-of-type { margin-top: 13px !important; }
.bfp-ov-card .ic > span {
	display: block !important;
	flex: 1 1 auto !important;
	min-width: 0 !important;
	word-break: break-word !important;
	color: #4a423d !important;
	font-size: 13px !important;
}
.bfp-ov-card .ic svg {
	width: 15px !important; height: 15px !important;
	min-width: 15px !important; max-width: 15px !important;
	flex: 0 0 15px !important; color: #f0400f !important; margin: 0 !important;
}
/* Fallback for any other stray inline svg inside the card. */
.bfp-ov-card > svg { display: none !important; }
