/*
Theme Name: Ormsy Style
Theme URI: https://ormsy.co.za
Description: Custom WooCommerce block theme by OpenRoad Media. Dark-first design with flexible colour system, built for South African e-commerce stores.
Author: OpenRoad Media
Author URI: https://openroadmedia.co.za
Version: 1.0.0
Requires at least: 6.5
Tested up to: 6.9
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ormsy-style
Tags: full-site-editing, block-patterns, woocommerce, custom-colors, custom-logo, editor-style
*/


/* ========================================
   1. RESET & BASE
   ======================================== */

*,
*::before,
*::after {
	box-sizing: border-box;
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

/* Smooth scrolling */
html {
	scroll-behavior: smooth;
}

/* Focus styles for accessibility */
:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}

/* Text wrapping */
h1, h2, h3, h4, h5, h6 {
	text-wrap: balance;
}

p {
	text-wrap: pretty;
}


/* ========================================
   2. HEADER
   ======================================== */

.ormsy-header {
	border-bottom: 1px solid var(--wp--preset--color--border);
}

/* Logo — size controlled by Customizer "Logo Max Width" setting */
.ormsy-header .custom-logo,
.ormsy-header .wp-block-site-logo img {
	width: auto;
	height: auto;
}

/* Cart icon in header */
.ormsy-header-cart a {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 0.35em;
	text-decoration: none;
	font-weight: 600;
	font-size: var(--wp--preset--font-size--small);
}

/* --- Header Inner (flex row by default) --- */
.ormsy-header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0.5em;
}

/* Left nav hidden by default (shown only in layout-4) */
.ormsy-header .ormsy-header-nav-left {
	display: none !important;
}


/* ----------------------------------------
   LAYOUT 1: Logo Left + Menu Right (default)
   ---------------------------------------- */
.ormsy-header-layout-1 .ormsy-header-logo {
	order: 1;
}
.ormsy-header-layout-1 .ormsy-header-nav-right {
	order: 2;
}


/* ----------------------------------------
   LAYOUT 2: Logo Centre + Menu Below
   ---------------------------------------- */
.ormsy-header-layout-2 .ormsy-header-inner {
	flex-direction: column;
	text-align: center;
}
.ormsy-header-layout-2 .ormsy-header-logo {
	order: 1;
	justify-content: center;
}
.ormsy-header-layout-2 .ormsy-header-nav-right {
	order: 2;
	justify-content: center;
	width: 100%;
}


/* ----------------------------------------
   LAYOUT 3: Logo Right + Menu Left
   ---------------------------------------- */
.ormsy-header-layout-3 .ormsy-header-inner {
	flex-direction: row-reverse;
}
.ormsy-header-layout-3 .ormsy-header-logo {
	order: 1;
}
.ormsy-header-layout-3 .ormsy-header-nav-right {
	order: 2;
	justify-content: left;
}


/* ----------------------------------------
   LAYOUT 4: Logo Centre + Menu Split
   ---------------------------------------- */
.ormsy-header-layout-4 .ormsy-header .ormsy-header-nav-left {
	display: flex !important;
	flex: 1;
	justify-content: flex-end;
	order: 1;
}
.ormsy-header-layout-4 .ormsy-header-logo {
	order: 2;
	flex: 0 0 auto;
}
.ormsy-header-layout-4 .ormsy-header-nav-right {
	flex: 1;
	justify-content: flex-start;
	order: 3;
}


/* ----------------------------------------
   DARK HEADER TOGGLE
   ---------------------------------------- */
.ormsy-header-is-dark .ormsy-header {
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
	border-bottom-color: rgba(255, 255, 255, 0.1);
}

.ormsy-header-is-dark .ormsy-header a,
.ormsy-header-is-dark .ormsy-header .wp-block-site-title a,
.ormsy-header-is-dark .ormsy-header .wp-block-navigation a {
	color: var(--wp--preset--color--base);
}

.ormsy-header-is-dark .ormsy-header a:hover,
.ormsy-header-is-dark .ormsy-header .wp-block-navigation a:hover {
	color: var(--wp--preset--color--accent);
}


/* ========================================
   3. HERO SECTIONS
   ======================================== */

.ormsy-hero {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 60vh;
	text-align: center;
	overflow: hidden;
}

.ormsy-hero-full {
	min-height: 80vh;
}

.ormsy-hero-dark {
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}

