/* =========================================================
   FARSHESTAN — SHARED STYLES
   Used by: index, account, cart, checkout.
   Heritage + modernism: Persian script as display type,
   madder + indigo dyes, square forms, space instead of rules.
========================================================= */

@font-face {
  font-family: 'Vazirmatn';
  src: url('assets/Vazirmatn.ttf') format('truetype');
  font-display: swap;
}

:root {
  --cream: #f7f2eb;
  --sand: #ece4d8;
  --paper: #ffffff;
  --ink: #000000;
  --muted: #5e574f;
  --madder: #A52A2A;
  --indigo: #1f2a44;

  --serif: 'Noto Naskh Arabic', serif;
  --sans: 'Vazirmatn', sans-serif;

  --gutter: 3rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* Type scale shared by every page (the homepage headline sets it) */
  --h-display: clamp(1.75rem, 3.4vw, 2.75rem);   /* page titles and section headings */
  --h-fa: clamp(1.5rem, 2.4vw, 2rem);            /* the Persian word above a heading */
  --h-title: clamp(1.4rem, 2vw, 1.75rem);        /* product names, empty states, smaller headings */
  --h-sub: clamp(1.2rem, 1.6vw, 1.45rem);        /* card and list headings */
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

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

/* The menu's logo images must keep their natural width */
#menuBar img {
  max-width: none;
}

button,
input {
  font-family: inherit;
  color: inherit;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--madder);
  outline-offset: 3px;
}

/* Persian script */
.fa {
  font-family: var(--serif);
  direction: rtl;
  unicode-bidi: isolate;
}


/* =========================================================
   SLIDE-UP INFO PANEL
========================================================= */

#slidePanel {
  position: fixed;
  left: 0;
  bottom: -100%;
  width: 100%;
  height: 100%;
  background: var(--cream);
  z-index: 100002;
  transition: bottom 0.6s var(--ease);
}

#panelContent {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}


/* =========================================================
   PAGE TITLES — Latin with its Persian counterpart
========================================================= */

/* Persian word above the Latin title, as on the homepage */
.page-head {
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-start;
  gap: 0.35rem;
  margin-bottom: 2.5rem;
}

.page-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: var(--h-display);
  line-height: 1.1;
}

.page-fa {
  margin: 0;
  font-size: var(--h-fa);
  font-weight: 400;
  line-height: 1.2;
  color: var(--madder);
}

.lede {
  margin: 0 0 2rem;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--muted);
}


/* =========================================================
   BUTTONS
========================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--cream);
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.btn:hover {
  background: var(--indigo);
  border-color: var(--indigo);
}

.btn-outline {
  background: transparent;
  color: var(--ink);
}

.btn-outline:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--cream);
}

.btn-block {
  width: 100%;
}

.text-link {
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.text-link:hover {
  color: var(--madder);
}


/* =========================================================
   FORMS — filled fields, no outlines until focus
========================================================= */

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.1rem;
}

.field label {
  font-size: 0.9rem;
  color: var(--muted);
}

.field label.required::after {
  content: ' *';
  color: var(--madder);
}

.input {
  width: 100%;
  padding: 0.95rem 1rem;
  border: 0;
  border-radius: 0;
  background: var(--sand);
  font-size: 1rem;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: inset 0 -2px 0 transparent;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.input::placeholder {
  color: #9a8f81;
}

.input:hover {
  background: #e6dccd;
}

.input:focus {
  background: var(--paper);
  box-shadow: inset 0 -2px 0 var(--ink);
}

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.divider {
  margin: 1.75rem 0 1.25rem;
  font-size: 0.95rem;
  color: var(--muted);
}


/* =========================================================
   ORDER SUMMARY (cart page + checkout)
========================================================= */

.summary {
  position: sticky;
  top: 90px;
  padding: 2rem;
  background: var(--sand);
}

.summary h2 {
  margin: 0 0 1.25rem;
  font-family: var(--serif);
  font-weight: normal;
  font-size: var(--h-sub);
}

.summary-item {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 0.6rem 0;
}

.summary-thumb {
  width: 64px;
  height: 80px;
  padding: 5px;
  object-fit: contain;
  background: var(--paper);
}

.summary-name {
  margin: 0 0 0.2rem;
  font-size: 0.95rem;
}

.summary-qty {
  font-size: 0.85rem;
  color: var(--muted);
}

.summary-price {
  font-size: 0.95rem;
  white-space: nowrap;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  margin-top: 1.25rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.summary-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 0.5rem;
  font-family: var(--serif);
  font-size: 1.5rem;
}

.summary-empty {
  padding: 0.5rem 0;
  color: var(--muted);
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 700px) {
  .page-head {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

@media (max-width: 600px) {
  :root {
    --gutter: 1rem;
  }

  .row-2 {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .summary {
    padding: 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
