/* ============================================================
   Palestinian Crafts — Warm & Traditional theme
   ============================================================ */

:root {
  --cream: #f7f0e4;
  --cream-2: #efe4d1;
  --sand: #e3d3b8;
  --terracotta: #b85c38;
  --terracotta-dark: #9c4a2c;
  --olive: #6b7a3f;
  --olive-dark: #55622f;
  --red: #8e2f2f;
  --deep: #3a2e24;
  --muted: #7a6a58;
  --card: #fffdf8;
  --line: rgba(122, 106, 88, 0.22);

  --font-heading: "Playfair Display", "Amiri", serif;
  --font-body: "Inter", "Tajawal", sans-serif;

  --radius: 16px;
  --shadow-sm: 0 2px 10px rgba(58, 46, 36, 0.08);
  --shadow-md: 0 12px 30px rgba(58, 46, 36, 0.14);
  --shadow-lg: 0 24px 60px rgba(58, 46, 36, 0.22);
}

[dir="rtl"] {
  --font-heading: "Amiri", "Playfair Display", serif;
  --font-body: "Tajawal", "Inter", sans-serif;
}

/* ---------- Reset & base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--deep);
  background: var(--cream);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

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

.container {
  width: min(1120px, 92%);
  margin-inline: auto;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 700;
  margin: 0 0 0.4rem;
  color: var(--deep);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.8rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--terracotta);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--terracotta-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  background: transparent;
  color: var(--olive-dark);
  border-color: var(--olive);
}

.btn-ghost:hover {
  background: var(--olive);
  color: #fff;
  transform: translateY(-2px);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 240, 228, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.brand-mark {
  font-size: 1.6rem;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
}

.brand-sub {
  font-size: 0.78rem;
  color: var(--muted);
}

.site-nav {
  display: flex;
  gap: 1.5rem;
  font-weight: 500;
}

.site-nav a {
  position: relative;
  color: var(--deep);
  padding-block: 0.25rem;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--terracotta);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.25s ease;
}

.site-nav a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

[dir="rtl"] .site-nav a::after {
  transform-origin: left;
}

[dir="rtl"] .site-nav a:hover::after {
  transform-origin: right;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.lang-toggle:hover {
  border-color: var(--terracotta);
  box-shadow: var(--shadow-sm);
}

.lang-option {
  color: var(--muted);
  font-weight: 500;
}

.lang-option.is-active {
  color: var(--terracotta-dark);
  font-weight: 700;
}

.lang-sep {
  color: var(--muted);
  opacity: 0.6;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(4rem, 9vw, 7rem);
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(184, 92, 56, 0.18), transparent 60%),
    radial-gradient(900px 420px at 10% 110%, rgba(107, 122, 63, 0.18), transparent 55%),
    linear-gradient(180deg, var(--cream) 0%, var(--cream-2) 100%);
  border-bottom: 1px solid var(--line);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='46' height='46' viewBox='0 0 46 46'%3E%3Cpath d='M23 2 L44 23 L23 44 L2 23 Z' fill='none' stroke='%23b85c38' stroke-opacity='0.16' stroke-width='1'/%3E%3Ccircle cx='23' cy='23' r='2.2' fill='%238e2f2f' fill-opacity='0.18'/%3E%3C/svg%3E");
}

.hero-inner {
  position: relative;
  text-align: center;
  max-width: 720px;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--terracotta-dark);
  background: rgba(255, 253, 248, 0.7);
  border: 1px solid var(--line);
  padding: 0.35rem 1rem;
  border-radius: 999px;
  margin-bottom: 1.2rem;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.12;
  margin: 0 0 1rem;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto 2rem;
}

/* ---------- Collection / Filters ---------- */
.collection {
  padding-block: clamp(3rem, 7vw, 5rem);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1.5rem 0 2.25rem;
}

.filter-btn {
  padding: 0.55rem 1.25rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--deep);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.filter-btn:hover {
  border-color: var(--terracotta);
  transform: translateY(-1px);
}

.filter-btn.is-active {
  background: var(--deep);
  border-color: var(--deep);
  color: #fff;
}

.filter-emoji {
  margin-inline-end: 0.4rem;
}

