/*
Theme Name: Segma Commerce
Theme URI: https://segma.tn
Author: Segma
Author URI: https://segma.tn
Description: ثيم تجارة إلكترونية خفيف وسريع مُحسَّن للغة العربية ومتوافق مع WooCommerce
Version: 1.1.0-shopingo-staging
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
WC requires at least: 8.0
WC tested up to: 9.0
Text Domain: segma-commerce
Tags: woocommerce, arabic, rtl, ecommerce, lightweight
*/

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  --clr-primary: #FF5100;
  --clr-primary-dark: #e04800;
  --clr-primary-light: #ff6a1a;
  --clr-secondary: #e04800;
  --clr-topbar: #FF5100;
  --clr-flash: #e74c3c;
  --clr-text: #1a1a1a;
  --clr-text-muted: #777;
  --clr-price-old: #aaa;
  --clr-price-new: #FF5100;
  --clr-price-good: #27ae60;
  --clr-bg: #f5f5f5;
  --clr-white: #ffffff;
  --clr-card: #ffffff;
  --clr-border: #e8e8e8;
  --clr-badge-bg: #FF5100;
  --clr-badge-text: #ffffff;
  --clr-star: #f5a623;

  --font-main: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
  --font-size-base: 14px;
  --font-size-sm: 12px;
  --font-size-lg: 16px;
  --font-size-xl: 20px;

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 12px;
  --radius-full: 50%;

  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 4px 16px rgba(255, 81, 0, 0.18);
  --shadow-primary-soft: rgba(255, 81, 0, 0.1);
  --shadow-primary-focus: rgba(255, 81, 0, 0.12);
  --shadow-primary-strong: rgba(255, 81, 0, 0.35);
  --shadow-primary-pulse: rgba(255, 81, 0, 0.65);
  --shadow-flash-soft: rgba(231, 76, 60, 0.1);
  --shadow-flash-focus: rgba(231, 76, 60, 0.12);

  --transition: 0.2s ease;

  --container-max: 1200px;
  --header-h: 60px;
  --topbar-h: 36px;
}

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

html {
  direction: inherit;
  font-size: var(--font-size-base);
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  color: var(--clr-text);
  background: var(--clr-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

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

ul,
ol {
  list-style: none;
}

button,
input,
select,
textarea {
  font-family: var(--font-main);
  font-size: var(--font-size-base);
}

/* ============================================================
   CONTAINER
   ============================================================ */
.segma-container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: 16px !important;
  padding-right: 16px !important;
  /* 16px on all screen sizes so content never hits the edge */
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.px-4 {
  padding-left: 1rem;
  padding-right: 1rem;
}

.gap-6 {
  gap: 1.5rem;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--clr-primary);
  color: var(--clr-white);
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-size: var(--font-size-base);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  width: 100%;
  text-align: center;
}

.btn-primary:hover {
  background: var(--clr-primary-dark);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  color: var(--clr-primary);
  border: 2px solid var(--clr-primary);
  border-radius: var(--radius-sm);
  padding: 7px 16px;
  font-size: var(--font-size-base);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-outline:hover {
  background: var(--clr-primary);
  color: var(--clr-white);
}

/* ============================================================
   SECTION TITLE
   ============================================================ */
.section-title {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--clr-text);
  text-align: center;
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 10px;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 50%;
  transform: translateX(50%);
  width: 50px;
  height: 3px;
  background: var(--clr-primary);
  border-radius: 2px;
}

/* ============================================================
   LOADING SKELETON
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}

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

  100% {
    background-position: -200% 0;
  }
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: var(--clr-primary);
  border-radius: 3px;
}

/* ============================================================
   STATIC PAGES (About, Privacy, etc.)
   ============================================================ */
.segma-generic-page {
  background: var(--clr-white);
  padding: 40px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  max-width: 900px;
  margin: 0 auto;
}

.page-content {
  font-size: 18px; /* Bigger font size for clear reading */
  line-height: 2.2; /* Better line height */
  color: #333;
}

.page-content h1,
.page-content h2,
.page-content h3,
.page-content h4 {
  font-weight: 800;
  color: #111;
  margin-top: 35px;
  margin-bottom: 15px;
}

.page-content p {
  margin-bottom: 25px;
}

.page-content ul,
.page-content ol {
  margin-bottom: 25px;
  padding-right: 30px; /* Right padding for RTL */
}

.page-content li {
  margin-bottom: 12px;
}

.page-content strong,
.page-content b {
  color: #000;
  font-weight: 800;
}

@media (max-width: 768px) {
  .segma-generic-page {
    padding: 20px;
  }
  .page-content {
    font-size: 16px;
  }
}

/* ============================================================
   CONTACT FORM
   ============================================================ */
.segma-contact-form-wrap {
  max-width: 600px;
  margin: 40px auto;
  padding: 30px;
  background: #ffffff;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.segma-contact-form-wrap .form-row {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
}

.segma-contact-form-wrap label {
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--clr-text);
  font-size: 16px;
  display: block; /* Ensure it stays on its own line */
}

