:root{
  --bg:#f7f1e8;
  --paper:#fffaf3;
  --ink:#4b2e22;
  --ink-2:#6a4635;
  --accent:#a87449;
  --chip:#fff5e6;
  --shadow: 0 6px 24px rgba(0,0,0,.08);
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0; font-family: 'Tahoma', 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
  background:var(--bg); color:var(--ink);
  line-height:1.7;
}

.container{max-width:1100px; padding:0 16px; margin:0 auto}

.topbar{
  background:#fff; box-shadow:var(--shadow); position:sticky; top:0; z-index:50;
}
.topbar .wrap{display:flex; align-items:center; gap:12px; padding:10px 0}


.brand{
  background: url('assets/wood-bg.svg') center/cover no-repeat; text-align:center;
  padding:16px 16px;
  position:relative;
}
.brand::after{
  content:""; position:absolute; inset:0; background:linear-gradient(transparent, rgba(0,0,0,.08));
}
.brand .inner{position:relative; z-index:1}
.brand h1{
  margin:10px 0 0; font-size:44px; letter-spacing:1px; color:var(--ink);
}
.brand img{height:64px; vertical-align:middle}

.section-title{
  font-size:28px; margin:30px 0 10px; color:var(--ink-2);
}
.grid{
  display:grid; gap:16px;
  grid-template-columns: repeat( auto-fit, minmax(220px, 1fr) );
}
.card{
  background:var(--paper); border:1px solid #eadfcc; border-radius:18px; padding:16px;
  box-shadow: var(--shadow);
  display:flex; flex-direction:column; align-items:flex-start; justify-content:space-between;
  transition:.2s transform ease, .2s box-shadow ease;
}
.card:hover{ transform:translateY(-4px); box-shadow:0 10px 28px rgba(0,0,0,.12)}
.card .title{font-weight:700; font-size:18px; margin:6px 0 12px}
.card .thumb{
  height:120px; width:100%; border-radius:12px; background:linear-gradient(135deg,#e6d1b9,#f6e8d6);
  border:1px dashed #d7bea1;
}

.badge{
  background:var(--chip); border:1px solid #f1dfc6; padding:6px 10px; border-radius:999px; font-size:12px
}

footer{
  margin-top:40px; background:#fff; border-top:1px solid #eadfcc
}
footer .wrap{display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px; padding:18px 0}
footer a{
  display:inline-flex; align-items:center; gap:8px; text-decoration:none; color:var(--ink-2);
  padding:8px 12px; border-radius:10px; background:var(--chip); border:1px solid #f1dfc6
}
footer svg{width:18px; height:18px}
.small{font-size:12px; opacity:.7}

/* ================== Product Page Styles ================== */
.product-page {
  background: var(--bg);
}

.product-card {
  background: var(--paper);
  border: 1px solid #eadfcc;
  border-radius: 20px;
  padding: 24px;
  margin-top: 24px;
  box-shadow: var(--shadow);
}

.product-card .grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.product-card .hero {
  width: 100%;
height: 900px;

  border-radius: 16px;
  border: 1px dashed #d7bea1;
  background: linear-gradient(135deg,#e6d1b9,#f6e8d6);
  margin: 0 auto;
  cursor: pointer;
}


.product-card .thumbs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.product-card .thumbs img {
  width: 88px;
  height: 100px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #eadfcc;
  cursor: pointer;
  transition: .2s transform;
}
.product-card .thumbs img:hover {
  transform: scale(1.05);
  border-color: var(--accent);
}

.product-card h2 {
  margin: 0 0 12px;
  font-size: 26px;
  color: var(--ink-2);
}
.product-card .price {
  font-weight: bold;
  font-size: 20px;
  margin-top: 10px;
  color: var(--accent);
}
.product-card .desc {
  margin-top: 14px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.8;
}

/* === Override default hyperlink styles === */
a {
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 500;
}
a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* === Unified Buttons & Links Style === */
a, button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--ink-2);
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--chip);
  border: 1px solid #f1dfc6;
  font-weight: 500;
  cursor: pointer;
  transition: 0.2s background ease, 0.2s color ease;
}
a:hover, button:hover {
  background: var(--accent);
  color: #fff;
}