.ormsy-hero h1 {
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.ormsy-hero p {
	max-width: 640px;
	margin-left: auto;
	margin-right: auto;
	opacity: 0.85;
}


/* ========================================
   4. SECTION UTILITIES
   ======================================== */

.ormsy-section {
	padding-top: var(--wp--preset--spacing--60);
	padding-bottom: var(--wp--preset--spacing--60);
}

.ormsy-section-dark {
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}

.ormsy-section-dark h2,
.ormsy-section-dark h3,
.ormsy-section-dark h4 {
	color: var(--wp--preset--color--base);
}

.ormsy-section-dark a {
	color: var(--wp--preset--color--accent);
}

.ormsy-section-surface {
	background: var(--wp--preset--color--surface);
}

/* Title with accent underline */
.ormsy-title-accent {
	position: relative;
	padding-bottom: 0.6em;
}

.ormsy-title-accent::after {
	content: "";
	position: absolute;
	bottom: 0;
	left: 0;
	width: 50px;
	height: 3px;
	background: var(--wp--preset--color--accent);
}

.has-text-align-center .ormsy-title-accent::after,
.ormsy-title-accent.has-text-align-center::after {
	left: 50%;
	transform: translateX(-50%);
}

/* Short separator */
.ormsy-sep {
	width: 50px;
	height: 3px;
	background: var(--wp--preset--color--accent);
	border: none;
	margin: 1em 0;
}


/* ========================================
   5. CARDS
   ======================================== */

.ormsy-card {
	background: var(--wp--preset--color--base);
	border-radius: var(--wp--custom--border-radius);
	box-shadow: var(--wp--custom--box-shadow);
	overflow: hidden;
	transition: var(--wp--custom--transition);
}

.ormsy-card:hover {
	box-shadow: var(--wp--custom--box-shadow-lg);
	transform: translateY(-2px);
}

.ormsy-card-dark {
	background: var(--wp--preset--color--surface-dark);
	color: var(--wp--preset--color--base);
}

.ormsy-card-dark h3,
.ormsy-card-dark h4 {
	color: var(--wp--preset--color--base);
}

.ormsy-card img {
	width: 100%;
	aspect-ratio: 4/3;
	object-fit: cover;
}

.ormsy-card-body {
	padding: var(--wp--preset--spacing--30);
}


/* ========================================
   6. STATS BAR
   ======================================== */

.ormsy-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: var(--wp--preset--spacing--30);
	text-align: center;
}

.ormsy-stat-number {
	font-size: var(--wp--preset--font-size--xx-large);
	font-weight: 800;
	color: var(--wp--preset--color--accent);
	line-height: 1;
}

.ormsy-stat-label {
	font-size: var(--wp--preset--font-size--small);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	opacity: 0.7;
	margin-top: 0.3em;
}


/* ========================================
   7. FOOTER
   ======================================== */

.ormsy-footer {
	background: var(--wp--preset--color--contrast);
	color: rgba(255, 255, 255, 0.7);
}

.ormsy-footer h3,
.ormsy-footer h4 {
	color: var(--wp--preset--color--base);
	font-size: var(--wp--preset--font-size--medium);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin-bottom: 1em;
}

.ormsy-footer a {
	color: rgba(255, 255, 255, 0.7);
	text-decoration: none;
	transition: var(--wp--custom--transition);
}

.ormsy-footer a:hover {
	color: var(--wp--preset--color--accent);
}

.ormsy-footer-main {
	display: grid;
	grid-template-columns: 1.2fr 1fr 0.8fr;
	gap: var(--wp--preset--spacing--40);
	padding: var(--wp--preset--spacing--60) 0;
}

.ormsy-footer-logo {
	max-height: 60px;
	width: auto;
	margin-bottom: 1.2em;
}

.ormsy-footer-about p {
	line-height: 1.7;
	margin-bottom: 1.2em;
}

/* Social icons */
.ormsy-social {
	display: flex;
	gap: 0.6em;
	list-style: none;
	padding: 0;
	margin: 0;
}

.ormsy-social a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--base);
	font-size: 0.9em;
	transition: var(--wp--custom--transition);
}

.ormsy-social a:hover {
	background: var(--wp--preset--color--accent-hover);
	color: var(--wp--preset--color--base);
	transform: translateY(-2px);
}

/* Footer nav list */
.ormsy-footer-nav ul {
	list-style: none;
	padding: 0;
	margin: 0;
}

