/* ==========================================
   معرض روز وود للأثاث - التنسيق الرئيسي
   طابع فاخر / كلاسيك: ذهبي + بني غامق
   ========================================== */

:root {
  --gold: #C9A96E;
  --gold-dark: #a9884f;
  --brown-dark: #2b1d14;
  --brown-darker: #1c1209;
  --cream: #faf7f2;
  --text-dark: #2b2016;
  --text-light: #6f6357;
  --border-light: #e8e0d4;
  --white: #ffffff;
  --danger: #c0392b;
  --success: #27ae60;
  --radius: 6px;
  --shadow: 0 4px 20px rgba(43,29,20,.08);
  --font-heading: 'Playfair Display', serif;
  --font-body: 'Cairo', sans-serif;

  --bg: var(--cream);
  --surface: var(--white);
  --text: var(--text-dark);
  --text-muted: var(--text-light);
  --border: var(--border-light);
}

[data-theme="dark"] {
  --bg: #17110b;
  --surface: #221a12;
  --text: #f2ece2;
  --text-muted: #b8ab9a;
  --border: #3a2c1e;
  --cream: #17110b;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background .2s, color .2s;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.section { padding: 70px 0; }
.section-sm { padding: 36px 0; }

.section-header { text-align: center; margin-bottom: 40px; }
.section-header h2 {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
}
.divider {
  width: 60px; height: 3px; background: var(--gold);
  margin: 14px auto 0;
}

/* ===== شريط الإعلانات ===== */
.announcement-bar {
  background: var(--brown-dark);
  color: var(--gold);
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  letter-spacing: .3px;
}

/* ===== الهيدر ===== */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  max-width: 1280px; margin: 0 auto; padding: 16px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.logo {
  font-family: var(--font-heading);
  font-size: 26px; font-weight: 700; color: var(--text);
  white-space: nowrap;
}
.logo span { color: var(--gold); }

.nav ul { display: flex; gap: 28px; }
.nav a {
  font-size: 14px; font-weight: 600; color: var(--text);
  position: relative; padding: 4px 0;
}
.nav a:hover { color: var(--gold); }

.header-icons { display: flex; align-items: center; gap: 18px; font-size: 17px; }
.header-icons a, .theme-toggle { color: var(--text); position: relative; }
.header-icons a:hover, .theme-toggle:hover { color: var(--gold); }
.wa-icon { color: #25D366 !important; }
.menu-toggle { display: none; font-size: 20px; color: var(--text); }

.theme-toggle .theme-icon-light { display: none; }
[data-theme="dark"] .theme-toggle .theme-icon-dark { display: none; }
[data-theme="dark"] .theme-toggle .theme-icon-light { display: inline; }

/* ===== قائمة الموبايل ===== */
.overlay-bg {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 199;
}
.overlay-bg.open { display: block; }
.mobile-nav {
  position: fixed; top: 0; right: -320px; width: 300px; height: 100%;
  background: var(--surface); z-index: 200; padding: 24px;
  transition: right .25s ease; overflow-y: auto;
}
.mobile-nav.open { right: 0; }
.mobile-nav-close { font-size: 20px; margin-bottom: 20px; color: var(--text); }
.mobile-nav a, .mobile-nav button {
  display: block; padding: 12px 0; border-bottom: 1px solid var(--border);
  font-weight: 600; color: var(--text); width: 100%; text-align: right;
}

/* ===== نافذة البحث ===== */
.search-overlay {
  display: none; position: fixed; inset: 0; background: rgba(23,17,11,.96);
  z-index: 300; align-items: center; justify-content: center;
}
.search-overlay.open { display: flex; }
.search-close { position: absolute; top: 30px; left: 30px; font-size: 26px; color: #fff; }
.search-box-wrap { width: 90%; max-width: 600px; }
.search-input {
  width: 100%; background: transparent; border: none; border-bottom: 2px solid var(--gold);
  color: #fff; font-size: 26px; padding: 12px 4px; text-align: center;
}
.search-input:focus { outline: none; }
.search-input::placeholder { color: rgba(255,255,255,.5); }

/* ===== البانر الرئيسي (Hero) ===== */
.hero { position: relative; height: 70vh; min-height: 420px; overflow: hidden; }
.hero-img { width: 100%; height: 100%; object-fit: cover; }
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(23,17,11,.72) 0%, rgba(23,17,11,.35) 60%, rgba(23,17,11,.15) 100%);
  display: flex; align-items: center;
}
.hero-content { max-width: 1280px; margin: 0 auto; padding: 0 24px; width: 100%; color: #fff; }
.hero-eyebrow { color: var(--gold); font-weight: 700; letter-spacing: 2px; margin-bottom: 14px; }
.hero-title {
  font-family: var(--font-heading); font-size: 48px; font-weight: 700;
  max-width: 560px; margin-bottom: 16px;
}
.hero-sub { max-width: 480px; margin-bottom: 28px; font-size: 16px; opacity: .9; }

.btn-primary {
  display: inline-block; background: var(--gold); color: var(--brown-darker);
  padding: 14px 34px; border-radius: var(--radius); font-weight: 700;
  font-size: 14px; letter-spacing: .5px; transition: background .2s;
}
.btn-primary:hover { background: var(--gold-dark); }

/* ===== شبكة التصنيفات ===== */
.collections-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px;
}
.collection-card { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 3/4; }
.collection-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.collection-card:hover img { transform: scale(1.06); }
.collection-card-overlay {
  position: absolute; inset: 0; background: linear-gradient(to top, rgba(23,17,11,.75), transparent 55%);
  display: flex; align-items: flex-end; padding: 18px; color: #fff;
}
.collection-card-overlay h3 { font-family: var(--font-heading); font-size: 18px; }

/* ===== البانر الوسطي ===== */
.middle-banner { position: relative; height: 340px; overflow: hidden; }
.middle-banner img { width: 100%; height: 100%; object-fit: cover; }
.middle-banner-overlay {
  position: absolute; inset: 0; background: rgba(23,17,11,.55);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; color: #fff; padding: 20px; gap: 14px;
}
.middle-banner-overlay h2 { font-family: var(--font-heading); font-size: 30px; }
.middle-banner-overlay p { max-width: 480px; opacity: .9; }

/* ===== شبكة المنتجات ===== */
.products-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
}
.product-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: box-shadow .2s, transform .2s;
}
.product-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.product-image-wrap { position: relative; aspect-ratio: 1/1; overflow: hidden; background: #f1ece3; }
.product-image-wrap img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .3s;
}
.product-img-2 { opacity: 0; }
.product-card:hover .product-img-2 { opacity: 1; }
.product-card:hover .product-img-1 { opacity: 0; }