/* ---------- Grid & cards ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  animation: rise 0.5s ease both;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-media {
  position: relative;
  aspect-ratio: 1 / 0.82;
  background: var(--cream-2);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.card:hover .card-media img {
  transform: scale(1.05);
}

.card-media .placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 253, 248, 0.9), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34' height='34' viewBox='0 0 34 34'%3E%3Cpath d='M17 2 L32 17 L17 32 L2 17 Z' fill='none' stroke='%23b85c38' stroke-opacity='0.18' stroke-width='1'/%3E%3Ccircle cx='17' cy='17' r='1.8' fill='%238e2f2f' fill-opacity='0.16'/%3E%3C/svg%3E");
}

.card-media .placeholder-emoji {
  font-size: 3.4rem;
  filter: drop-shadow(0 4px 8px rgba(58, 46, 36, 0.2));
}

.card-badge {
  position: absolute;
  top: 0.8rem;
  inset-inline-start: 0.8rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: var(--olive);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}

.card-body {
  padding: 1.1rem 1.2rem 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
}

.card-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
  margin: 0;
  line-height: 1.3;
}

.card-price {
  font-weight: 600;
  color: var(--terracotta-dark);
  margin: 0;
}

.card-desc {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0.3rem 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 2rem;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  margin-top: 1rem;
}

/* ---------- About ---------- */
.about {
  padding-block: clamp(3rem, 7vw, 5rem);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='46' height='46' viewBox='0 0 46 46'%3E%3Cpath d='M23 2 L44 23 L23 44 L2 23 Z' fill='none' stroke='%23b85c38' stroke-opacity='0.1' stroke-width='1'/%3E%3C/svg%3E"),
    var(--cream-2);
  border-block: 1px solid var(--line);
}

.about-card {
  max-width: 680px;
  margin-inline: auto;
  text-align: center;
}

.about-card p {
  color: var(--muted);
  font-size: 1.05rem;
}

/* ---------- Contact ---------- */
.contact {
  padding-block: clamp(3rem, 7vw, 5rem);
  text-align: center;
}

.contact-subtitle {
  color: var(--muted);
  max-width: 520px;
  margin: 0.6rem auto 1.8rem;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--deep);
  color: var(--cream-2);
  padding-block: 2rem;
  text-align: center;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.footer-tagline {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  margin: 0;
}

.footer-rights {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(239, 228, 209, 0.7);
}

/* ---------- Modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal.is-open {
  opacity: 1;
  visibility: visible;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(38, 28, 20, 0.6);
  backdrop-filter: blur(4px);
}

.modal-card {
  position: relative;
  width: min(680px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  transform: translateY(14px) scale(0.98);
  transition: transform 0.25s ease;
}

.modal.is-open .modal-card {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  inset-inline-end: 0.75rem;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  border: none;
  background: rgba(255, 253, 248, 0.9);
  color: var(--deep);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  box-shadow: var(--shadow-sm);
  transition: background 0.2s ease, transform 0.2s ease;
}

.modal-close:hover {
  background: var(--terracotta);
  color: #fff;
  transform: rotate(90deg);
}

.modal-media {
  aspect-ratio: 16 / 10;
  background: var(--cream-2);
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
}

.modal-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-media .placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 253, 248, 0.9), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34' height='34' viewBox='0 0 34 34'%3E%3Cpath d='M17 2 L32 17 L17 32 L2 17 Z' fill='none' stroke='%23b85c38' stroke-opacity='0.18' stroke-width='1'/%3E%3Ccircle cx='17' cy='17' r='1.8' fill='%238e2f2f' fill-opacity='0.16'/%3E%3C/svg%3E");
}

.modal-media .placeholder-emoji {
  font-size: 4.5rem;
  filter: drop-shadow(0 6px 12px rgba(58, 46, 36, 0.2));
}

.modal-body {
  padding: 1.5rem 1.75rem 2rem;
}

.modal-category {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: var(--olive);
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 0.7rem;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.7rem;
  margin: 0 0 0.3rem;
  line-height: 1.25;
}

.modal-price {
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--terracotta-dark);
  margin: 0 0 0.9rem;
}

.modal-description {
  color: var(--muted);
  margin: 0;
}

/* ---------- Focus styles ---------- */
:focus-visible {
  outline: 3px solid var(--terracotta);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .site-nav {
    display: none;
  }

  .brand-name {
    font-size: 1rem;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
  }

  .card-desc {
    display: none;
  }

  .modal-card {
    max-height: 92vh;
  }
}