.ormsy-footer-nav li {
	padding: 0.5em 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Footer bottom bar */
.ormsy-footer-bottom {
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	padding: var(--wp--preset--spacing--20) 0;
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 1em;
	font-size: var(--wp--preset--font-size--small);
}

.ormsy-footer-payments {
	display: flex;
	align-items: center;
	gap: 1em;
}

.ormsy-footer-payments img {
	height: 28px;
	width: auto;
	opacity: 0.7;
	transition: var(--wp--custom--transition);
}

.ormsy-footer-payments img:hover {
	opacity: 1;
}


/* ========================================
   8. WOOCOMMERCE OVERRIDES
   ======================================== */

/* Product grid */
.wc-block-grid__products,
.products {
	display: grid !important;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: var(--wp--preset--spacing--30);
}

.wc-block-grid__product,
.products .product {
	background: var(--wp--preset--color--base);
	border-radius: var(--wp--custom--border-radius);
	overflow: hidden;
	box-shadow: var(--wp--custom--box-shadow);
	transition: var(--wp--custom--transition);
}

.wc-block-grid__product:hover,
.products .product:hover {
	box-shadow: var(--wp--custom--box-shadow-lg);
	transform: translateY(-2px);
}

/* Product images */
.woocommerce-LoopProduct-link img,
.wc-block-grid__product-image img {
	width: 100%;
	aspect-ratio: 1/1;
	object-fit: cover;
	border-radius: 0;
}

/* Product title */
.woocommerce-loop-product__title,
.wc-block-grid__product-title {
	font-size: var(--wp--preset--font-size--small) !important;
	font-weight: 600;
	padding: 0.8em 1em 0 !important;
	margin: 0;
}

/* Product price */
.woocommerce-Price-amount,
.wc-block-grid__product-price {
	font-weight: 700;
	color: var(--wp--preset--color--accent);
}

.products .product .price {
	padding: 0.4em 1em;
	font-size: var(--wp--preset--font-size--small);
}

.products .product .price del {
	opacity: 0.5;
	font-size: 0.85em;
}

.products .product .price ins {
	text-decoration: none;
	font-weight: 700;
}

/* Sale badge */
.woocommerce span.onsale,
.onsale {
	background: var(--wp--preset--color--accent) !important;
	color: var(--wp--preset--color--base);
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	border-radius: var(--wp--custom--border-radius-small);
	padding: 0.3em 0.8em;
	min-height: auto;
	min-width: auto;
	line-height: 1.4;
}

/* Add to cart button */
.products .product .button,
.wc-block-grid__product .wp-block-button__link {
	display: block;
	width: calc(100% - 2em);
	margin: 0.6em 1em 1em;
	padding: 0.6em 1em;
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
	text-align: center;
	border-radius: var(--wp--custom--border-radius-small);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	text-decoration: none;
	border: none;
	cursor: pointer;
	transition: var(--wp--custom--transition);
}

.products .product .button:hover,
.wc-block-grid__product .wp-block-button__link:hover {
	background: var(--wp--preset--color--accent);
}

/* Single product */
.single-product .product .summary {
	padding: var(--wp--preset--spacing--30) 0;
}

.single-product .product .woocommerce-product-gallery {
	border-radius: var(--wp--custom--border-radius);
	overflow: hidden;
}

.single-product .price {
	font-size: var(--wp--preset--font-size--x-large) !important;
	color: var(--wp--preset--color--accent);
}

/* Quantity input */
.woocommerce .quantity .qty {
	width: 60px;
	padding: 0.5em;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--border-radius-small);
	text-align: center;
}

/* WooCommerce buttons */
.woocommerce .button,
.woocommerce .checkout-button,
.woocommerce #place_order {
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--base);
	border: none;
	border-radius: var(--wp--custom--border-radius);
	padding: 0.75em 1.5em;
	font-weight: 600;
	font-size: var(--wp--preset--font-size--small);
	cursor: pointer;
	transition: var(--wp--custom--transition);
}

.woocommerce .button:hover,
.woocommerce .checkout-button:hover,
.woocommerce #place_order:hover {
	background: var(--wp--preset--color--accent-hover);
}

/* WooCommerce notices */
.woocommerce-message,
.woocommerce-info {
	border-top-color: var(--wp--preset--color--accent) !important;
}

