/**
 * Shipitall Core — shared frontend styles.
 * Storefront pages, star ratings, buyer rating + messaging UI.
 */

/* Stars */
.si-stars { display:inline-flex; gap:1px; line-height:1; }
.si-star { font-size:1rem; }
.si-star--full { color:#f4581c; }
.si-star--half { color:#f4581c; opacity:.55; }
.si-star--empty { color:#c7d0d9; }
.si-stars__count { color:#64748b; font-size:.85em; margin-left:4px; }

/* Storefront */
.si-store { max-width:1200px; margin:0 auto; padding:24px 16px 48px; }
.si-store__header {
	display:flex; flex-wrap:wrap; justify-content:space-between; align-items:flex-end;
	gap:12px; padding-bottom:16px; margin-bottom:24px; border-bottom:2px solid #0c1b2a;
}
.si-store__name { font-size:1.9rem; margin:0 0 6px; color:#0c1b2a; }
.si-store__norating { color:#64748b; font-size:.9rem; }
.si-store__meta { display:flex; flex-wrap:wrap; gap:8px; }
.si-store__metaitem {
	background:#f4f6f8; color:#334155; font-size:.85rem;
	padding:4px 12px; border-radius:16px;
}
.si-store__body { display:grid; grid-template-columns:1fr; gap:32px; }
@media (min-width:900px) { .si-store__body { grid-template-columns:3fr 1fr; } }
.si-store__products h2, .si-store__reviews h2 { font-size:1.15rem; margin:0 0 16px; }
.si-store__pager { display:flex; gap:12px; align-items:center; margin-top:16px; }
.si-store__reviews ul { list-style:none; margin:0; padding:0; }
.si-store__review { border-bottom:1px solid #e2e7ec; padding:10px 0; }
.si-store__review p { margin:4px 0 0; color:#334155; font-size:.92rem; }

/* Buyer rating + message blocks on the WooCommerce order page */
.si-rate-block, .si-messages-block {
	margin-top:28px; padding-top:16px; border-top:1px solid #e2e7ec;
}
.si-rate-form {
	background:#f8fafc; border:1px solid #e2e7ec; border-radius:8px;
	padding:14px 16px; margin-bottom:14px;
}
.si-rate-form__vendor { font-weight:600; margin:0 0 8px; }
.si-rate-form__stars { display:flex; gap:14px; margin:0 0 10px; }
.si-rate-form__stars label { display:inline-flex; align-items:center; gap:4px; cursor:pointer; }
.si-rate-form textarea, .si-thread__reply textarea {
	width:100%; border:1px solid #cbd5e1; border-radius:6px; padding:8px; font:inherit;
}

/* Threads */
.si-thread { display:flex; flex-direction:column; gap:8px; margin-bottom:20px; }
.si-thread__empty { color:#64748b; font-style:italic; }
.si-msg { max-width:80%; padding:8px 12px; border-radius:10px; }
.si-msg--mine { align-self:flex-end; background:#0c1b2a; color:#fff; }
.si-msg--theirs { align-self:flex-start; background:#eef2f6; color:#0c1b2a; }
.si-msg__meta { font-size:.72rem; opacity:.75; margin-bottom:2px; }
.si-msg__body { white-space:pre-wrap; }
.si-thread__reply { display:flex; gap:8px; align-items:flex-start; margin-top:4px; }
.si-thread__reply textarea { flex:1; }

/* Vendor dashboard message list */
.si-thread-list { list-style:none; margin:0; padding:0; }
.si-thread-list__item a {
	display:flex; flex-direction:column; gap:2px; padding:12px 14px;
	border:1px solid #e2e7ec; border-radius:8px; margin-bottom:8px; text-decoration:none;
}
.si-thread-list__preview { color:#64748b; font-size:.9rem; }
.si-dash__badge {
	background:#f4581c; color:#fff; font-size:.7rem; font-weight:700;
	border-radius:10px; padding:1px 7px; margin-left:6px;
}

/* =====================================================================
 * Catalog: child-category sections + enriched product card (0.21.2)
 *
 * Petrol (#0f766e) is the secondary accent. Brand orange is deliberately
 * narrowed to the sale badge only, so a discount is the one warm thing on
 * a card and nothing competes with it.
 *
 * Fallbacks are supplied on every var() because this stylesheet is loaded
 * by the plugin and must survive a theme that has not defined the tokens.
 * ================================================================== */

.si-cat-sections { margin: 0 0 6px; }

.si-cat-section { margin: 0 0 22px; }

.si-cat-section__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin: 0 0 12px;
	padding-bottom: 8px;
	border-bottom: 1px solid var(--line, #e2e7ec);
	position: relative;
}

/* Short petrol rule sitting on the hairline, so each child category reads
   as its own block rather than one continuous wall of cards. */
.si-cat-section__head::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: -1px;
	width: 46px;
	height: 3px;
	border-radius: 2px;
	background: var(--petrol, #0f766e);
}

.si-cat-section__title {
	font-family: var(--font-display, "Space Grotesk", system-ui, sans-serif);
	font-size: 1.05rem;
	font-weight: 700;
	line-height: 1.2;
	color: var(--ink, #0c1b2a);
	margin: 0;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.si-cat-section__more {
	flex: 0 0 auto;
	font-size: .82rem;
	font-weight: 600;
	text-decoration: none;
	color: var(--petrol, #0f766e);
	white-space: nowrap;
}

.si-cat-section__more:hover {
	color: var(--petrol-dark, #115e59);
	text-decoration: underline;
}

/* The section grid is a normal ul.products, so it inherits the theme's
   responsive column counts. Nothing to re-declare here. */

/* --- Card hover ---------------------------------------------------- */

.woocommerce ul.products li.product {
	transition: border-color .15s ease, box-shadow .15s ease;
}

.woocommerce ul.products li.product:hover {
	border-color: var(--petrol, #0f766e);
	box-shadow: 0 2px 10px rgba(15, 118, 110, .10);
}

/* --- Card badges --------------------------------------------------- */

.woocommerce ul.products li.product .si-card-badges {
	position: absolute;
	top: 8px;
	left: 8px;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
	pointer-events: none;
}

.si-badge {
	display: inline-block;
	font-size: .68rem;
	font-weight: 700;
	line-height: 1;
	letter-spacing: .01em;
	padding: 4px 7px;
	border-radius: 999px;
	color: #fff;
}

/* The only orange on the card. */
.si-badge--sale { background: var(--brand, #ef5a12); }
.si-badge--oos  { background: var(--ink-mute, #64748b); }

/* --- Seller chip --------------------------------------------------- */

.woocommerce ul.products li.product .si-card-seller {
	display: inline-flex;
	align-items: baseline;
	gap: 4px;
	max-width: calc(100% - 24px);
	margin: 6px 12px 0;
	padding: 3px 8px;
	border-radius: 999px;
	background: var(--petrol-tint, #ccfbf1);
	font-size: .72rem;
	line-height: 1.3;
	min-width: 0;
	overflow: hidden;
}

.si-card-seller__label {
	flex: 0 0 auto;
	color: var(--petrol-dark, #115e59);
	opacity: .8;
}

.si-card-seller__name {
	font-weight: 600;
	color: var(--ink, #0c1b2a);
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* --- Stock line ----------------------------------------------------- */

.woocommerce ul.products li.product .si-card-stock {
	display: block;
	padding: 0 12px 8px;
	font-size: .72rem;
	font-weight: 600;
	line-height: 1.3;
}

.si-card-stock--in  { color: var(--success, #1d7a53); }
.si-card-stock--low { color: var(--warn, #b45309); }
.si-card-stock--out { color: var(--ink-mute, #64748b); }

/* --- Sale price ----------------------------------------------------- */

.woocommerce ul.products li.product .price del {
	color: var(--ink-mute, #64748b);
	font-weight: 500;
	font-size: .85em;
	opacity: .9;
}

.woocommerce ul.products li.product .price ins {
	background: transparent;
	text-decoration: none;
	color: var(--brand-dark, #b8410a);
}