.segma-contact-form-wrap .required {
  color: var(--clr-flash);
  margin-right: 4px;
}

.segma-contact-form-wrap .input-text {
  width: 100%;
  padding: 14px 15px;
  border: 1px solid #dcdcdc;
  border-radius: var(--radius-md);
  font-size: 16px;
  transition: all var(--transition);
  background: #fdfdfd;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.02);
}

.segma-contact-form-wrap .input-text:focus {
  outline: none;
  border-color: var(--clr-primary);
  background: #fff;
  box-shadow: 0 0 0 4px var(--shadow-primary-soft);
}

.segma-contact-form-wrap textarea.input-text {
  resize: vertical;
  min-height: 120px;
}

.segma-contact-form-wrap button[type="submit"] {
  width: 100%;
  padding: 16px;
  font-size: 18px;
  margin-top: 15px;
  box-shadow: 0 4px 12px var(--shadow-primary-focus);
}

.woocommerce-message,
.woocommerce-error {
  padding: 15px 20px;
  margin-bottom: 25px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
}

.woocommerce-message {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
}

.woocommerce-error {
  background: #ffebee;
  color: #c62828;
  border: 1px solid #ffcdd2;
}

/* ============================================================
   BRAND PRESETS / SHOPINGO LTR LAYER
   ============================================================ */
body.segma-preset-vetementhomme {
  direction: rtl;
}

body.segma-preset-shopingo {
  direction: ltr;
  --clr-primary: #2563eb;
  --clr-primary-dark: #1d4ed8;
  --clr-primary-light: #38bdf8;
  --clr-secondary: #1d4ed8;
  --clr-topbar: #0f172a;
  --clr-flash: #ef4444;
  --clr-price-new: #2563eb;
  --clr-price-good: #27ae60;
  --clr-badge-bg: #ef4444;
  --font-main: 'Inter', 'Segoe UI', Arial, sans-serif;
  --shadow-hover: 0 4px 16px rgba(37, 99, 235, 0.18);
  --shadow-primary-soft: rgba(37, 99, 235, 0.1);
  --shadow-primary-focus: rgba(37, 99, 235, 0.12);
  --shadow-primary-strong: rgba(37, 99, 235, 0.35);
  --shadow-primary-pulse: rgba(37, 99, 235, 0.65);
  --shadow-flash-soft: rgba(239, 68, 68, 0.1);
  --shadow-flash-focus: rgba(239, 68, 68, 0.12);
  background: #f8fafc;
}

body.segma-style-vetementhomme-orange {
  direction: rtl;
}

body.segma-style-shopingo-blue {
  direction: ltr;
}

body.segma-style-shopingo-yellow {
  direction: ltr;
  --clr-primary: #F6B800;
  --clr-primary-dark: #F28C00;
  --clr-primary-light: #FAB702;
  --clr-secondary: #F29900;
  --clr-topbar: #222222;
  --clr-flash: #E31D07;
  --clr-text: #1F1F1F;
  --clr-text-muted: #626262;
  --clr-price-new: #4CA51C;
  --clr-price-good: #53B01E;
  --clr-bg: #F5F5F5;
  --clr-white: #FFFFFF;
  --clr-card: #FFFFFF;
  --clr-border: #D8D6D6;
  --clr-badge-bg: #E31D07;
  --clr-badge-text: #FFFFFF;
  --shadow-hover: 0 4px 16px rgba(246, 184, 0, 0.22);
  --shadow-primary-soft: rgba(246, 184, 0, 0.1);
  --shadow-primary-focus: rgba(246, 184, 0, 0.18);
  --shadow-primary-strong: rgba(246, 184, 0, 0.35);
  --shadow-primary-pulse: rgba(246, 184, 0, 0.55);
  --shadow-flash-soft: rgba(227, 29, 7, 0.1);
  --shadow-flash-focus: rgba(227, 29, 7, 0.12);
  background: var(--clr-bg);
}