.woocommerce-message::before,
.woocommerce-info::before {
	color: var(--wp--preset--color--accent) !important;
}

/* Product tabs */
.woocommerce-tabs .tabs {
	list-style: none;
	padding: 0;
	margin: 0 0 var(--wp--preset--spacing--20) 0;
	display: flex;
	gap: 0;
	border-bottom: 2px solid var(--wp--preset--color--border);
}

.woocommerce-tabs .tabs li a {
	display: block;
	padding: 0.75em 1.25em;
	text-decoration: none;
	font-weight: 600;
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--muted);
	border-bottom: 2px solid transparent;
	margin-bottom: -2px;
	transition: var(--wp--custom--transition);
}

.woocommerce-tabs .tabs li.active a {
	color: var(--wp--preset--color--accent);
	border-bottom-color: var(--wp--preset--color--accent);
}

/* Product attributes table */
.woocommerce-product-attributes {
	width: 100%;
	border-collapse: collapse;
}

.woocommerce-product-attributes th {
	text-align: left;
	font-weight: 600;
	padding: 0.6em 1em;
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	font-size: var(--wp--preset--font-size--small);
}

.woocommerce-product-attributes td {
	padding: 0.6em 1em;
	border: 1px solid var(--wp--preset--color--border);
	font-size: var(--wp--preset--font-size--small);
}

/* Cart table */
.woocommerce-cart-form table {
	width: 100%;
	border-collapse: collapse;
}

.woocommerce-cart-form th,
.woocommerce-cart-form td {
	padding: 1em;
	border-bottom: 1px solid var(--wp--preset--color--border);
}

/* Breadcrumbs */
.woocommerce-breadcrumb {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--muted);
	margin-bottom: var(--wp--preset--spacing--20);
}

.woocommerce-breadcrumb a {
	color: var(--wp--preset--color--muted);
	text-decoration: none;
}

.woocommerce-breadcrumb a:hover {
	color: var(--wp--preset--color--accent);
}

/* Star ratings */
.star-rating {
	color: #fbbf24;
}

/* Dark section WooCommerce products */
.ormsy-section-dark .products .product {
	background: var(--wp--preset--color--surface-dark);
}

.ormsy-section-dark .woocommerce-loop-product__title {
	color: var(--wp--preset--color--base);
}

.ormsy-section-dark .products .product .button {
	background: var(--wp--preset--color--accent);
}


/* ========================================
   9. WHATSAPP BUTTON
   ======================================== */

.ormsy-whatsapp {
	position: fixed;
	bottom: 25px;
	right: 25px;
	z-index: 9999;
	width: 56px;
	height: 56px;
	background: #25d366;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
	transition: var(--wp--custom--transition);
	text-decoration: none;
}

.ormsy-whatsapp:hover {
	transform: scale(1.08);
	box-shadow: 0 6px 16px rgba(37, 211, 102, 0.5);
}

.ormsy-whatsapp svg {
	width: 28px;
	height: 28px;
	fill: #fff;
}


/* ========================================
   10. FAQ / DETAILS ACCORDION
   ======================================== */

.wp-block-details {
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--border-radius);
	padding: 0;
	margin-bottom: 0.5em;
}