/* === Unified Form Fields Style === */
input[type="text"], input[type="search"], input[type="email"], input[type="number"],
input[type="password"], textarea, select {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #f1dfc6;
  background: #fffaf3;
  font-size: 15px;
  color: var(--ink);
  outline: none;
  transition: 0.2s border ease, 0.2s box-shadow ease;
}
input[type="text"]:focus, input[type="search"]:focus, input[type="email"]:focus,
input[type="number"]:focus, input[type="password"]:focus, textarea:focus, select:focus {
  border: 1px solid var(--accent);
  box-shadow: 0 0 0 3px rgba(168, 116, 73, 0.25);
}

/* Slideshow styles */
.slideshow {
  position: relative;
  width: 300px;
  height: 300px;
  margin: 0 auto 15px;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.slideshow img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}
.slideshow img.active {
  opacity: 1;
}


/* زر القائمة */
.menu-toggle {
  font-size: 26px;
  cursor: pointer;
  position: absolute;
  right: 10px;
  top: 10px;
  color: #333;
}

/* القائمة الجانبية */
.sidebar {
  height: 100%;
  width: 0;
  position: fixed;
  top: 0;
  right: 0;
  background-color: #fff;
  overflow-x: hidden;
  transition: 0.3s;
  padding-top: 60px;
  box-shadow: -2px 0 5px rgba(0,0,0,0.2);
  z-index: 1000;
}

/* عند فتح القائمة */
.sidebar.open {
  width: 250px;
}

.sidebar a {
  display: block;
  padding: 12px 24px;
  font-size: 18px;
  color: var(--ink);
  background: var(--bg);
  margin-bottom: 10px;
  border-radius: 8px;
  border: 1px solid #eadfcc;
  transition: background 0.2s, color 0.2s;
}

.sidebar a:hover {
  background: var(--accent);
  color: #fff;
}

.sidebar .closebtn {
  font-size: 30px;
  position: absolute;
  top: 10px;
  left: 10px;
}

/* المودال */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  inset: 0;
  background-color: rgba(0,0,0,0.5);
}

.modal-content {
  background-color: #fff;
  margin: 10% auto;
  padding: 20px;
  border-radius: 8px;
  width: 80%;
  max-width: 600px;
}

.close {
  float: left;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

/* الخلفية عند فتح القائمة */
#overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 900;
}

/* الأيقونات في الفوتر */
.social-icon {
  width: 22px;
  height: 22px;
  fill: currentColor;
  transition: transform 0.2s ease, color 0.2s ease;
}

.social-icon:hover {
  transform: scale(1.2);
  color: var(--accent);
}