body.segma-preset-shopingo .section-title::after {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
}

.segma-breadcrumbs {
  font-size: 13px;
  color: var(--clr-text-muted);
  margin: 14px 0 18px;
}
.segma-breadcrumbs a { color: var(--clr-primary); }
.segma-breadcrumb-sep { margin: 0 8px; color: #b5b5b5; }

body.segma-preset-shopingo .segma-homepage-content {
  background: transparent;
}

body.segma-preset-shopingo .segma-homepage-content .elementor,
body.segma-preset-shopingo .segma-seo-block,
body.segma-preset-shopingo .archive-description {
  direction: ltr;
  text-align: start;
}

body.segma-preset-shopingo .archive-description--bottom,
body.segma-preset-shopingo .segma-seo-block {
  width: 100%;
  max-width: none;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding-block: 10px 22px;
  margin: 16px 0 24px;
  color: var(--clr-text-muted);
  font-size: 13px;
  line-height: 1.65;
  text-align: start;
}

body.segma-preset-shopingo .archive-description--bottom p,
body.segma-preset-shopingo .segma-seo-block p {
  margin: 0 0 8px;
  text-align: start;
}

body.segma-preset-shopingo .archive-description--bottom ul,
body.segma-preset-shopingo .archive-description--bottom ol,
body.segma-preset-shopingo .segma-seo-block ul,
body.segma-preset-shopingo .segma-seo-block ol {
  margin: 6px 0 10px;
  padding-inline-start: 20px;
  padding-inline-end: 0;
}

body.segma-preset-shopingo .archive-description--bottom li,
body.segma-preset-shopingo .segma-seo-block li {
  list-style: disc;
  margin-bottom: 4px;
}

body.segma-preset-shopingo .archive-description--bottom ol li,
body.segma-preset-shopingo .segma-seo-block ol li {
  list-style: decimal;
}

body.segma-preset-shopingo .archive-description--bottom h1,
body.segma-preset-shopingo .archive-description--bottom h2,
body.segma-preset-shopingo .archive-description--bottom h3,
body.segma-preset-shopingo .segma-seo-block h1,
body.segma-preset-shopingo .segma-seo-block h2,
body.segma-preset-shopingo .segma-seo-block h3 {
  color: var(--clr-text);
  margin-bottom: 8px;
  font-size: 18px;
}

body.segma-preset-shopingo .page-content ul,
body.segma-preset-shopingo .page-content ol {
  padding-right: 0;
  padding-left: 30px;
}

body.segma-preset-shopingo .segma-shopingo-home-header {
  padding-top: 28px;
}

body.segma-preset-shopingo .segma-home-product-section {
  padding-top: 18px;
  padding-bottom: 18px;
}

body.segma-preset-shopingo .subcategory-pills,
body.segma-preset-shopingo .subcat-pill {
  display: none;
}

.segma-infinite-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 34px;
  margin-top: 18px;
  color: var(--clr-text-muted);
  font-size: 13px;
  font-weight: 600;
}

.segma-infinite-status[hidden] {
  display: none;
}

.segma-infinite-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--shadow-primary-focus);
  border-top-color: var(--clr-primary);
  border-radius: 50%;
  animation: segma-spin 0.75s linear infinite;
}

.segma-infinite-sentinel {
  width: 100%;
  height: 1px;
}

@keyframes segma-spin {
  to {
    transform: rotate(360deg);
  }
}

.segma-blog-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
}

.segma-blog-card {
  background: #fff;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.segma-blog-card__body { padding: 18px; }
.segma-blog-card__title { font-size: 18px; margin: 0 0 10px; }
.segma-blog-card__title a { color: var(--clr-text); }

@media (max-width: 768px) {
  body.segma-preset-shopingo .segma-shopingo-home-header {
    padding-top: 18px;
  }

  body.segma-preset-shopingo .segma-home-product-section {
    padding-top: 10px;
    padding-bottom: 10px;
  }
}
