:root {
  --primary-color: #0F0F0F;
  --gold-color: #FFD700;
  --gold-light: #FFF3B0;
  --text-dark: #F0F0F0;
  --text-light: #A0A0A0;
  --bg-light: #1A1A1A;
  --bg-white: #121212;
  --border-color: #2A2A2A;
  --danger: #FF4C4C;
  --success: #4CAF50;
  --card-bg: #1E1E1E;
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  color: var(--text-dark);
  background-color: var(--bg-white);
  line-height: 1.5;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Utilities */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s;
  border: none;
}

.btn-primary {
  background-color: var(--gold-color);
  color: #000;
  font-weight: 700;
}

.btn-primary:hover {
  background-color: #e6c200;
}

.btn-gold {
  background-color: var(--gold-color);
  color: #000;
  font-weight: 700;
}

.btn-gold:hover {
  background-color: #e6c200;
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--gold-color);
  color: var(--gold-color);
}

.btn-outline:hover {
  background-color: var(--gold-color);
  color: #000;
}

/* Header */
.top-bar {
  background-color: var(--bg-light);
  font-size: 0.875rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

.top-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.metal-prices {
  display: flex;
  gap: 1.5rem;
}

.metal-prices span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.metal-prices .price-up {
  color: var(--success);
}

.metal-prices .price-down {
  color: var(--danger);
}

.header-main {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-white);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.header-main .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-dark);
}

.logo span {
  color: var(--gold-color);
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.main-nav {
  display: flex;
  gap: 2rem;
}

.main-nav a {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.875rem;
  color: var(--text-light);
  padding: 0.5rem 0;
  transition: color 0.3s;
}

.main-nav a:hover, .main-nav a.active {
  color: var(--gold-color);
  border-bottom: 2px solid var(--gold-color);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.header-actions .icon-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
}

.cart-icon {
  position: relative;
}

.cart-count {
  position: absolute;
  top: -8px;
  right: -12px;
  background-color: var(--gold-color);
  color: white;
  font-size: 0.75rem;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, #1A1A1A 0%, #0F0F0F 50%, #1a1200 100%);
  padding: 5rem 0;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

.hero h1 {
  font-size: 2.75rem;
  margin-bottom: 1rem;
  color: var(--text-dark);
  background: linear-gradient(90deg, #FFD700, #FFA500);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.125rem;
  color: var(--text-light);
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.stats-bar {
  background-color: #0a0a0a;
  color: var(--text-dark);
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

.stats-bar .container {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 1rem;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold-color);
}

.stat-label {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Products Section */
.products-section {
  padding: 4rem 0;
}

.section-title {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 2rem;
  color: var(--text-dark);
}

.product-tabs {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.tab-btn {
  background: none;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-light);
  padding: 0.5rem 1rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.3s;
}

.tab-btn.active, .tab-btn:hover {
  color: var(--gold-color);
  border-bottom-color: var(--gold-color);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 2rem;
}

.product-card {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  background-color: var(--card-bg);
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(255, 215, 0, 0.1);
  border-color: var(--gold-color);
}

.product-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background-color: var(--danger);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.product-image {
  margin-bottom: 1.5rem;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-image img {
  max-height: 100%;
}

.product-title {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

.product-price {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: var(--gold-color);
}

.product-old-price {
  font-size: 0.875rem;
  color: var(--text-light);
  text-decoration: line-through;
  margin-bottom: 1rem;
}

.product-card .btn {
  margin-top: auto;
  width: 100%;
}

/* Category Page layout */
.category-page {
  padding: 2rem 0;
}

.breadcrumb {
  display: flex;
  gap: 0.5rem;
  font-size: 0.875rem;
  margin-bottom: 2rem;
  color: var(--text-light);
}

.breadcrumb a:hover {
  color: var(--primary-color);
}

.category-layout {
  display: flex;
  gap: 2rem;
}

.sidebar {
  width: 250px;
  flex-shrink: 0;
}

.filter-group {
  margin-bottom: 2rem;
}

.filter-title {
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.filter-list li {
  margin-bottom: 0.5rem;
}

.filter-list label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
}

.category-content {
  flex-grow: 1;
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

/* Footer */
.footer {
  background-color: #0a0a0a;
  color: white;
  padding: 4rem 0 2rem;
  margin-top: 4rem;
  border-top: 1px solid var(--border-color);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.footer-col h4 {
  font-size: 1.125rem;
  margin-bottom: 1.5rem;
  color: var(--gold-color);
}

.footer-col ul li {
  margin-bottom: 0.75rem;
}

.footer-col a {
  color: #ccc;
  transition: color 0.3s;
}

.footer-col a:hover {
  color: white;
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  color: #aaa;
  font-size: 0.875rem;
}

/* ===========================
   RTL (Arabic) Support
   =========================== */

[dir="rtl"] body {
  font-family: 'Noto Kufi Arabic', 'Inter', -apple-system, sans-serif;
}

[dir="rtl"] .header-main .container {
  flex-direction: row-reverse;
}

[dir="rtl"] .main-nav {
  flex-direction: row-reverse;
}

[dir="rtl"] .header-actions {
  flex-direction: row-reverse;
}

[dir="rtl"] .top-bar .container {
  flex-direction: row-reverse;
}

[dir="rtl"] .metal-prices {
  flex-direction: row-reverse;
}

[dir="rtl"] .product-badge {
  left: auto;
  right: 1rem;
}

[dir="rtl"] .category-layout {
  flex-direction: row-reverse;
}

[dir="rtl"] .footer-grid {
  direction: rtl;
}

[dir="rtl"] .hero h1,
[dir="rtl"] .hero p,
[dir="rtl"] .section-title {
  direction: rtl;
}

[dir="rtl"] .breadcrumb {
  flex-direction: row-reverse;
}

[dir="rtl"] .category-header {
  flex-direction: row-reverse;
}

[dir="rtl"] .footer-bottom {
  direction: rtl;
}

[dir="rtl"] .stats-bar .container {
  flex-direction: row-reverse;
}

/* ===========================
   Language Selector (inline in header)
   =========================== */

.lang-selector {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #A0A0A0;
  text-decoration: none;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
  letter-spacing: 1px;
  border: 1px solid transparent;
}

.lang-btn:hover {
  color: #FFD700;
  background: rgba(255, 215, 0, 0.15);
  border-color: rgba(255, 215, 0, 0.4);
}

.lang-btn.active {
  color: #000;
  background: #FFD700;
  border: 1px solid #FFD700;
}

/* Responsive */
@media (max-width: 768px) {
  .top-bar {
    display: none;
  }
  
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--bg-white);
    flex-direction: column;
    padding: 1rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    gap: 1rem;
    border-bottom: 1px solid var(--border-color);
  }
  
  .main-nav.active {
    display: flex;
  }
  
  .mobile-menu-btn {
    display: block;
  }
  
  .category-layout {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
  }
}
