/*
Theme Name:   Rapidtech (Shoptimizer Child)
Theme URI:    https://rapidtech.co.ke/
Description:  Rapidtech Networks child theme for Shoptimizer. Layout modelled on the Ivonix build, in Rapidtech brand colours.
Author:       Rapidtech Networks Limited
Template:     shoptimizer
Version:      1.0.0
Text Domain:  rapidtech
License:      GNU General Public License v2 or later
License URI:  http://www.gnu.org/licenses/gpl-2.0.html
*/

/* ==========================================================================
   RAPIDTECH CUSTOMIZATIONS
   Brand navy: #1e2a78
   Sections below are added incrementally. Each block is labelled so it can
   be reviewed/rolled back independently.
   ========================================================================== */

:root{
	--rt-navy:#1e2a78;     /* Rapidtech navy: primary brand */
	--rt-navy-2:#161f5e;   /* darker navy: department list */
	--rt-accent:#d72821;   /* Rapidtech red: buttons, hovers, highlights */
	--rt-accent-dark:#b81f19;
	--rt-ink:#14161c;
	--rt-muted:#6b7280;
	--rt-line:#e6e8ee;
	--rt-green:#1a7f37;
}

/* ==========================================================================
   PHASE 1 — LIGHT HEADER (white background + brand-blue accents)
   Rebuilt 2026-07-31 to match prefferedheader.png: white top bar with a
   rounded search + blue search button, a "Call Us Now" phone block, a dark
   account block + cart, and a white nav row carrying the blue department pill
   and delivery/payment badges. Brand blue drives every accent.
   ========================================================================== */

