/*
Theme Name: King TopRest
Theme URI: https://toprest.com/
Author: TopRest Engineering
Author URI: https://toprest.com/
Description: King TopRest — A world-class premium e-commerce theme for water distribution stores. Glassmorphism, dark mode, app-like mobile experience. Rivals Shopify, Salla & Zid.
Version: 2.0.0
Requires at least: 6.3
Tested up to: 6.5
Requires PHP: 8.0
License: Proprietary
Text Domain: king-toprest
*/

/* ============================================================
   KING TOPREST — DESIGN SYSTEM
   World-class UI inspired by Apple, Salla & Shopify
   ============================================================ */

@import url('assets/css/variables.css');

/* === GOOGLE FONTS EQUIVALENT (loaded locally) === */
/* Arabic-optimized: Tajawal for body, Cairo for headings */
/* Fallback: system-ui until local fonts are uploaded */

/* ============================================================
   1. RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Tajawal', 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--tr-bg);
  color: var(--tr-text);
  direction: rtl;
  line-height: 1.7;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   2. TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Cairo', 'Tajawal', sans-serif;
  font-weight: 800;
  line-height: 1.3;
  color: var(--tr-heading);
}

a {
  color: var(--tr-primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover { color: var(--tr-accent); }

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

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ============================================================
   3. UTILITY CLASSES
   ============================================================ */
.desktop-only { display: none !important; }
.mobile-only  { display: block !important; }

@media (min-width: 1024px) {
  .desktop-only { display: block !important; }
  .desktop-flex  { display: flex !important; }
  .mobile-only  { display: none !important; }
}

/* ============================================================
   4. BUTTONS — Premium style
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background 0.2s;
}

.btn:hover::after {
  background: rgba(255,255,255,0.1);
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--tr-primary), var(--tr-primary-dark));
  color: #fff;
  box-shadow: 0 8px 24px rgba(30, 64, 175, 0.35);
}

.btn-primary:hover {
  box-shadow: 0 12px 32px rgba(30, 64, 175, 0.5);
  transform: translateY(-2px);
  color: #fff;
}

.btn-accent {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.35);
}

.btn-accent:hover {
  box-shadow: 0 12px 32px rgba(245, 158, 11, 0.5);
  transform: translateY(-2px);
  color: #fff;
}

.btn-glass {
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
}

.btn-glass:hover {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

/* ============================================================
   5. TOP ANNOUNCEMENT BAR
   ============================================================ */
.header-top-bar {
  background: linear-gradient(90deg, #0a0f2e, #1e3a8a, #0a0f2e);
  background-size: 200% 100%;
  animation: gradientShift 8s ease infinite;
  color: #fff;
  padding: 10px 0;
  font-size: 0.875rem;
  font-weight: 600;
  overflow: hidden;
  position: relative;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.marquee-track {
  display: flex;
  animation: marqueeRTL 30s linear infinite;
  width: max-content;
}

.marquee-track:hover { animation-play-state: paused; }

.marquee-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 3rem;
  white-space: nowrap;
  opacity: 0.95;
}

.marquee-item::before {
  content: '✦';
  color: var(--tr-accent);
  font-size: 0.7rem;
}

@keyframes marqueeRTL {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0); }
}

/* ============================================================
   6. HEADER — Glassmorphism & Smart Scroll
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 9999;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              background 0.35s ease,
              box-shadow 0.35s ease;
}

.site-header.header-hidden {
  transform: translateY(-100%);
}

.header-main {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  transition: background 0.3s, box-shadow 0.3s;
}

[data-theme="dark"] .header-main {
  background: rgba(10, 15, 46, 0.92);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.site-header.scrolled .header-main {
  box-shadow: 0 4px 32px rgba(0,0,0,0.12);
}

.header-main-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 1.5rem;
  height: 76px;
}

/* Logo */
.site-branding {
  flex-shrink: 0;
}

.site-branding img {
  height: 50px;
  width: auto;
  object-fit: contain;
}

