/*
Theme Name:   TS Steel Supply
Theme URI:    https://shop-demo.tahersolutions.com
Description:  Storefront child theme for the TS Steel Supply B2B demo store: brand colours, header top bar, product cards, wholesale badges and a custom homepage. RTL-ready (logical CSS properties).
Author:       Taher Solutions
Author URI:   https://tahersolutions.com
Template:     storefront
Version:      1.0.1
Text Domain:  ts-steel
*/

:root {
	--ts-navy: #0f172a;
	--ts-navy-2: #1e293b;
	--ts-slate: #334155;
	--ts-muted: #64748b;
	--ts-line: #e2e8f0;
	--ts-bg: #f8fafc;
	--ts-emerald: #02a358;
	--ts-emerald-dark: #018a4a;
	--ts-gold: #d69e2e;
	--ts-radius: 10px;
	--ts-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .06);
	--ts-shadow-hover: 0 2px 6px rgba(15, 23, 42, .08), 0 12px 32px rgba(15, 23, 42, .12);
}

/* ---------- typography ---------- */
html[dir="rtl"] body,
html[dir="rtl"] button,
html[dir="rtl"] input,
html[dir="rtl"] select,
html[dir="rtl"] textarea,
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3, html[dir="rtl"] h4 {
	font-family: "Cairo", "Source Sans Pro", sans-serif;
}
h1, h2, h3, .site-title { letter-spacing: -.01em; }
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3, html[dir="rtl"] .site-title { letter-spacing: 0; }