.badge {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 3px; color: #fff;
}
.badge.new { background: var(--gold-dark); }
.badge.sale { background: var(--danger); }

.sold-out-overlay {
  position: absolute; inset: 0; background: rgba(23,17,11,.55); z-index: 3;
  display: flex; align-items: center; justify-content: center;
}
.sold-out-overlay span {
  background: #fff; color: var(--brown-dark); padding: 6px 16px; border-radius: 3px; font-weight: 700; font-size: 13px;
}

.product-info { padding: 16px; }
.product-name { font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.product-specs { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; line-height: 1.9; }
.product-prices { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.price-current { font-weight: 700; color: var(--gold-dark); font-size: 16px; }
.price-old { text-decoration: line-through; color: var(--text-muted); font-size: 13px; }

.btn-whatsapp {
  width: 100%; background: var(--brown-dark); color: #fff; padding: 10px; border-radius: var(--radius);
  font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .2s;
}
.btn-whatsapp:hover { background: #25D366; }

/* ===== صفحة المنتج ===== */
.product-page { padding: 50px 0; }
.product-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; }
.product-gallery-main {
  aspect-ratio: 1/1; border-radius: var(--radius); overflow: hidden; background: #f1ece3; margin-bottom: 12px;
}
.product-gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.product-gallery-thumbs { display: flex; gap: 10px; }
.product-gallery-thumbs img {
  width: 80px; height: 80px; object-fit: cover; border-radius: 4px; cursor: pointer;
  border: 2px solid transparent; opacity: .7;
}
.product-gallery-thumbs img.active { border-color: var(--gold); opacity: 1; }

.product-detail-title { font-family: var(--font-heading); font-size: 32px; margin-bottom: 10px; }
.product-detail-prices { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.product-detail-prices .price-current { font-size: 26px; }
.product-detail-desc { color: var(--text-muted); margin-bottom: 24px; line-height: 1.9; }

.spec-table { width: 100%; border-collapse: collapse; margin-bottom: 26px; }
.spec-table td { padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.spec-table td:first-child { color: var(--text-muted); width: 130px; font-weight: 600; }

.btn-whatsapp-lg {
  display: inline-flex; align-items: center; gap: 10px; background: #25D366; color: #fff;
  padding: 14px 30px; border-radius: var(--radius); font-weight: 700; font-size: 15px;
}
.btn-whatsapp-lg:hover { background: #1ea952; }

/* ===== شريط المميزات ===== */
.features-bar { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.features-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.feature-item { display: flex; align-items: center; gap: 14px; }
.feature-icon {
  width: 46px; height: 46px; border-radius: 50%; background: rgba(201,169,110,.15);
  color: var(--gold-dark); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0;
}
.feature-text h4 { font-size: 14px; margin-bottom: 2px; }
.feature-text p { font-size: 12px; color: var(--text-muted); }

/* ===== الفوتر ===== */
.footer { background: var(--brown-darker); color: #d8cdbc; }
.footer-grid {
  max-width: 1280px; margin: 0 auto; padding: 60px 24px 30px;
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 40px;
}
.footer-brand .logo { color: #fff; }
.footer-brand p { font-size: 13px; line-height: 1.8; margin-top: 14px; color: rgba(255,255,255,.65); }
.footer-social { display: flex; gap: 10px; margin-top: 18px; }
.social-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center; color: #fff; transition: background .2s;
}
.social-btn:hover { background: var(--gold); border-color: var(--gold); color: var(--brown-darker); }

.footer-col h4 { color: #fff; font-size: 15px; margin-bottom: 18px; font-family: var(--font-heading); }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a { font-size: 13px; color: rgba(255,255,255,.65); }
.footer-col ul li a:hover { color: var(--gold); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1); padding: 20px 0; text-align: center;
  font-size: 12px; color: rgba(255,255,255,.5);
}

/* ===== صفحة "من نحن" ===== */
.about-page { padding: 60px 0; max-width: 860px; margin: 0 auto; }
.about-page h1 { font-family: var(--font-heading); font-size: 36px; margin-bottom: 20px; }
.about-page p { color: var(--text-muted); margin-bottom: 16px; line-height: 1.9; }

/* ===== فلاتر صفحة الكولكشن ===== */
.collection-header { padding: 40px 0 20px; text-align: center; }
.collection-header h1 { font-family: var(--font-heading); font-size: 34px; }
.filters-bar {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
  padding: 20px 0; border-bottom: 1px solid var(--border); margin-bottom: 30px;
}
.filters-left { display: flex; flex-wrap: wrap; gap: 10px; }
.filter-chip {
  padding: 8px 16px; border: 1px solid var(--border); border-radius: 20px; font-size: 13px; font-weight: 600;
  color: var(--text); transition: all .2s;
}
.filter-chip.active, .filter-chip:hover { background: var(--gold); border-color: var(--gold); color: var(--brown-darker); }
.sort-select {
  padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); font-family: inherit; font-size: 13px;
}
.empty-state { text-align: center; padding: 80px 20px; color: var(--text-muted); }

/* ===== نماذج عامة ===== */
.form-control {
  width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: var(--radius);
  font-family: inherit; font-size: 14px; background: var(--surface); color: var(--text);
}
.form-control:focus { outline: none; border-color: var(--gold); }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 700; color: var(--text); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ==========================================
   لوحة التحكم (Admin)
   ========================================== */
.admin-body { background: #f4f1ec; color: var(--text-dark); font-family: var(--font-body); }

.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--brown-darker);
}
.login-box {
  background: #fff; padding: 46px 40px; border-radius: 10px; width: 100%; max-width: 380px;
  box-shadow: 0 10px 40px rgba(0,0,0,.3); text-align: center;
}
.login-logo { font-family: var(--font-heading); font-size: 28px; font-weight: 700; margin-bottom: 6px; }
.login-logo span { color: var(--gold); }
.login-sub { color: #888; font-size: 13px; margin-bottom: 26px; }
.btn-login {
  width: 100%; background: var(--brown-dark); color: #fff; padding: 13px; border-radius: var(--radius);
  font-weight: 700; font-size: 15px; margin-top: 6px;
}
.btn-login:hover { background: var(--gold); color: var(--brown-darker); }

.admin-sidebar {
  position: fixed; right: 0; top: 0; bottom: 0; width: 240px; background: var(--brown-darker);
  color: #fff; padding: 24px 0; display: flex; flex-direction: column; overflow-y: auto;
}
.admin-logo { padding: 0 24px 24px; border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: 14px; }
.admin-logo h2 { font-family: var(--font-heading); font-size: 20px; }
.admin-logo h2 { color: #fff; }
.admin-logo p { color: var(--gold); font-size: 12px; margin-top: 4px; }
.admin-nav { display: flex; flex-direction: column; flex: 1; }
.admin-nav a {
  padding: 13px 24px; color: rgba(255,255,255,.75); font-size: 14px; font-weight: 600;
  display: flex; align-items: center; gap: 10px; transition: background .15s;
}
.admin-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.admin-nav a.active { background: var(--gold); color: var(--brown-darker); }

.admin-content { margin-right: 240px; padding: 30px 34px; max-width: 1100px; }
.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.admin-header h1 { font-family: var(--font-heading); font-size: 26px; }

.alert { padding: 14px 18px; border-radius: var(--radius); margin-bottom: 20px; font-size: 14px; font-weight: 600; }
.alert-success { background: #e5f7ec; color: #1e7e42; border: 1px solid #b6e6c8; }
.alert-error { background: #fdecea; color: #a92417; border: 1px solid #f3c1bb; }

.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 26px; }
.stat-card {
  background: #fff; border-radius: var(--radius); padding: 20px; border-right: 4px solid var(--gold);
  box-shadow: var(--shadow);
}
.stat-card h3 { font-size: 28px; font-family: var(--font-heading); margin-bottom: 4px; }
.stat-card p { font-size: 13px; color: #888; }

.admin-card { background: #fff; border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.admin-card h3 { font-size: 17px; margin-bottom: 18px; }
.admin-card h4 { font-size: 15px; }

.admin-card-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px;
}
.btn-add {
  background: var(--gold); color: var(--brown-darker); padding: 10px 20px; border-radius: var(--radius);
  font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; gap: 8px;
}
.btn-add:hover { background: var(--gold-dark); }
.btn-save {
  background: var(--brown-dark); color: #fff; padding: 12px 30px; border-radius: var(--radius);
  font-weight: 700; font-size: 14px; margin-top: 6px;
}
.btn-save:hover { background: var(--gold); color: var(--brown-darker); }

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
  text-align: right; font-size: 12px; color: #999; text-transform: uppercase;
  padding: 10px 8px; border-bottom: 2px solid #eee;
}
.admin-table td { padding: 10px 8px; border-bottom: 1px solid #f0f0f0; font-size: 14px; vertical-align: middle; }
.admin-table img { width: 46px; height: 46px; object-fit: cover; border-radius: 4px; }
.table-actions { display: flex; gap: 8px; }
.btn-icon {
  width: 32px; height: 32px; border-radius: 4px; display: flex; align-items: center; justify-content: center;
  font-size: 13px; background: #f2f2f2; color: #555;
}
.btn-icon.edit:hover { background: var(--gold); color: #fff; }
.btn-icon.delete:hover { background: var(--danger); color: #fff; }

.status-pill { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 12px; }
.status-pill.in { background: #e5f7ec; color: #1e7e42; }
.status-pill.out { background: #fdecea; color: #a92417; }

.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(23,17,11,.55); z-index: 500;
  align-items: flex-start; justify-content: center; overflow-y: auto; padding: 40px 20px;
}
.modal-overlay.open { display: flex; }
.modal-box { background: #fff; border-radius: 8px; padding: 30px; width: 100%; max-width: 640px; }
.modal-box h3 { margin-bottom: 20px; font-size: 18px; }
.modal-close-row { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; }
.btn-cancel { padding: 11px 22px; border-radius: var(--radius); background: #eee; color: #555; font-weight: 600; }

.checkbox-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.checkbox-row input { width: 17px; height: 17px; accent-color: var(--gold-dark); }

/* ===== ريسبونسف ===== */
@media (max-width: 1024px) {
  .collections-grid { grid-template-columns: repeat(3, 1fr); }
  .products-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .admin-sidebar { width: 210px; }
  .admin-content { margin-right: 210px; }
}
@media (max-width: 768px) {
  .nav { display: none; }
  .menu-toggle { display: block; }
  .collections-grid { grid-template-columns: repeat(2, 1fr); }
  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; padding: 40px 20px 20px; }
  .hero-title { font-size: 32px; }
  .product-detail-grid { grid-template-columns: 1fr; gap: 26px; }
  .form-row { grid-template-columns: 1fr; }
  .stat-cards { grid-template-columns: 1fr 1fr; }
  .admin-sidebar {
    position: static; width: 100%; flex-direction: row; overflow-x: auto; padding: 10px 14px;
  }
  .admin-logo { display: none; }
  .admin-nav { flex-direction: row; }
  .admin-nav a { white-space: nowrap; padding: 10px 14px; }
  .admin-content { margin-right: 0; padding: 20px; }
}