.site-title {
  font-size: 1.5rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--tr-primary), var(--tr-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Search */
.header-search {
  flex: 1;
  max-width: 540px;
  margin: 0 auto;
}

.search-form {
  position: relative;
  display: flex;
  align-items: center;
}

.search-field {
  width: 100%;
  height: 48px;
  padding: 0 3.5rem 0 1.25rem;
  border: 2px solid transparent;
  border-radius: 50px;
  background: var(--tr-bg-alt);
  color: var(--tr-text);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.search-field:focus {
  border-color: var(--tr-primary);
  box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.12);
  background: var(--tr-bg);
}

.search-field::placeholder {
  color: var(--tr-text-muted);
}

.search-submit {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: linear-gradient(135deg, var(--tr-primary), var(--tr-primary-dark));
  color: #fff;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.search-submit:hover {
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 4px 12px rgba(30, 64, 175, 0.4);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.header-icon-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--tr-text);
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}

.header-icon-btn:hover {
  background: var(--tr-bg-alt);
  color: var(--tr-primary);
  transform: scale(1.08);
}

.header-icon-btn svg {
  width: 22px;
  height: 22px;
}

/* Notification Badge */
.notif-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  min-width: 18px;
  height: 18px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--tr-bg);
  animation: badgePop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes badgePop {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

/* Dark Mode Toggle */
.dark-mode-toggle {
  position: relative;
}

.toggle-track {
  width: 52px;
  height: 28px;
  background: var(--tr-bg-alt);
  border: 2px solid var(--tr-border);
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.3s, border-color 0.3s;
  display: flex;
  align-items: center;
  padding: 2px;
}

[data-theme="dark"] .toggle-track {
  background: var(--tr-primary);
  border-color: var(--tr-primary);
}

.toggle-thumb {
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

[data-theme="dark"] .toggle-thumb {
  transform: translateX(-24px);
}

/* Header Bottom Nav (Desktop Sticky) */
.header-bottom {
  background: var(--tr-bg);
  border-bottom: 1px solid var(--tr-border);
}

.main-navigation {
  display: flex;
  align-items: center;
}

.main-navigation > ul {
  display: flex;
  list-style: none;
  gap: 0;
  padding: 0;
  margin: 0;
}

.main-navigation > ul > li > a {
  display: block;
  padding: 1rem 1.25rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--tr-text);
  position: relative;
  transition: color 0.2s;
}

.main-navigation > ul > li > a::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--tr-primary), var(--tr-accent));
  border-radius: 3px 3px 0 0;
  transform: scaleX(0);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.main-navigation > ul > li:hover > a,
.main-navigation > ul > li.current-menu-item > a {
  color: var(--tr-primary);
}

.main-navigation > ul > li:hover > a::after,
.main-navigation > ul > li.current-menu-item > a::after {
  transform: scaleX(1);
}

/* Mobile Menu Toggle */
.menu-toggle {
  background: none;
  border: none;
  color: var(--tr-text);
  padding: 0.5rem;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s;
  flex-shrink: 0;
}
.menu-toggle:hover {
  background: var(--tr-bg-alt);
}

/* ============================================================
   7. STORIES BAR
   ============================================================ */
.stories-bar {
  background: var(--tr-bg);
  padding: 1rem 0;
  border-bottom: 1px solid var(--tr-border);
  overflow: hidden;
}

.stories-scroll {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0 1.5rem;
}

.stories-scroll::-webkit-scrollbar { display: none; }

.story-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  scroll-snap-align: start;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.story-item:hover { transform: scale(1.05); }

.story-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, var(--tr-primary), #06b6d4, var(--tr-accent));
  position: relative;
}

.story-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--tr-bg);
}

.story-avatar.seen {
  background: var(--tr-border);
}

.story-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--tr-text);
  text-align: center;
  max-width: 70px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Story Fullscreen Viewer */
.story-viewer {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.97);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.story-viewer.active {
  opacity: 1;
  visibility: visible;
}

.story-viewer-content {
  position: relative;
  width: 100%;
  max-width: 400px;
  height: 100svh;
  max-height: 850px;
  background: #000;
  border-radius: 0;
  overflow: hidden;
}

@media (min-width: 768px) {
  .story-viewer-content {
    height: 85vh;
    border-radius: 24px;
    box-shadow: 0 40px 80px rgba(0,0,0,0.6);
  }
}

.story-progress-bar {
  position: absolute;
  top: 12px;
  right: 12px;
  left: 12px;
  display: flex;
  gap: 4px;
  z-index: 10;
}

.story-progress-seg {
  flex: 1;
  height: 3px;
  background: rgba(255,255,255,0.35);
  border-radius: 2px;
  overflow: hidden;
}

.story-progress-fill {
  height: 100%;
  background: #fff;
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s linear;
}

.story-progress-fill.done { width: 100%; }