/* ---------- top bar ---------- */
.ts-topbar {
	background: #0b1220;
	color: #cbd5e1;
	font-size: .82rem;
}
.ts-topbar .col-full {
	display: flex;
	flex-wrap: wrap;
	gap: .25rem 1.5rem;
	align-items: center;
	justify-content: space-between;
	padding-block: .45rem;
}
.ts-topbar ul { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; margin: 0; list-style: none; }
.ts-topbar li::before { content: "•"; color: var(--ts-emerald); margin-inline-end: .45rem; }
.ts-topbar a { color: #fff; text-decoration: none; font-weight: 600; }
.ts-topbar a:hover { color: var(--ts-emerald); }
@media (max-width: 600px) { .ts-topbar ul { display: none; } .ts-topbar .col-full { justify-content: center; } }

/* ---------- header ---------- */
.site-header { border-bottom: 4px solid var(--ts-emerald); padding-top: 1.5em; }
.site-header .site-branding { margin-bottom: 1.2em; }
.site-title { font-weight: 800; font-size: 1.75rem !important; }
.site-title a { display: inline-flex; align-items: center; gap: .6rem; }
.site-title a::before {
	content: "";
	flex: none;
	width: 40px;
	height: 40px;
	border-radius: 8px;
	background: var(--ts-emerald) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath fill='%23fff' d='M10 9h20v5h-7.5v12H30v5H10v-5h7.5V14H10z'/%3E%3C/svg%3E") center / 100% no-repeat;
}
.site-description { color: #94a3b8 !important; font-size: .9rem; margin-top: .15em; }
.site-header .widget_product_search input[type="search"] {
	background: rgba(255, 255, 255, .08);
	border: 1px solid rgba(255, 255, 255, .15);
	border-radius: 999px;
	color: #fff;
}
.site-header .widget_product_search input[type="search"]::placeholder { color: #94a3b8; }
.site-header .widget_product_search form::before { color: #94a3b8; }
.main-navigation ul.menu > li > a,
.main-navigation ul.nav-menu > li > a { font-weight: 600; }
@media (min-width: 768px) {
	/* Arabic labels are longer: keep the menu (incl. language switcher) on one line. */
	.main-navigation ul.menu > li > a, .main-navigation ul.nav-menu > li > a { padding-inline: .75em; }
	html[dir="rtl"] .main-navigation ul.menu > li > a { padding-inline: .6em; font-size: .95em; }
}
.main-navigation ul.menu > li.current-menu-item > a,
.main-navigation ul.menu > li > a:hover { color: var(--ts-emerald) !important; }
.site-header-cart .cart-contents .amount { font-weight: 700; color: #fff; }

/* ---------- buttons ---------- */
.button, button, input[type="submit"], .added_to_cart, .wc-block-components-button {
	border-radius: 8px !important;
	font-weight: 600;
	transition: background-color .15s, transform .15s, box-shadow .15s;
}
.button:hover, button:hover, input[type="submit"]:hover { transform: translateY(-1px); }

/* ---------- product cards ---------- */
ul.products li.product {
	position: relative;
	background: #fff;
	border: 1px solid var(--ts-line);
	border-radius: var(--ts-radius);
	padding: 0 0 1.1em;
	box-shadow: var(--ts-shadow);
	transition: box-shadow .2s, transform .2s;
	overflow: hidden;
}
ul.products li.product:hover { box-shadow: var(--ts-shadow-hover); transform: translateY(-3px); }
ul.products li.product img { margin-bottom: .9em !important; border-radius: 0; }
ul.products li.product .woocommerce-loop-product__title {
	font-size: 1rem !important;
	font-weight: 600;
	color: var(--ts-navy);
	padding-inline: .9em;
	min-height: 2.6em;
}
ul.products li.product .price { color: var(--ts-emerald-dark) !important; font-weight: 700; padding-inline: .9em; }
ul.products li.product .price del { color: var(--ts-muted); font-weight: 400; }
ul.products li.product .button { margin-inline: .9em; }
ul.products li.product .onsale {
	position: absolute;
	top: 12px;
	inset-inline-end: 12px;
	margin: 0;
	border: 0;
	border-radius: 999px;
	background: var(--ts-gold);
	color: #fff;
	font-size: .72rem;
	padding: .2em .7em;
}
.ts-badge {
	position: absolute;
	top: 12px;
	inset-inline-start: 12px;
	z-index: 2;
	background: var(--ts-navy);
	color: #fff;
	font-size: .7rem;
	font-weight: 700;
	letter-spacing: .02em;
	padding: .25em .7em;
	border-radius: 999px;
}
.ts-badge::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ts-emerald); margin-inline-end: .4em; vertical-align: 1px; }

/* ---------- single product ---------- */
.single-product div.product .product_title { font-weight: 700; color: var(--ts-navy); }
.single-product div.product p.price,
.single-product div.product .woocommerce-variation-price .price { color: var(--ts-emerald-dark); font-weight: 700; }
.single-product div.product .woocommerce-product-gallery img { border-radius: var(--ts-radius); }
.ts-b2b-tiers { border-radius: var(--ts-radius) !important; border-inline-start: 4px solid var(--ts-emerald) !important; }
.spec-table th { background: var(--ts-bg); }

/* ---------- store notice ---------- */
.woocommerce-store-notice, p.demo_store {
	background: var(--ts-navy) !important;
	color: #e2e8f0 !important;
	border-top: 3px solid var(--ts-gold);
	font-size: .88rem;
}
.woocommerce-store-notice a { color: var(--ts-gold) !important; }

/* ---------- footer ---------- */
.site-footer { border-top: 4px solid var(--ts-emerald); }
.site-info a { color: #fff !important; }

/* =====================================================================
 * Homepage ([front-page.php])
 * ===================================================================== */
.ts-home .entry-header, .ts-home .site-main > .hentry > .entry-header { display: none; }
.ts-home .site-content { padding-top: 0; }
body.ts-home .site-header { margin-bottom: 0 !important; }
.ts-home #content > .col-full { max-width: none; padding: 0; margin: 0; }
.ts-home .content-area { width: 100%; float: none; margin: 0; }
.ts-home .storefront-breadcrumb { display: none; }

.ts-wrap { max-width: 66.4989378333em; margin-inline: auto; padding-inline: 2.617924em; }
@media (max-width: 767px) { .ts-wrap { padding-inline: 1em; } }

.ts-hero {
	position: relative;
	color: #e2e8f0;
	background: var(--ts-navy);
	padding-block: clamp(3rem, 8vw, 6.5rem);
	overflow: hidden;
	isolation: isolate;
}
.ts-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: url("assets/hero.jpg") center / cover no-repeat;
}
/* Drawings sit on the "end" side: mirror the picture (not the text) in Arabic. */
html[dir="rtl"] .ts-hero::before { transform: scaleX(-1); }
@media (max-width: 767px) { .ts-hero::before { opacity: .35; } }
.ts-hero__inner { max-width: 36rem; }
.ts-eyebrow {
	display: inline-block;
	color: var(--ts-emerald);
	font-weight: 700;
	font-size: .85rem;
	text-transform: uppercase;
	letter-spacing: .08em;
	margin-bottom: .8rem;
}
html[dir="rtl"] .ts-eyebrow { letter-spacing: 0; text-transform: none; }
.ts-hero h1 { color: #fff; font-size: clamp(2rem, 4.6vw, 3.3rem); font-weight: 800; line-height: 1.1; margin-bottom: 1rem; }
.ts-hero p.ts-lead { font-size: 1.12rem; color: #cbd5e1; margin-bottom: 1.8rem; }
.ts-hero__cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 2.2rem; }
.ts-hero__cta .button { padding: .85em 1.6em; font-size: 1rem; }
.ts-btn-primary { background: var(--ts-emerald) !important; border-color: var(--ts-emerald) !important; color: #fff !important; }
.ts-btn-primary:hover { background: var(--ts-emerald-dark) !important; }
.ts-btn-ghost { background: transparent !important; border: 2px solid rgba(255, 255, 255, .35) !important; color: #fff !important; }
.ts-btn-ghost:hover { border-color: #fff !important; }
.ts-facts { display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; margin: 0; list-style: none; }
.ts-facts li { color: #94a3b8; font-size: .9rem; }
.ts-facts strong { display: block; color: #fff; font-size: 1.5rem; line-height: 1.2; }

.ts-section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.ts-section--alt { background: var(--ts-bg); border-block: 1px solid var(--ts-line); }
.ts-section__head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: .5rem 2rem; margin-bottom: 1.8rem; }
.ts-section__head h2 { margin: 0; font-weight: 800; color: var(--ts-navy); font-size: clamp(1.5rem, 2.6vw, 2rem); }
.ts-section__head p { margin: 0; color: var(--ts-muted); }
.ts-section__head a { font-weight: 600; color: var(--ts-emerald-dark); text-decoration: none; }

.ts-cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.1rem; margin: 0; list-style: none; }
@media (max-width: 900px) { .ts-cats { grid-template-columns: repeat(2, 1fr); } }
.ts-cat a {
	display: block;
	background: #fff;
	border: 1px solid var(--ts-line);
	border-radius: var(--ts-radius);
	overflow: hidden;
	text-decoration: none;
	box-shadow: var(--ts-shadow);
	transition: box-shadow .2s, transform .2s;
}
.ts-cat a:hover { box-shadow: var(--ts-shadow-hover); transform: translateY(-3px); }
.ts-cat img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.ts-cat span { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .8rem 1rem; color: var(--ts-navy); font-weight: 700; }
.ts-cat small { color: var(--ts-muted); font-weight: 400; white-space: nowrap; }

.ts-home ul.products { margin-bottom: 0; }

.ts-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; counter-reset: step; margin: 0; list-style: none; }
@media (max-width: 767px) { .ts-steps { grid-template-columns: 1fr; } }
.ts-steps li {
	counter-increment: step;
	background: #fff;
	border: 1px solid var(--ts-line);
	border-radius: var(--ts-radius);
	padding: 1.5rem;
	box-shadow: var(--ts-shadow);
}
.ts-steps li::before {
	content: counter(step);
	display: grid;
	place-items: center;
	width: 2.4rem;
	height: 2.4rem;
	border-radius: 50%;
	background: var(--ts-emerald);
	color: #fff;
	font-weight: 800;
	margin-bottom: .9rem;
}
.ts-steps h3 { font-size: 1.1rem; font-weight: 700; color: var(--ts-navy); margin-bottom: .4rem; }
.ts-steps p { margin: 0; color: var(--ts-slate); font-size: .95rem; }

.ts-import {
	display: grid;
	grid-template-columns: 1.2fr 1fr;
	gap: 2rem;
	align-items: center;
	background: var(--ts-navy);
	color: #cbd5e1;
	border-radius: 14px;
	padding: clamp(1.5rem, 4vw, 2.75rem);
}
@media (max-width: 767px) { .ts-import { grid-template-columns: 1fr; } }
.ts-import h2 { color: #fff; font-weight: 800; margin-bottom: .6rem; }
.ts-import ul { margin: 1rem 0 0; list-style: none; }
.ts-import li { margin-bottom: .45rem; }
.ts-import li::before { content: "✓"; color: var(--ts-emerald); font-weight: 800; margin-inline-end: .5rem; }
.ts-sheet {
	background: #fff;
	border-radius: 10px;
	overflow: hidden;
	font-family: ui-monospace, Consolas, monospace;
	font-size: .8rem;
	direction: ltr;
	box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
.ts-sheet table { margin: 0; width: 100%; border-collapse: collapse; }
.ts-sheet th { background: #e2e8f0; color: var(--ts-navy); text-align: left; }
.ts-sheet th, .ts-sheet td { padding: .45rem .7rem; border-bottom: 1px solid var(--ts-line); color: var(--ts-slate); }
.ts-sheet tr.ts-up td:nth-child(2) { color: var(--ts-emerald-dark); font-weight: 700; }
.ts-sheet tr.ts-out td:nth-child(3) { color: #b91c1c; font-weight: 700; }