/* ---- Whole header white ---- */
.site-header,
body:not(.header-4) .site-header,
.main-header{
	background-color:#fff !important;
}
.site-header{ border-bottom:1px solid #e7eaf1; }

/* ---- Logo: use the dark/colour logo (no white swap on a white header) ---- */
.site-header .custom-logo-link img,
.site-header img.custom-logo{
	width:auto !important;
	height:46px !important;	/* "Rapidtech Data Systems" lockup needs the height to keep the sub-line legible */
	max-height:46px;
}

/* ---- Search: rounded field, grey magnifier at left, blue button at right ---- */
.site-search .widget_product_search{ margin:0; }
.site-search .woocommerce-product-search{ position:relative; display:block; margin:0; }
.site-search .woocommerce-product-search::before{
	content:""; position:absolute; left:16px; top:50%; transform:translateY(-50%);
	width:18px; height:18px; pointer-events:none;
	background:no-repeat center/contain url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><path d='M21 21l-4-4'/></svg>");
}
.site-search input.search-field{
	width:100%; height:50px; box-sizing:border-box;
	padding:0 116px 0 22px; margin:0;
	background:#fff; border:1.5px solid #d9dce6; border-radius:28px;
	font-size:15px; color:#14161c;
}
.site-search input.search-field::placeholder{ color:#9aa0ac; }
.site-search input.search-field:focus{
	border-color:var(--rt-navy); outline:none;
	box-shadow:0 0 0 3px rgba(30,42,120,.12);
}
.site-search input.search-field{ position:relative; z-index:1; }
.site-search .woocommerce-product-search button[type="submit"]{
	position:absolute; top:4px; right:4px; bottom:4px; width:96px;
	z-index:3;
	display:flex !important; align-items:center; justify-content:center;
	visibility:visible !important; opacity:1 !important;
	background:var(--rt-navy) !important; color:#fff !important;
	border:0 !important; border-radius:24px !important; cursor:pointer;
	font-size:0 !important; padding:0 !important; box-shadow:none !important;
	text-indent:0 !important;
	/* the theme gives this button screen-reader-text clipping (clip:rect(1px,1px,1px,1px)) — undo it */
	clip:auto !important; clip-path:none !important; overflow:visible !important; height:auto !important; margin:0 !important;
}
.site-search .woocommerce-product-search::before{ display:none !important; } /* only the navy search button keeps a magnifier */
.site-search .woocommerce-product-search button[type="submit"]::before{
	content:""; width:20px; height:20px;
	background:no-repeat center/contain url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><path d='M21 21l-4-4'/></svg>");
}
.site-search .woocommerce-product-search button[type="submit"]:hover{ filter:brightness(1.15); }

/* ---- "Call Us Now" click-to-call block ---- */
.rt-header-call{ display:flex; align-items:center; gap:11px; white-space:nowrap; text-decoration:none; }
.rt-call-ic{
	display:flex; align-items:center; justify-content:center; flex:0 0 auto;
	width:42px; height:42px; border-radius:50%;
	background:rgba(30,42,120,.08); color:var(--rt-navy);
}
.rt-call-ic svg{ width:20px; height:20px; }
.rt-call-txt{ display:flex; flex-direction:column; line-height:1.15; }
.rt-call-txt small{ font-size:11px; color:#6b7280; font-weight:500; }
.rt-call-txt strong{ font-size:16px; color:var(--rt-navy); font-weight:800; letter-spacing:-.2px; }
.rt-header-call:hover .rt-call-ic{ background:rgba(30,42,120,.14); }

/* ---- Account block: dark on white ---- */
.rt-header-account{ display:flex; align-items:center; gap:20px; white-space:nowrap; }
.rt-header-account .rt-acc-link{ display:flex; align-items:center; gap:9px; color:#14161c !important; line-height:1.15; text-decoration:none; }
.rt-header-account .rt-acc-link:hover{ color:var(--rt-navy) !important; }
.rt-header-account .rt-acc-icon{ stroke:var(--rt-navy); flex:0 0 auto; }
.rt-header-account .rt-acc-text{ display:flex; flex-direction:column; }
.rt-header-account .rt-acc-text small{ font-size:11px; color:#6b7280; font-weight:500; }
.rt-header-account .rt-acc-text strong{ font-size:14px; font-weight:700; color:#14161c; }

/* ---- Cart: dark text, blue icon on white ---- */
.shoptimizer-cart .cart-contents,
.shoptimizer-cart .cart-contents .amount,
.shoptimizer-cart .woocommerce-Price-amount{ color:#14161c !important; }
.shoptimizer-cart-icon i{ color:var(--rt-navy) !important; }
.shoptimizer-cart-icon svg{ stroke:var(--rt-navy) !important; }

/* ---- Nav row: blue department pill + delivery/payment badges ---- */
.col-full-nav .rt-dept-toggle{
	background:var(--rt-navy) !important; color:#fff !important;
	border-radius:24px; padding:10px 20px; margin:7px 16px 7px 0;
}
.col-full-nav .rt-dept-toggle svg{ stroke:#fff !important; }
.rt-nav-badges{ display:flex; align-items:center; gap:10px; list-style:none; margin:0; padding:0; }
.rt-badge{
	display:inline-flex; align-items:center; gap:8px;
	padding:7px 14px; border-radius:22px;
	background:#f3f5fa; border:1px solid #e4e7f0;
	font-size:13px; font-weight:600; color:#20242c; white-space:nowrap;
}
.rt-badge svg{ width:17px; height:17px; color:var(--rt-navy); flex:0 0 auto; }

/* ==========================================================================
   DESKTOP HEADER LAYOUT (>= 993px)
   ========================================================================== */
@media (min-width:993px){
	/* top row as a flex bar: logo | search | phone | account | cart */
	.main-header.col-full{
		display:flex !important;
		flex-wrap:nowrap !important;
		align-items:center;
		gap:24px;
		padding-top:14px !important;
		padding-bottom:14px !important;
	}
	/* theme's mobile account toggle has no place on the desktop bar */
	.main-header .shoptimizer-myaccount{ display:none !important; }
	.main-header .site-branding{ order:0; flex:0 0 auto; margin:0; }
	.main-header .site-search{ order:1; flex:1 1 auto; max-width:640px; margin:0; }
	.main-header .rt-header-call{ order:2; flex:0 0 auto; margin-left:auto; }
	.main-header .rt-header-account{ order:3; flex:0 0 auto; }
	.main-header .site-header-cart{ order:4; flex:0 0 auto; display:flex !important; align-items:center; margin:0; }

	/* nav row: white with a divider; hide the duplicate search + cart */
	.col-full-nav{ background-color:#fff !important; border-bottom:1px solid #e7eaf1; }
	.col-full-nav .site-search{ display:none !important; }
	.col-full-nav .site-header-cart{ display:none !important; }

	/* lay the nav out as a flex row so badges can sit hard-right */
	.col-full-nav .menu-primary-menu-container > ul{
		display:flex !important; align-items:center; gap:4px; margin:0;
	}
	.rt-nav-badges{ margin-left:auto; }

	/* category links dark on white */
	.menu-primary-menu-container > ul > li > a,
	.menu-primary-menu-container > ul > li.nolink > span{ color:#20242c !important; font-weight:600; }
	.menu-primary-menu-container > ul > li > a:hover{ color:var(--rt-navy) !important; }
}

/* ==========================================================================
   MOBILE HEADER ( <= 992px )
   ========================================================================== */
@media (max-width:992px){
	/* keep mobile clean: hide the text account + phone blocks and nav badges */
	.rt-header-account,
	.rt-header-call,
	.rt-nav-badges{ display:none !important; }
	/* logo fits the compact mobile bar */
	.site-header .custom-logo-link img,
	.site-header img.custom-logo{ height:32px !important; max-height:32px; }

	/* mobile search: shorter field, compact blue button */
	.site-search input.search-field{ height:44px; padding-right:52px; }
	.site-search .woocommerce-product-search button[type="submit"]{ width:44px; }

	/* hamburger bars + label dark on the white bar */
	.menu-toggle .bar{ background-color:var(--rt-navy) !important; }
	.menu-toggle .bar-text,
	.menu-toggle:hover .bar-text{ color:#20242c !important; }

	/* mobile search + account toggle icons blue */
	.mobile-search-toggle svg,
	.shoptimizer-myaccount svg{ stroke:var(--rt-navy) !important; }
}

/* ==========================================================================
   MOBILE: text labels under the account + cart icons
   ========================================================================== */
@media (max-width:992px){
	.main-header .shoptimizer-myaccount a,
	.main-header .site-header-cart .cart-contents{
		display:flex !important; flex-direction:column; align-items:center; gap:3px;
	}
	.main-header .shoptimizer-myaccount a::after,
	.main-header .site-header-cart .cart-contents::after{
		font-size:10px; font-weight:600; line-height:1; letter-spacing:.02em; color:#20242c;
	}
	.main-header .shoptimizer-myaccount a::after{ content:"Account"; }
	.main-header .site-header-cart .cart-contents::after{ content:"Cart"; }
	/* the theme drops the cart svg 6px inside a 29px box; square it up with the 24px account icon */
	.main-header .shoptimizer-cart-icon{ height:24px; }
	.main-header .shoptimizer-cart-icon svg{ top:0; display:block; }
	.main-header .shoptimizer-cart-icon{ position:relative; top:0; }
	.main-header .site-header-cart{ top:16px !important; } /* theme sets 21px; line the icon up with the account icon */
	.main-header .shoptimizer-cart a.cart-contents .shoptimizer-cart-icon .mini-count{
		position:absolute; top:-7px; right:-11px; bottom:auto; left:auto;
		width:18px; height:18px; line-height:18px; font-size:10px;
	}
}

/* ==========================================================================
   TOP BAR: scrolling phone + shop location on navy (rapidtech_topbar_marquee)
   ========================================================================== */
.rt-topbar{
	background:var(--rt-navy, #1e2a78); color:#fff;
	height:34px; display:flex; align-items:center; overflow:hidden;
	font-size:13px; line-height:1;
}
.rt-marquee-track{ display:flex; width:max-content; animation:rt-marquee 45s linear infinite; }
.rt-marquee-group{ display:flex; flex-shrink:0; }
.rt-topbar a{
	display:inline-flex; align-items:center; gap:8px; padding:0 48px;
	color:#fff !important; white-space:nowrap; text-decoration:none;
}
.rt-topbar a:hover strong{ text-decoration:underline; }
.rt-topbar a strong{ font-weight:700; }
.rt-topbar svg{ width:15px; height:15px; flex:0 0 auto; }
.rt-topbar:hover .rt-marquee-track,
.rt-topbar:focus-within .rt-marquee-track{ animation-play-state:paused; }
@keyframes rt-marquee{ from{ transform:translateX(0); } to{ transform:translateX(-50%); } }
@media (max-width:992px){
	.rt-topbar{ height:30px; font-size:12px; }
	.rt-marquee-track{ animation-duration:32s; }
	.rt-topbar a{ padding:0 32px; }
}
@media (prefers-reduced-motion:reduce){
	.rt-marquee-track{ animation:none; }
}

/* ==========================================================================
   RAPIDTECH — header/nav fit (Rapidtech has 10 top-level menu items + wishlist)
   ========================================================================== */
body, button, input, select, textarea{ font-family:'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif; }
h1, h2, h3, h4, h5, h6,
ul.products li.product .woocommerce-loop-product__title,
.summary h1{ font-family:'Jost', 'Inter', sans-serif; }

@media (min-width:993px){
	.main-header .site-search{ flex:1 1 auto; min-width:260px; }
	.main-header .rt-header-wish{ order:4; flex:0 0 auto; }
	.main-header .site-header-cart{ order:5; }
	.main-header.col-full{ gap:22px; }

	/* nav row: one line, items tighter */
	.col-full-nav .menu-primary-menu-container > ul{ flex-wrap:nowrap; }
	.menu-primary-menu-container > ul > li{ flex:0 0 auto; }
	.menu-primary-menu-container > ul > li > a,
	.menu-primary-menu-container > ul > li.nolink > span{ font-size:14.5px !important; padding-left:9px !important; padding-right:9px !important; white-space:nowrap; }
	.col-full-nav .rt-dept-toggle{ margin-right:8px; }
}
/* badges only where there is room for them */
@media (max-width:1699px){ .rt-nav-badges{ display:none !important; } }

/* ==========================================================================
   RAPIDTECH — mobile header: wishlist heart sits left of Account, with a label
   ========================================================================== */
@media (max-width:992px){
	.main-header .rt-header-wish{
		position:absolute; top:16px; right:106px; z-index:3;
		display:flex; flex-direction:column; align-items:center; gap:3px;
	}
	.main-header .rt-header-wish svg{ width:24px; height:24px; }
	.main-header .rt-header-wish::after{ content:"Wishlist"; font-size:10px; font-weight:600; line-height:1; letter-spacing:.02em; color:#20242c; }
	.main-header .rt-header-wish .rt-count{ top:-7px; right:-4px; }
}
