/*
Theme Name: DZStore - COD Theme
Theme URI: https://dzstore.dz
Author: DZStore Team
Author URI: https://dzstore.dz
Description: ثيم احترافي مخصص للبيع بالدفع عند الاستلام في السوق الجزائري - High Conversion COD Store
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: dzstore
Tags: woocommerce, e-commerce, responsive, mobile-first, cod, algeria
WC requires at least: 8.0
WC tested up to: 9.0
*/

/* ============================================
   DESIGN TOKENS — CSS VARIABLES
   ============================================ */
:root {
  /* Colors */
  --clr-white:       #FFFFFF;
  --clr-off-white:   #F8F9FA;
  --clr-light-gray:  #F0F2F5;
  --clr-mid-gray:    #E4E6EA;
  --clr-border:      #DDE1E7;
  --clr-text-muted:  #8A94A6;
  --clr-text-body:   #3D4451;
  --clr-text-head:   #1A1F2E;
  --clr-primary:     #1A6FFF;
  --clr-primary-dk:  #1558CC;
  --clr-primary-lt:  #EBF2FF;
  --clr-accent:      #FF4D2D;
  --clr-accent-dk:   #E03D20;
  --clr-success:     #22C55E;
  --clr-warning:     #F59E0B;
  --clr-overlay:     rgba(26, 31, 46, 0.55);

  /* Typography */
  --font-display:    'Cairo', 'Tajawal', sans-serif;
  --font-body:       'Tajawal', 'Cairo', sans-serif;
  --font-mono:       'Courier New', monospace;

  /* Spacing scale */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;

  /* Border radius */
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --radius-xl:  32px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:  0 4px 12px rgba(0,0,0,.10), 0 2px 6px rgba(0,0,0,.05);
  --shadow-lg:  0 10px 30px rgba(0,0,0,.12), 0 4px 12px rgba(0,0,0,.06);
  --shadow-xl:  0 20px 50px rgba(0,0,0,.15);
  --shadow-btn: 0 4px 14px rgba(26,111,255,.35);
  --shadow-cta: 0 6px 20px rgba(255,77,45,.40);

  /* Transitions */
  --ease-out:   cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in:    cubic-bezier(0.64, 0, 0.78, 0);
  --ease-io:    cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast:   150ms;
  --dur-base:   250ms;
  --dur-slow:   400ms;
  --dur-xslow:  600ms;

  /* Layout */
  --container-max: 1200px;
  --container-pad: clamp(16px, 4vw, 48px);
  --header-h:      64px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  direction: rtl;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--clr-text-body);
  background: var(--clr-white);
  overflow-x: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

ul, ol { list-style: none; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.25;
  color: var(--clr-text-head);
}

/* ============================================
   LAYOUT UTILITIES
   ============================================ */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.container--narrow { max-width: 800px; }
.container--wide   { max-width: 1400px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-6); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-6); }

.flex   { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-gap-2   { gap: var(--space-2); }
.flex-gap-4   { gap: var(--space-4); }

/* ============================================
   TYPOGRAPHY UTILITIES
   ============================================ */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-left   { text-align: left; }

.text-muted  { color: var(--clr-text-muted); }
.text-primary { color: var(--clr-primary); }
.text-accent  { color: var(--clr-accent); }

.section-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--clr-primary);
  background: var(--clr-primary-lt);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-4);
}

.section-title {
  font-size: clamp(1.6rem, 3.5vw, 2.5rem);
  font-weight: 800;
  color: var(--clr-text-head);
  margin-bottom: var(--space-3);
}

.section-sub {
  font-size: 1.05rem;
  color: var(--clr-text-muted);
  max-width: 560px;
  margin-inline: auto;
  margin-bottom: var(--space-10);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 14px 28px;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--dur-base) var(--ease-out);
  white-space: nowrap;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.12);
  opacity: 0;
  transition: opacity var(--dur-fast);
}
.btn:hover::before { opacity: 1; }
.btn:active { transform: scale(.97); }

/* Primary */
.btn-primary {
  background: var(--clr-primary);
  color: var(--clr-white);
  box-shadow: var(--shadow-btn);
}
.btn-primary:hover {
  background: var(--clr-primary-dk);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26,111,255,.45);
}

/* CTA — high contrast, accent */
.btn-cta {
  background: var(--clr-accent);
  color: var(--clr-white);
  box-shadow: var(--shadow-cta);
  font-size: 1.1rem;
  padding: 16px 36px;
  border-radius: var(--radius-lg);
  letter-spacing: .01em;
}
.btn-cta:hover {
  background: var(--clr-accent-dk);
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(255,77,45,.45);
}
.btn-cta.btn--xl {
  font-size: 1.25rem;
  padding: 20px 48px;
  border-radius: var(--radius-xl);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  border-color: var(--clr-border);
  color: var(--clr-text-body);
}
.btn-ghost:hover {
  border-color: var(--clr-primary);
  color: var(--clr-primary);
  background: var(--clr-primary-lt);
}

/* Icon button */
.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-md);
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--clr-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--clr-border);
  overflow: hidden;
  transition: box-shadow var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out);
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

/* ============================================
   BADGE
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: .78rem;
  font-weight: 700;
}
.badge--sale   { background: #FEF2F2; color: #DC2626; }
.badge--new    { background: #F0FDF4; color: #16A34A; }
.badge--hot    { background: #FFF7ED; color: #EA580C; }
.badge--free   { background: #F0F9FF; color: #0369A1; }

/* ============================================
   TRUST SIGNALS
   ============================================ */
.trust-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  padding: var(--space-4) 0;
  border-top: 1px solid var(--clr-border);
  border-bottom: 1px solid var(--clr-border);
  flex-wrap: wrap;
}
.trust-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: .9rem;
  font-weight: 600;
  color: var(--clr-text-body);
}
.trust-item svg { color: var(--clr-success); }

/* ============================================
   SECTION SPACING
   ============================================ */
.section { padding-block: var(--space-16); }
.section--sm { padding-block: var(--space-10); }
.section--lg { padding-block: var(--space-24); }
.section--gray { background: var(--clr-off-white); }
.section--light { background: var(--clr-light-gray); }

/* ============================================
   RESPONSIVE — Mobile First
   ============================================ */
@media (max-width: 768px) {
  :root { --header-h: 56px; }
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
  }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .section { padding-block: var(--space-10); }
  .trust-bar { gap: var(--space-4); }
}

@media (max-width: 480px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */
[data-animate] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--dur-xslow) var(--ease-out),
              transform var(--dur-xslow) var(--ease-out);
}
[data-animate].is-visible {
  opacity: 1;
  transform: translateY(0);
}
[data-animate-delay="1"] { transition-delay: 100ms; }
[data-animate-delay="2"] { transition-delay: 200ms; }
[data-animate-delay="3"] { transition-delay: 300ms; }
[data-animate-delay="4"] { transition-delay: 400ms; }

/* ============================================
   LOADING SKELETON
   ============================================ */
.skeleton {
  background: linear-gradient(90deg, var(--clr-light-gray) 25%, var(--clr-mid-gray) 50%, var(--clr-light-gray) 75%);
  background-size: 200% 100%;
  animation: skeleton-wave 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-wave {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
:focus-visible {
  outline: 3px solid var(--clr-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

/* ============================================
   PRINT
   ============================================ */
@media print {
  .site-header, .site-footer, .sticky-cta { display: none; }
  body { color: #000; background: #fff; }
}