.story-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-cta {
  position: absolute;
  bottom: 2rem;
  left: 1rem;
  right: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.story-cta-btn {
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  padding: 1rem 2rem;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  width: 100%;
  text-align: center;
  transition: background 0.2s;
}

.story-cta-btn:hover {
  background: rgba(255,255,255,0.25);
}

.story-close-btn {
  position: absolute;
  top: 2.5rem;
  left: 1rem;
  background: rgba(0,0,0,0.5);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
}

/* ============================================================
   8. OFF-CANVAS MENU
   ============================================================ */
.toprest-off-canvas {
  position: fixed;
  inset: 0;
  z-index: 99998;
  visibility: hidden;
}

.toprest-off-canvas.is-open { visibility: visible; }

.off-canvas-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: background 0.35s;
}

.toprest-off-canvas.is-open .off-canvas-overlay {
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}

.off-canvas-content {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(360px, 85vw);
  background: var(--tr-bg);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -20px 0 60px rgba(0,0,0,0.15);
}

.toprest-off-canvas.is-open .off-canvas-content {
  transform: translateX(0);
}

.off-canvas-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--tr-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.close-canvas-btn {
  background: var(--tr-bg-alt);
  border: none;
  color: var(--tr-text);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}
.close-canvas-btn:hover { background: var(--tr-border); }

.off-canvas-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.mobile-navigation ul {
  list-style: none;
}

.mobile-navigation ul li a {
  display: flex;
  align-items: center;
  padding: 1rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--tr-text);
  gap: 0.75rem;
  transition: background 0.2s, color 0.2s;
}

.mobile-navigation ul li a:hover {
  background: var(--tr-bg-alt);
  color: var(--tr-primary);
}

/* ============================================================
   9. BOTTOM NAVIGATION — App-like (Mobile)
   ============================================================ */
.bottom-nav-mobile {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(0,0,0,0.06);
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  padding: 0.5rem 0 env(safe-area-inset-bottom, 0.5rem);
  z-index: 9997;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.08);
}

[data-theme="dark"] .bottom-nav-mobile {
  background: rgba(10, 15, 46, 0.95);
  border-top: 1px solid rgba(255,255,255,0.08);
}

.bottom-nav-mobile .nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.5rem 0.25rem;
  color: var(--tr-text-muted);
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 700;
  transition: color 0.2s;
  position: relative;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
}

.bottom-nav-mobile .nav-item svg {
  width: 24px;
  height: 24px;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bottom-nav-mobile .nav-item:hover svg,
.bottom-nav-mobile .nav-item.active svg {
  transform: scale(1.2) translateY(-2px);
}

.bottom-nav-mobile .nav-item.active {
  color: var(--tr-primary);
}

.bottom-nav-mobile .nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  width: 24px;
  height: 3px;
  background: var(--tr-primary);
  border-radius: 0 0 3px 3px;
}

.nav-icon-wrapper {
  position: relative;
}

.notification-badge {
  position: absolute;
  top: -4px;
  left: -4px;
  min-width: 16px;
  height: 16px;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border: 1.5px solid var(--tr-bg);
}

/* Add body padding for bottom nav */
@media (max-width: 1023px) {
  body { padding-bottom: 72px; }
}

/* ============================================================
   10. SITE MAIN
   ============================================================ */
.site-main {
  min-height: 60vh;
}

/* ============================================================
   11. WOOCOMMERCE — Premium Product Cards
   ============================================================ */
.woocommerce .products,
.woocommerce-page .products {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem !important;
  list-style: none !important;
  padding: 0 !important;
  margin: 1.5rem 0 !important;
  float: none !important;
}

@media (min-width: 640px) {
  .woocommerce .products,
  .woocommerce-page .products {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem !important;
  }
}

@media (min-width: 1024px) {
  .woocommerce .products,
  .woocommerce-page .products {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem !important;
  }
}

.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
  background: var(--tr-card-bg) !important;
  border-radius: 20px !important;
  padding: 0 !important;
  overflow: hidden !important;
  box-shadow: 0 2px 16px rgba(0,0,0,0.06) !important;
  transition: box-shadow 0.3s, transform 0.3s !important;
  position: relative !important;
  border: 1px solid var(--tr-border) !important;
  width: 100% !important;
  margin: 0 !important;
  float: none !important;
  display: flex !important;
  flex-direction: column !important;
}

