/*
Theme Name: RefStore
Theme URI: https://example.com/refstore
Author: SEO Manager Bundle
Description: Lightweight SEO-first storefront theme for cloned reference sites. Server-rendered semantic HTML, native WooCommerce templates, self-hosted assets only.
Version: 1.0.0
Requires at least: 5.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: refstore
Tags: e-commerce, woocommerce, lightweight
*/

:root {
  --rs-accent: #1a1a1a;
  --rs-accent-dark: #000000;
  --rs-dark: #1a1a1a;
  --rs-dark-deep: #000000;
  --rs-text: #1a1a1a;
  --rs-muted: #6b7280;
  --rs-line: rgba(26,26,26,0.12);
  --rs-bg: #ffffff;
  --rs-bg-soft: #f8fafc;
  --rs-radius: 12px;
  --rs-radius-button: 60px;
  --rs-container: 1300px;
  --rs-accent-2: #9733e4;
  --rs-sale: #f83a3a;
  --rs-star: #ffea4a;
  --rs-heading-font: Montserrat, "Segoe UI", Roboto, Arial, sans-serif;
  --rs-body-font: Montserrat, "Segoe UI", Roboto, Arial, sans-serif;
  --rs-heading-letter-spacing: -0.04em;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--rs-body-font);
  font-size: 15px;
  line-height: 1.65;
  color: var(--rs-text);
  background: var(--rs-bg);
}
img { max-width: 100%; height: auto; }
a { color: var(--rs-accent); text-decoration: none; }
a:hover { color: var(--rs-accent-dark); }
h1, h2, h3, h4 { line-height: 1.3; color: var(--rs-text); margin: 0 0 .6em; font-family: var(--rs-heading-font); letter-spacing: var(--rs-heading-letter-spacing); }
h1 { font-size: 40px; }
h2 { font-size: 32px; }
h3 { font-size: 24px; }
h4 { font-size: 22px; }
.rs-container, .rs-main > .container { max-width: var(--rs-container); margin: 0 auto; padding: 0 16px; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
button { font: inherit; cursor: pointer; }

/* ---------- promo marquee (scrolling announcement bar) ---------- */
.rs-marquee {
  background: var(--rs-accent, #1a1a1a);
  color: #fff;
  overflow: hidden;
  white-space: nowrap;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.rs-marquee-track {
  display: inline-flex;
  align-items: center;
  padding: 9px 0;
  animation: rs-marquee-scroll 30s linear infinite;
  will-change: transform;
}
.rs-marquee:hover .rs-marquee-track { animation-play-state: paused; }
.rs-marquee-item {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  padding: 0 20px;
}
.rs-marquee-sep {
  flex: 0 0 auto;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: .5;
}
@keyframes rs-marquee-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .rs-marquee-track { animation: none; } }

/* ---------- top notice ---------- */
.rs-notice {
  background: var(--rs-dark-deep);
  color: #fff;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
}

/* ---------- header ---------- */
.rs-header { background: #fff; border-bottom: 1px solid var(--rs-line); }
.rs-header-main {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  padding: 16px 16px;
  max-width: var(--rs-container);
  margin: 0 auto;
}
.rs-logo { display: flex; align-items: center; justify-content: center; gap: 10px; justify-self: center; }
.rs-logo img { max-height: 44px; width: auto; }
.rs-logo .rs-site-title { font-size: 24px; font-weight: 800; color: var(--rs-text); letter-spacing: -.5px; }
.rs-tools { display: flex; align-items: center; gap: 22px; justify-self: end; }
.rs-tool { display: inline-flex; align-items: center; gap: 7px; color: var(--rs-text); font-size: 13px; font-weight: 600; position: relative; }
.rs-tool-icon { padding: 4px; }
.rs-tool svg { width: 24px; height: 24px; stroke: currentColor; }
.rs-cart-count {
  position: absolute;
  top: -7px;
  left: 13px;
  min-width: 17px;
  height: 17px;
  border-radius: 999px;
  background: var(--rs-accent);
  color: #fff;
  font-size: 11px;
  line-height: 17px;
  text-align: center;
  padding: 0 4px;
}
.rs-burger { border: 0; background: none; padding: 6px; color: var(--rs-text); display: inline-flex; }
.rs-burger svg { width: 26px; height: 26px; stroke: currentColor; }

/* ---------- header dropdown mini-cart ---------- */
.rs-cart-wrap { position: relative; }
.rs-cart-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 340px;
  max-width: 92vw;
  margin-top: 10px;
  background: #fff;
  border: 1px solid var(--rs-line);
  border-radius: var(--rs-radius);
  box-shadow: 0 18px 44px rgba(15, 23, 42, .16);
  padding: 16px;
  z-index: 60;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
}
.rs-cart-wrap:hover .rs-cart-dropdown,
.rs-cart-wrap:focus-within .rs-cart-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.rs-cart-dropdown .woocommerce-mini-cart {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 320px;
  overflow-y: auto;
}
.rs-cart-dropdown .woocommerce-mini-cart-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rs-line);
  font-size: 13px;
  position: relative;
}
.rs-cart-dropdown .woocommerce-mini-cart-item img {
  width: 48px;
  height: auto;
  border-radius: 6px;
  order: -1;
}
.rs-cart-dropdown .woocommerce-mini-cart-item a:not(.remove) { color: #0f172a; font-weight: 600; }
.rs-cart-dropdown .woocommerce-mini-cart-item .quantity { color: var(--rs-muted); font-weight: 400; }
.rs-cart-dropdown a.remove {
  margin-left: auto;
  color: var(--rs-muted) !important;
  font-size: 18px;
  line-height: 1;
}
.rs-cart-dropdown a.remove:hover { color: var(--rs-accent) !important; }
.rs-cart-dropdown .woocommerce-mini-cart__total {
  display: flex;
  justify-content: space-between;
  margin: 12px 0;
  font-size: 14px;
}
.rs-cart-dropdown .woocommerce-mini-cart__total strong { color: var(--rs-accent); }
.rs-cart-dropdown .woocommerce-mini-cart__buttons {
  display: flex;
  gap: 8px;
  margin: 0;
}
.rs-cart-dropdown .woocommerce-mini-cart__buttons .button {
  flex: 1;
  text-align: center;
  padding: 9px 10px;
  border-radius: var(--rs-radius);
  font-size: 13px;
  font-weight: 600;
}
.rs-cart-dropdown .woocommerce-mini-cart__buttons .checkout {
  background: var(--rs-accent);
  color: #fff;
}
.rs-cart-dropdown .woocommerce-mini-cart__empty-message {
  margin: 6px 0;
  color: var(--rs-muted);
  font-size: 13px;
}

/* ---------- primary nav ---------- */
.rs-nav { border-top: 1px solid var(--rs-line); background: #fff; }
.rs-nav ul { list-style: none; margin: 0 auto; padding: 0 16px; max-width: var(--rs-container); display: flex; flex-wrap: wrap; }
.rs-nav li { position: relative; }
.rs-nav a {
  display: block;
  padding: 13px 15px;
  color: #0f172a;
  font-size: 13.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.rs-nav a:hover { color: var(--rs-accent); }
.rs-nav .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 60;
  min-width: 230px;
  background: #fff;
  border: 1px solid var(--rs-line);
  border-radius: 0 0 var(--rs-radius) var(--rs-radius);
  box-shadow: 0 14px 34px rgba(15, 23, 42, .12);
  padding: 6px 0;
}
.rs-nav li:hover > .sub-menu, .rs-nav li:focus-within > .sub-menu { display: block; }
.rs-nav .sub-menu li { width: 100%; }
.rs-nav .sub-menu a { padding: 9px 16px; text-transform: none; font-weight: 500; font-size: 14px; }

/* ---------- mobile drawer ---------- */
.rs-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(330px, 86vw);
  background: #fff;
  z-index: 1001;
  transform: translateX(-102%);
  transition: transform .25s ease;
  overflow-y: auto;
  padding: 18px;
  box-shadow: 6px 0 40px rgba(0, 0, 0, .25);
}
.rs-drawer.is-open { transform: translateX(0); }
.rs-drawer-close {
  border: 0; background: #f1f1f4; width: 42px; height: 42px; border-radius: 50%;
  font-size: 24px; line-height: 1; color: #0f172a; display: inline-flex;
  align-items: center; justify-content: center; transition: background .2s, transform .2s;
}
.rs-drawer-close:hover { background: #e3e3e8; transform: rotate(90deg); }
.rs-drawer nav ul { list-style: none; margin: 26px 0 0; padding: 0; }

/* top-level items: large, bold — reference drawer style */
.rs-drawer nav > ul > li { border-bottom: 0; }
.rs-drawer nav > ul > li > a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 4px;
  font-family: var(--rs-heading-font, inherit);
  font-size: clamp(21px, 6.4vw, 27px);
  font-weight: 800; letter-spacing: -0.02em; line-height: 1.12;
  color: #111;
  transition: color .18s ease;
}
.rs-drawer nav > ul > li > a:hover { color: var(--rs-accent, #6d28d9); }
/* chevron affordance (gray circle, like the reference) */
.rs-drawer nav > ul > li > a::after {
  content: "\203A";
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: #ececef; color: #6b7280;
  font-size: 17px; line-height: 1;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
.rs-drawer nav > ul > li > a:hover::after { background: var(--rs-accent, #6d28d9); color: #fff; transform: translateX(2px); }

/* staggered slide-in when the drawer opens (pure CSS, .is-open added by theme.js) */
.rs-drawer nav > ul > li {
  opacity: 0; transform: translateX(-16px);
  transition: opacity .4s ease, transform .4s cubic-bezier(.2,.7,.3,1);
}
.rs-drawer.is-open nav > ul > li { opacity: 1; transform: none; }
.rs-drawer.is-open nav > ul > li:nth-child(1) { transition-delay: .04s; }
.rs-drawer.is-open nav > ul > li:nth-child(2) { transition-delay: .08s; }
.rs-drawer.is-open nav > ul > li:nth-child(3) { transition-delay: .12s; }
.rs-drawer.is-open nav > ul > li:nth-child(4) { transition-delay: .16s; }
.rs-drawer.is-open nav > ul > li:nth-child(5) { transition-delay: .20s; }
.rs-drawer.is-open nav > ul > li:nth-child(6) { transition-delay: .24s; }
.rs-drawer.is-open nav > ul > li:nth-child(7) { transition-delay: .28s; }
.rs-drawer.is-open nav > ul > li:nth-child(8) { transition-delay: .32s; }
.rs-drawer.is-open nav > ul > li:nth-child(9) { transition-delay: .36s; }
.rs-drawer.is-open nav > ul > li:nth-child(n+10) { transition-delay: .40s; }
@media (prefers-reduced-motion: reduce) {
  .rs-drawer nav > ul > li { opacity: 1; transform: none; transition: none; }
}

.rs-drawer nav .sub-menu { margin: 4px 0 8px 12px; padding: 0; list-style: none; }
.rs-drawer nav .sub-menu li { border-bottom: 0; }
.rs-drawer nav .sub-menu a { display: block; font-weight: 500; font-size: 15px; padding: 7px 4px; color: var(--rs-muted); }
.rs-drawer nav .sub-menu a::after { content: none; }
.rs-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .5);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.rs-overlay.is-open { opacity: 1; pointer-events: auto; }

/* ---------- main ---------- */
.rs-main { min-height: 50vh; }
.rs-main > .container { padding-top: 22px; padding-bottom: 44px; }
/* Home is a full-width canvas: each engine section (.rs-sec) spans the viewport
 * so its background can go edge-to-edge, while .rs-sec-inner centers content. */
.rs-home { padding: 22px 0 44px; }
.rs-page-title { margin: 4px 0 18px; }

/* ---------- footer ---------- */
.rs-footer { background: var(--rs-bg); color: var(--rs-text); margin-top: 30px; border-top: 1px solid var(--rs-line); }
.rs-footer-inner {
  max-width: var(--rs-container);
  margin: 0 auto;
  padding: 48px 16px 32px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}
.rs-footer-block h4 { color: var(--rs-text); font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin: 0 0 14px; }
.rs-footer-block ul { list-style: none; margin: 0; padding: 0; }
.rs-footer-block li { margin-bottom: 9px; }
.rs-footer-block a { color: var(--rs-muted); font-size: 14px; }
.rs-footer-block a:hover { color: var(--rs-text); }
.rs-footer-contact-text { font-size: 14px; color: var(--rs-muted); line-height: 1.6; }
.rs-footer-contact-text strong { color: var(--rs-text); font-weight: 600; }
.rs-footer-contact-text p { margin: 0 0 6px; }
.rs-footer-bottom {
  border-top: 1px solid var(--rs-line);
  max-width: var(--rs-container);
  margin: 0 auto;
  padding: 18px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
  color: var(--rs-muted);
}
.rs-footer-copyright { margin: 0; }
.rs-footer-pay { display: flex; gap: 6px; }
.rs-pay {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; height: 24px; padding: 0 6px;
  border: 1px solid var(--rs-line); border-radius: 4px;
  font-size: 10px; font-weight: 700; color: var(--rs-muted); background: #fff;
}

/* ---------- woocommerce: shared ---------- */
.woocommerce-breadcrumb { font-size: 13px; color: var(--rs-muted); margin: 0 0 16px !important; }
.woocommerce-breadcrumb a { color: var(--rs-muted); }
.rs-main .button,
.rs-main button[type="submit"],
.rs-main .single_add_to_cart_button {
  background: var(--rs-dark) !important;
  color: #fff !important;
  border: 0;
  border-radius: var(--rs-radius-button, var(--rs-radius));
  padding: 14px 28px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .03em;
  text-transform: uppercase;
  transition: background .15s ease;
}
.rs-main .button:hover, .rs-main .single_add_to_cart_button:hover { background: var(--rs-accent) !important; }
.woocommerce .price, .rs-main .price { color: var(--rs-accent) !important; font-weight: 700; }
.woocommerce .price del { color: var(--rs-muted) !important; font-weight: 400; }
.onsale {
  background: var(--rs-sale, var(--rs-accent)) !important;
  border-radius: 6px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  padding: 6px 9px !important;
  min-height: 0 !important;
  min-width: 0 !important;
}
.woocommerce .star-rating, .star-rating { color: var(--rs-star, #ffea4a); }
.woocommerce .price ins, .woocommerce ins .price, .woocommerce ul.products li.product .price ins { color: var(--rs-sale, var(--rs-accent)) !important; }

/* ---------- woocommerce: product grid ---------- */
.woocommerce ul.products { display: grid !important; grid-template-columns: repeat(4, 1fr); gap: 20px; margin: 0 0 28px !important; padding: 0; list-style: none; }
.woocommerce ul.products::before, .woocommerce ul.products::after { display: none !important; }
.woocommerce ul.products li.product {
  width: auto !important;
  float: none !important;
  margin: 0 !important;
  background: #fff;
  border: 1px solid var(--rs-line);
  border-radius: var(--rs-radius);
  padding: 14px !important;
  display: flex;
  flex-direction: column;
  text-align: center;
  transition: box-shadow .15s ease, transform .15s ease;
}
.woocommerce ul.products li.product:hover { box-shadow: 0 12px 30px rgba(15, 23, 42, .1); transform: translateY(-2px); }
.woocommerce ul.products li.product img { border-radius: 8px; margin-bottom: 10px !important; }
.woocommerce ul.products li.product .woocommerce-loop-product__title { font-size: 14.5px !important; font-weight: 600; padding: 2px 0 4px !important; color: #0f172a; }
.woocommerce ul.products li.product .price { font-size: 15px !important; margin-bottom: 10px !important; }
.woocommerce ul.products li.product .button { margin-top: auto !important; width: 100%; }
.woocommerce ul.products li.product .star-rating { margin: 0 auto 6px !important; }

/* ---------- woocommerce: single product ---------- */
.woocommerce div.product div.images { border-radius: var(--rs-radius); overflow: hidden; }
.woocommerce div.product .product_title { font-size: 28px; margin-bottom: 8px; }
.woocommerce div.product p.price { font-size: 24px; margin-bottom: 14px; }
.woocommerce div.product form.cart { margin: 18px 0 !important; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.woocommerce div.product form.cart div.quantity .qty { height: 44px; border: 1px solid var(--rs-line); border-radius: var(--rs-radius); width: 70px; }
.woocommerce div.product .woocommerce-tabs ul.tabs { padding: 0 !important; margin: 0 0 -1px !important; }
.woocommerce div.product .woocommerce-tabs ul.tabs li {
  background: var(--rs-bg-soft) !important;
  border: 1px solid var(--rs-line) !important;
  border-radius: var(--rs-radius) var(--rs-radius) 0 0 !important;
  margin: 0 6px 0 0 !important;
}
.woocommerce div.product .woocommerce-tabs ul.tabs li.active { background: #fff !important; border-bottom-color: #fff !important; }
.woocommerce div.product .woocommerce-tabs ul.tabs li::before,
.woocommerce div.product .woocommerce-tabs ul.tabs li::after { display: none !important; }
.woocommerce div.product .woocommerce-tabs .panel {
  border: 1px solid var(--rs-line);
  border-radius: 0 var(--rs-radius) var(--rs-radius) var(--rs-radius);
  padding: 22px;
  margin-bottom: 30px;
}
.related.products > h2, .upsells.products > h2 { font-size: 22px; margin: 10px 0 18px; }

/* ---------- woocommerce: cart/checkout/account ---------- */
.woocommerce-cart table.cart img { width: 70px; border-radius: 8px; }
.woocommerce table.shop_table { border: 1px solid var(--rs-line) !important; border-radius: var(--rs-radius) !important; }
.woocommerce-message, .woocommerce-info { border-top-color: var(--rs-accent) !important; }

/* ---------- sections (plugin uses these too) ---------- */
.rs-section { margin: 0 0 36px; }
.rs-section-head { display: flex; align-items: baseline; gap: 14px; border-bottom: 2px solid var(--rs-line); margin-bottom: 18px; }
.rs-section-head h2 { font-size: 21px; margin: 0 0 -2px; padding-bottom: 10px; border-bottom: 3px solid var(--rs-accent); text-transform: uppercase; letter-spacing: .02em; }
.rs-section-head .rs-more { margin-left: auto; font-size: 13px; font-weight: 600; }

/* ---------- seo richtext ---------- */
.rs-richtext { font-size: 15px; line-height: 1.75; max-width: 1100px; }
.rs-richtext h2 { font-size: 22px; margin: 30px 0 12px; border-left: 4px solid var(--rs-accent); padding-left: 13px; }
.rs-richtext h2:first-child { margin-top: 0; }
.rs-richtext h3 { font-size: 18px; margin: 22px 0 9px; }
.rs-richtext table { width: 100%; border-collapse: collapse; margin: 0 0 20px; }
.rs-richtext th, .rs-richtext td { border: 1px solid var(--rs-line); padding: 9px 13px; text-align: left; }
.rs-richtext th { background: var(--rs-bg-soft); }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .woocommerce ul.products { grid-template-columns: repeat(3, 1fr); }
  .rs-nav { display: none; }
  .rs-burger { display: inline-flex; }
  .rs-logo .rs-site-title { font-size: 21px; }
  .rs-header-main { gap: 10px; flex-wrap: wrap; }
  .rs-search { order: 5; flex-basis: 100%; }
  .rs-tool span.rs-tool-label { display: none; }
}
@media (max-width: 640px) {
  .woocommerce ul.products { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  h1 { font-size: 24px; }
  .rs-footer-inner { grid-template-columns: 1fr; gap: 20px; }
  .woocommerce div.product .woocommerce-tabs .panel { padding: 15px; }
}