.wp-block-details summary {
	padding: 1em 1.25em;
	font-weight: 600;
	cursor: pointer;
	list-style: none;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.wp-block-details summary::after {
	content: "+";
	font-size: 1.3em;
	font-weight: 300;
	color: var(--wp--preset--color--muted);
	transition: var(--wp--custom--transition);
}

.wp-block-details[open] summary::after {
	content: "−";
	color: var(--wp--preset--color--accent);
}

.wp-block-details summary::-webkit-details-marker {
	display: none;
}

.wp-block-details > *:not(summary) {
	padding: 0 1.25em 1em;
}


/* ========================================
   11. CONTACT & HOURS TABLE
   ======================================== */

.ormsy-hours-table {
	width: 100%;
	border-collapse: collapse;
}

.ormsy-hours-table th,
.ormsy-hours-table td {
	padding: 0.75em 1em;
	border: 1px solid var(--wp--preset--color--border);
	font-size: var(--wp--preset--font-size--small);
}

.ormsy-hours-table th {
	text-align: left;
	font-weight: 600;
	background: var(--wp--preset--color--surface);
}

.ormsy-hours-closed {
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}

.ormsy-contact-item {
	display: flex;
	align-items: flex-start;
	gap: 0.75em;
	margin-bottom: 1em;
}

.ormsy-contact-icon {
	flex-shrink: 0;
	width: 20px;
	color: var(--wp--preset--color--accent);
}


/* ========================================
   12. RESPONSIVE
   ======================================== */

@media (max-width: 900px) {
	.ormsy-footer-main {
		grid-template-columns: 1fr 1fr;
	}

	.ormsy-hero {
		min-height: 50vh;
	}
}

@media (max-width: 768px) {
	.ormsy-stats {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 600px) {
	.ormsy-footer-main {
		grid-template-columns: 1fr;
		gap: var(--wp--preset--spacing--30);
	}

	.ormsy-footer-bottom {
		flex-direction: column;
		text-align: center;
	}

	.ormsy-hero {
		min-height: 40vh;
	}

	.ormsy-hero h1 {
		font-size: var(--wp--preset--font-size--xx-large);
	}
}


/* ========================================
   13. MOBILE HEADER FIX
   ======================================== */

.wp-block-navigation__responsive-container.is-menu-open {
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}

.wp-block-navigation__responsive-container.is-menu-open a {
	color: var(--wp--preset--color--base);
}

/* Mobile: collapse all header layouts to stacked */
@media (max-width: 768px) {
	.ormsy-header-inner {
		flex-direction: column !important;
		text-align: center;
	}

	/* Hide left nav on mobile (layout-4) — right nav hamburger handles it */
	.ormsy-header-layout-4 .ormsy-header-nav-left {
		display: none !important;
	}

	.ormsy-header-logo {
		order: 1 !important;
		justify-content: center;
	}

	.ormsy-header-nav-right {
		order: 2 !important;
		justify-content: center;
		width: 100%;
	}
}


/* ========================================
   14. EMOJI SVG SAFETY NET
   ======================================== */

img.wp-smiley,
img.emoji {
	display: inline !important;
	border: none !important;
	box-shadow: none !important;
	height: 1em !important;
	width: 1em !important;
	margin: 0 0.07em !important;
	vertical-align: -0.1em !important;
	background: none !important;
	padding: 0 !important;
}


/* ========================================
   15. STICKY HEADER
   ======================================== */

.ormsy-sticky-header .ormsy-header {
	position: sticky;
	top: 0;
	z-index: 1000;
	transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.ormsy-header-stuck {
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}


/* ========================================
   16. SCROLL TO TOP
   ======================================== */

.ormsy-scroll-top {
	position: fixed;
	bottom: 25px;
	z-index: 9998;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
	transition: all 0.3s ease;
	opacity: 0.85;
}

.ormsy-scroll-top:hover {
	opacity: 1;
	transform: translateY(-2px);
}

.ormsy-scroll-top svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
}

.ormsy-scroll-top-right {
	right: 25px;
}

.ormsy-scroll-top-left {
	left: 25px;
}

/* Offset if WhatsApp button is also right */
.ormsy-whatsapp ~ .ormsy-scroll-top-right {
	bottom: 90px;
}


/* ========================================
   17. BOXED LAYOUT
   ======================================== */

.ormsy-layout-boxed .wp-site-blocks {
	box-shadow: 0 0 30px rgba(0, 0, 0, 0.08);
}


/* ========================================
   18. BLOG / ARCHIVE STYLES
   ======================================== */

.ormsy-read-more {
	display: inline-block;
	font-weight: 600;
	font-size: var(--wp--preset--font-size--small);
	text-decoration: none;
	margin-top: 0.5em;
}

.ormsy-read-more:hover {
	text-decoration: underline;
}


/* ========================================
   19. WHATSAPP PRODUCT BUTTON
   ======================================== */

.ormsy-wa-product-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	background: #25d366;
	color: #fff !important;
	padding: 0.75em 1.5em;
	border-radius: var(--wp--custom--border-radius, 8px);
	font-weight: 600;
	font-size: var(--wp--preset--font-size--small);
	text-decoration: none !important;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	cursor: pointer;
	transition: all 0.2s ease;
	margin-top: 0.5em;
	width: fit-content;
}

.ormsy-wa-product-btn:hover {
	background: #1da851;
	color: #fff !important;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.ormsy-wa-product-btn svg {
	width: 20px;
	height: 20px;
	fill: currentColor;
	flex-shrink: 0;
}