.woocommerce ul.products li.product:hover,
.woocommerce-page ul.products li.product:hover {
  box-shadow: 0 16px 48px rgba(30, 64, 175, 0.18) !important;
  transform: translateY(-6px) !important;
}

/* Product image area */
.woocommerce ul.products li.product a img {
  width: 100% !important;
  height: 200px !important;
  object-fit: contain !important;
  padding: 1rem !important;
  background: linear-gradient(135deg, #f0f7ff, #e8f4fd) !important;
  border-radius: 20px 20px 0 0 !important;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.woocommerce ul.products li.product:hover a img {
  transform: scale(1.06) !important;
}

/* Product text area */
.woocommerce ul.products li.product .woocommerce-loop-product__title {
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  color: var(--tr-text) !important;
  padding: 0.75rem 1rem 0 !important;
  line-height: 1.4 !important;
}

.woocommerce ul.products li.product .price {
  padding: 0.5rem 1rem !important;
  display: block !important;
  font-weight: 800 !important;
  font-size: 1.1rem !important;
  color: var(--tr-primary) !important;
}

.woocommerce ul.products li.product .price del {
  color: var(--tr-text-muted) !important;
  font-size: 0.875rem !important;
  font-weight: 400 !important;
}

.woocommerce ul.products li.product .price ins {
  text-decoration: none !important;
  color: #dc2626 !important;
}

/* Add to cart button */
.woocommerce ul.products li.product .button,
.woocommerce ul.products li.product .add_to_cart_button {
  display: block !important;
  margin: 0.75rem 1rem 1rem !important;
  padding: 0.75rem !important;
  background: linear-gradient(135deg, var(--tr-primary), var(--tr-primary-dark)) !important;
  color: #fff !important;
  border-radius: 50px !important;
  font-weight: 700 !important;
  font-size: 0.9rem !important;
  text-align: center !important;
  border: none !important;
  cursor: pointer !important;
  transition: all 0.25s !important;
  font-family: inherit !important;
  box-shadow: 0 4px 16px rgba(30, 64, 175, 0.3) !important;
}

.woocommerce ul.products li.product .button:hover,
.woocommerce ul.products li.product .add_to_cart_button:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 24px rgba(30, 64, 175, 0.45) !important;
  color: #fff !important;
  background: linear-gradient(135deg, var(--tr-primary-dark), var(--tr-primary)) !important;
}

/* Sale Badge */
.woocommerce span.onsale {
  position: absolute !important;
  top: 12px !important;
  left: 12px !important;
  right: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 4px 10px !important;
  background: linear-gradient(135deg, #ef4444, #dc2626) !important;
  color: #fff !important;
  font-size: 0.75rem !important;
  font-weight: 800 !important;
  border-radius: 50px !important;
  line-height: 1.4 !important;
  letter-spacing: 0.02em !important;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35) !important;
  z-index: 5 !important;
  animation: none !important;
}

/* ============================================================
   12. WOOCOMMERCE PAGES
   ============================================================ */
/* Cart */
.woocommerce table.shop_table {
  border-collapse: collapse;
  border: 1px solid var(--tr-border);
  border-radius: 16px;
  overflow: hidden;
  width: 100%;
}

.woocommerce table.shop_table td,
.woocommerce table.shop_table th {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--tr-border);
}

.woocommerce table.shop_table th {
  background: var(--tr-bg-alt);
  font-weight: 800;
}

/* Checkout */
.woocommerce .woocommerce-checkout .form-row label {
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: block;
  color: var(--tr-text);
}

.woocommerce .woocommerce-checkout .form-row input[type="text"],
.woocommerce .woocommerce-checkout .form-row input[type="email"],
.woocommerce .woocommerce-checkout .form-row input[type="tel"],
.woocommerce .woocommerce-checkout .form-row select,
.woocommerce .woocommerce-checkout .form-row textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid var(--tr-border);
  border-radius: 12px;
  background: var(--tr-bg);
  color: var(--tr-text);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.woocommerce .woocommerce-checkout .form-row input:focus,
.woocommerce .woocommerce-checkout .form-row select:focus,
.woocommerce .woocommerce-checkout .form-row textarea:focus {
  border-color: var(--tr-primary);
  box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.12);
}