/* تعديل خاص لعرض المودال بنصف الشاشة */
.modal-content.half-width {
  width: 90%;
  max-width:none;
  margin: 5% auto;
}
.card .thumb {
  width: 100%;
  height: 400px;
  border-radius: 12px;
  border: 1px dashed #d7bea1;
  background: linear-gradient(135deg,#e6d1b9,#f6e8d6);
  margin-bottom: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card .thumb img {
  width: 120%;
  height: 120%;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}
/* ================= RESPONSIVE LAYOUT ================= */

/* المنتجات كشبكة مرنة */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

/* جعل الفورم متجاوب */
.topbar form {
  flex-wrap: wrap;
}
.topbar input[type="search"] {
  flex: 1;
  min-width: 150px;
}
.topbar button {
  flex-shrink: 0;
}

/* الأجهزة اللوحية (من 768px إلى 1024px) */
@media (max-width: 1024px) {
  .container {
    padding: 0 15px;
  }

  .topbar {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .topbar form {
    width: 100%;
    justify-content: center;
  }
}

/* الموبايل (أصغر من 768px) */
@media (max-width: 768px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .topbar img {
    margin: 10px auto;
  }

  .topbar form {
    flex-direction: column;
  }

  .topbar input[type="search"],
  .topbar button {
    width: 100%;
  }
}
/* تصميم الشريط العلوي */
.topbar {
  background: #fff;
  border-bottom: 1px solid #ddd;
  padding: 10px 15px;
}

.topbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

/* اللوجو في الوسط */
.logo-center img {
  height: 45px;
  display: block;
  margin: 0 auto;
}

/* البحث متجاوب */
.search-form {
  display: flex;
  gap: 10px;
  flex: 1;
}
.search-form input[type="search"] {
  flex: 1;
  min-width: 150px;
  padding: 6px 10px;
}
.search-form button {
  background: #a87449;
  color: #fff;
  border: none;
  padding: 6px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.3s;
}
.search-form button:hover {
  opacity: 0.85;
}

/* للشاشات الصغيرة (موبايل) */
@media (max-width: 768px) {
  .topbar .container {
    flex-direction: column;
    align-items: stretch;
  }
  .logo-center {
    order: -1; /* يظهر فوق */
    text-align: center;
    margin-bottom: 10px;
  }
  .search-form {
    flex-direction: column;
    width: 100%;
  }
  .search-form input,
  .search-form button {
    width: 100%;
  }
}
.modal-content.scrollable {
  max-height: 80vh;       /* ما يتعدى 80% من ارتفاع الشاشة */
  overflow-y: auto;       /* يضيف سكرول عمودي */
  padding-right: 16px;    /* عشان ما يلزق النص بالسكرول */
}
.product-card .gallery {
  width: 100%;
}

.product-card .hero {
  width: 100%;
  height: 300px; /* موبايل */
  object-fit: cover;
  border-radius: 16px;
  border: 1px dashed #d7bea1;
  background: linear-gradient(135deg,#e6d1b9,#f6e8d6);
}

/* تابلت */
@media (min-width: 768px) {
  .product-card .hero {
    height: 500px;
  }
}

/* PC */
@media (min-width: 1024px) {
  .product-card .hero {
    height: 600px;
  }
}
/* Popup الصورة */
.img-modal {
  display: none;
  position: fixed;
  z-index: 3000;
  padding-top: 60px;
  left: 0;
  top: 0;
  width: 100%;
  height: 120%;
  overflow: auto;
  background-color: rgba(0,0,0,0.85);
}

.img-modal-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.6);
}

.close-img {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
}
.close-img:hover {
  color: var(--accent);
}



/* ================== Product Page Styles ================== */
.product-page{background:var(--bg)}

.product-card{
    background:var(--paper); border:1px solid #eadfcc; border-radius:20px;
    padding:24px; margin-top:24px; box-shadow:var(--shadow);
    display:flex; flex-direction:column; gap:20px;
}

.product-card h2{margin:0 0 12px; font-size:26px; color:var(--ink-2)}
.product-card .price{font-weight:bold; font-size:20px; margin-top:10px; color:var(--accent)}
.product-card .desc{margin-top:14px; color:var(--ink); font-size:15px; line-height:1.8}

/* الصورة الرئيسية */
.product-card .hero{
    display:block;
    width:100%;
    max-width:800px; /* حجم مناسب للـ PC */
    height:auto;
    margin:0 auto 16px;
    border-radius:16px;
    border:1px dashed #d7bea1;
    background:#f7f1e8;
    cursor:pointer;
    object-fit:contain;
}

/* الصور المصغرة */
.product-card .thumbs{display:flex; gap:10px; flex-wrap:wrap; margin-top:12px; justify-content:center}
.product-card .thumbs img{
    width:88px; height:88px; object-fit:cover; border-radius:12px;
    border:1px solid #eadfcc; cursor:pointer; transition:.2s transform;
}
.product-card .thumbs img:hover{transform:scale(1.05); border-color:var(--accent)}

/* على الموبايل */
@media (max-width:768px){
    .product-card .hero{max-width:100%}
}

/* Popup Lightbox */
.image-popup{
    display:none; position:fixed; inset:0;
    background:rgba(0,0,0,0.85); z-index:5000;
    justify-content:center; align-items:center;
}
.image-popup img{
    max-width:95%; max-height:95%;
    border-radius:12px; box-shadow:0 8px 32px rgba(0,0,0,.4);
}
.image-popup .close{
    position:absolute; top:20px; right:30px;
    font-size:36px; color:#fff; cursor:pointer;
}