.woocommerce #place_order {
  background: linear-gradient(135deg, var(--tr-primary), var(--tr-primary-dark)) !important;
  color: #fff !important;
  border: none !important;
  padding: 1rem 2.5rem !important;
  border-radius: 50px !important;
  font-size: 1.1rem !important;
  font-weight: 800 !important;
  font-family: inherit !important;
  cursor: pointer !important;
  box-shadow: 0 8px 24px rgba(30, 64, 175, 0.35) !important;
  transition: all 0.25s !important;
  width: 100% !important;
}

.woocommerce #place_order:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 12px 32px rgba(30, 64, 175, 0.5) !important;
}

/* My Account Dashboard */
.woocommerce-account .woocommerce-MyAccount-navigation {
  background: var(--tr-bg-alt);
  border-radius: 20px;
  padding: 1rem;
  margin-bottom: 2rem;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  margin: 0;
}

@media (min-width: 768px) {
  .woocommerce-account .woocommerce-MyAccount-navigation ul {
    flex-direction: column;
  }
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  border-radius: 12px;
  font-weight: 700;
  color: var(--tr-text);
  transition: all 0.2s;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li a:hover,
.woocommerce-account .woocommerce-MyAccount-navigation ul li.is-active a {
  background: linear-gradient(135deg, var(--tr-primary), var(--tr-primary-dark));
  color: #fff;
}

/* Order status badges */
.woocommerce-order-status {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.875rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 700;
}

.woocommerce-order-status.status-processing { background: #dbeafe; color: #1d4ed8; }
.woocommerce-order-status.status-completed  { background: #dcfce7; color: #15803d; }
.woocommerce-order-status.status-on-hold    { background: #fef9c3; color: #a16207; }
.woocommerce-order-status.status-cancelled  { background: #fee2e2; color: #b91c1c; }
.woocommerce-order-status.status-wc-factory-process { background: #ede9fe; color: #6d28d9; }

/* ============================================================
   13. MEGA FOOTER
   ============================================================ */
.site-footer {
  background: linear-gradient(160deg, #0a0f2e 0%, #0f172a 100%);
  color: #94a3b8;
  margin-top: 5rem;
}

.footer-main {
  padding: 4rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

@media (min-width: 640px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 2fr; }
}

.footer-logo img { height: 48px; filter: brightness(0) invert(1); }
.footer-title { color: #fff; font-size: 1.5rem; font-weight: 900; margin-bottom: 0.75rem; }
.footer-tagline { color: #64748b; line-height: 1.7; margin-bottom: 1.5rem; }

.trust-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.trust-badge {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  color: #94a3b8;
  padding: 0.5rem 0.875rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  transition: background 0.2s;
}
.trust-badge:hover { background: rgba(255,255,255,0.12); }

.footer-col-title {
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--tr-primary);
  display: inline-block;
}

.footer-links { list-style: none; }
.footer-links li { margin-bottom: 0.75rem; }
.footer-links a {
  color: #64748b;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.2s, padding 0.2s;
}
.footer-links a::before {
  content: '‹';
  color: var(--tr-primary);
  font-weight: 900;
}
.footer-links a:hover { color: #fff; padding-right: 4px; }

.newsletter-desc { color: #64748b; margin-bottom: 1rem; font-size: 0.9rem; }

.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.newsletter-input {
  padding: 0.875rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.newsletter-input::placeholder { color: #475569; }
.newsletter-input:focus { border-color: var(--tr-primary); }

.footer-bottom {
  padding: 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  text-align: center;
}

@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
  }
}

.footer-copyright { font-size: 0.875rem; color: #475569; }

.footer-social {
  display: flex;
  gap: 0.75rem;
}

.social-link {
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  transition: all 0.2s;
}

.social-link:hover {
  background: var(--tr-primary);
  border-color: var(--tr-primary);
  color: #fff;
  transform: translateY(-2px);
}

/* ============================================================
   14. GEOLOCATION MODAL
   ============================================================ */
.toprest-modal {
  position: fixed;
  inset: 0;
  z-index: 99997;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0.35s, opacity 0.35s;
}

@media (min-width: 640px) {
  .toprest-modal { align-items: center; }
}

.toprest-modal[aria-hidden="false"] {
  visibility: visible;
  opacity: 1;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
}

.modal-content {
  position: relative;
  background: var(--tr-bg);
  width: 100%;
  max-width: 480px;
  border-radius: 28px 28px 0 0;
  padding: 2rem;
  transform: translateY(30px);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 -20px 60px rgba(0,0,0,0.2);
}

@media (min-width: 640px) {
  .modal-content {
    border-radius: 28px;
    transform: scale(0.9);
  }
}

.toprest-modal[aria-hidden="false"] .modal-content {
  transform: translateY(0) scale(1);
}

.modal-handle {
  width: 40px;
  height: 4px;
  background: var(--tr-border);
  border-radius: 2px;
  margin: 0 auto 1.5rem;
}

.modal-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--tr-heading);
  margin-bottom: 0.5rem;
  text-align: center;
}

.modal-subtitle {
  color: var(--tr-text-muted);
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.city-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.city-btn {
  padding: 1rem;
  border: 2px solid var(--tr-border);
  border-radius: 16px;
  background: var(--tr-bg-alt);
  color: var(--tr-text);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.city-btn:hover,
.city-btn.selected {
  border-color: var(--tr-primary);
  background: rgba(30, 64, 175, 0.08);
  color: var(--tr-primary);
}

/* ============================================================
   15. DARK MODE VARIABLES
   ============================================================ */
[data-theme="dark"] {
  --tr-bg: #0a0f2e;
  --tr-bg-alt: #0f1a3a;
  --tr-card-bg: #111c3f;
  --tr-text: #e2e8f0;
  --tr-text-muted: #64748b;
  --tr-heading: #f1f5f9;
  --tr-border: rgba(255,255,255,0.08);
}

[data-theme="dark"] .woocommerce ul.products li.product a img {
  background: linear-gradient(135deg, #0f1a3a, #1a2a5e) !important;
}

/* ============================================================
   16. SECTION HEADINGS
   ============================================================ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding: 0 0.5rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--tr-heading);
  position: relative;
}

.section-title::before {
  content: '';
  position: absolute;
  bottom: -4px;
  right: 0;
  width: 40px;
  height: 4px;
  background: linear-gradient(90deg, var(--tr-primary), var(--tr-accent));
  border-radius: 2px;
}

.view-all-link {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--tr-primary);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* ============================================================
   17. TOPREST NATIVE HERO BLOCK
   ============================================================ */
.toprest-hero-banner {
  position: relative;
  min-height: 400px;
  display: flex;
  align-items: center;
  overflow: hidden;
  border-radius: 0;
  background: linear-gradient(135deg, #0a0f2e, #1e3a8a);
}

@media (min-width: 768px) {
  .toprest-hero-banner {
    min-height: 560px;
    border-radius: 24px;
    margin: 1.5rem;
  }
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 3rem 2rem;
  max-width: 600px;
}

.hero-tag {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  color: #fff;
  padding: 0.35rem 1rem;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 1rem;
  border: 1px solid rgba(255,255,255,0.25);
}

.hero-title {
  font-size: clamp(1.75rem, 5vw, 3rem);
  font-weight: 900;
  color: #fff;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero-subtitle {
  color: rgba(255,255,255,0.8);
  font-size: 1.1rem;
  margin-bottom: 2rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ============================================================
   18. PRODUCT GRID BLOCK
   ============================================================ */
.toprest-product-grid-block {
  padding: 2rem 0;
}

.toprest-section {
  padding: 3rem 0;
}

/* ============================================================
   19. PAGE LOADING SKELETON (for AJAX sections)
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, var(--tr-bg-alt) 25%, var(--tr-border) 50%, var(--tr-bg-alt) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 12px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================================
   20. SCROLL TO TOP BTN
   ============================================================ */
.scroll-top-btn {
  position: fixed;
  bottom: 90px;
  left: 1.5rem;
  width: 44px;
  height: 44px;
  background: var(--tr-primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(30, 64, 175, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s;
  z-index: 9990;
}

.scroll-top-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

@media (min-width: 1024px) {
  .scroll-top-btn { bottom: 2rem; }
}

/* ============================================================
   21. MISC OVERRIDES & POLISH
   ============================================================ */
/* Hide WooCommerce result count ugly style */
.woocommerce-result-count {
  color: var(--tr-text-muted);
  font-size: 0.9rem;
}

/* Product category pages */
.woocommerce .products.columns-3 { grid-template-columns: repeat(3, 1fr) !important; }
.woocommerce .products.columns-4 { grid-template-columns: repeat(4, 1fr) !important; }

/* Responsive table for mobile */
@media (max-width: 640px) {
  .woocommerce table.shop_table {
    font-size: 0.875rem;
  }
  .woocommerce table.shop_table td,
  .woocommerce table.shop_table th {
    padding: 0.75rem;
  }
}
