
/* ================== Font files ================== */
@font-face {
  font-family: "Faruma";
  src: url("downloads/fonts/Faruma.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "EasaFalaGalan";
  src: url("downloads/fonts/EasaFalaGalan-Heading.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "EasaGulhaaShine-Bold";
  src: url("downloads/fonts/EasaGulhaaShine-Bold.ttf") format("truetype");
  font-weight: bold;
}

@font-face {
  font-family: "EasaIce";
  src: url("downloads/fonts/EasaIce-Bold.ttf") format("truetype");
  font-weight: bold;
}

@font-face {
  font-family: "EasaKundi-Bold";
  src: url("downloads/fonts/EasaKundi-Bold.ttf") format("truetype");
  font-weight: bold;
}

@font-face {
  font-family: "EasaOlhi";
  src: url("downloads/fonts/EasaOlhi-Regular.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

/* ================== Fonts Page Layout ================== */
body.fonts-page {
  font-family: "Faruma","MV Boli",Arial,sans-serif;
  background: linear-gradient(165deg, #e8eef6 0%, #f4f7fb 45%, #fafbfc 100%);
  background-attachment: fixed;
  color: #111;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  font-weight: normal; /* default normal weight */
}

/* Main content */
body.fonts-page .content {
  margin-top: 72px;
  margin-right: 150px;
  padding: 28px 40px 48px;
  max-width: calc(100% - 150px);
  box-sizing: border-box;
}

/* ================== Topbar ================== */
body.fonts-page .topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 150px;
  height: 60px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(22, 84, 147, 0.14);
  box-shadow: 0 2px 14px rgba(22, 84, 147, 0.07);
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: 900;
}

body.fonts-page .nav {
  margin-left: auto;
  display: flex;
  gap: 6px;
  align-items: center;
}

body.fonts-page .nav a {
  text-decoration: none;
  font-size: 17px;
  color: #486581;
  padding: 7px 12px;
  border-radius: 8px;
  border-bottom: none;
  line-height: 1.3;
  transition: color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

body.fonts-page .nav a:hover {
  color: #165493;
  background: rgba(22, 84, 147, 0.1);
}

body.fonts-page .nav a.active,
body.fonts-page .nav .active {
  color: #ffffff;
  background: linear-gradient(135deg, #165493 0%, #1e6aab 100%);
  box-shadow: 0 2px 10px rgba(22, 84, 147, 0.28);
}

body.fonts-page .nav a.active:hover,
body.fonts-page .nav .active:hover {
  color: #ffffff;
  background: linear-gradient(135deg, #1a5fa0 0%, #165493 100%);
}

/* ================== Font Controls Bar ================== */
body.fonts-page .font-controls {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  padding: 12px 20px;
  margin-bottom: 20px;
  gap: 24px;
  width: 100%;
  box-sizing: border-box;
  background: #fafafa;
  border: 1px solid #ddd;
  position: sticky;
  top: 60px;
  z-index: 900;
}

body.fonts-page .font-controls .ctrl {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

body.fonts-page .left-controls,
body.fonts-page .slider-group {
  display: flex;
  align-items: center;
  gap: 24px;
}

body.fonts-page .slider-group {
  margin-inline-start: auto;
}

body.fonts-page .font-controls input[type="range"] {
  width: 90px;
  max-width: 102px;
  height: 2px;
  background: #ccc;
  border-radius: 2px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

body.fonts-page .font-controls input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #4da6ff;
  cursor: pointer;
  border: none;
}

body.fonts-page .font-controls input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #4da6ff;
  cursor: pointer;
  border: none;
}

body.fonts-page .font-controls #sizeVal,
body.fonts-page .font-controls #lhVal,
body.fonts-page .font-controls #lsVal {
  font-family: Arial, sans-serif;
  font-size: 12px;
  min-width: 2.5em;
  direction: ltr;
}

/* Color picker */
body.fonts-page .font-controls input[type="color"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  padding: 0;
}
body.fonts-page .font-controls input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
body.fonts-page .font-controls input[type="color"]::-webkit-color-swatch { border: none; border-radius: 4px; }
body.fonts-page .font-controls input[type="color"]::-moz-color-swatch { border: none; border-radius: 4px; }

/* ================== Font Sections ================== */
body.fonts-page .font-section {
  margin: 0 0 20px 0;
  width: 100%;
  max-width: 100%;
  border: 1px solid #ccc;
  border-radius: 10px;
  overflow: hidden;
  box-sizing: border-box;
}

body.fonts-page .font-header {
  position: relative;
  background: #f0f0f0;
  border-bottom: 1px solid #ccc;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  direction: rtl;
  min-height: 32px;
  padding: 5px 10px;
  border-radius: 10px 10px 0 0;
}

body.fonts-page .font-header-actions {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  direction: rtl;
}

body.fonts-page .font-header > .price {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin: 0;
  line-height: 1;
}

body.fonts-page .font-header > .font-name {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  max-width: calc(100% - 220px);
  margin: 0;
  padding: 0;
  line-height: 1;
  pointer-events: none;
}

body.fonts-page .buy-btn,
body.fonts-page .download-btn {
  box-sizing: border-box;
  margin: 0;
  min-height: 0;
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body.fonts-page .buy-btn {
  font-family: "Faruma", "MV Boli", Arial, sans-serif;
  font-size: 11px;
  line-height: 1;
  font-weight: normal;
  background: #165493;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
  vertical-align: middle;
}

body.fonts-page .buy-btn:hover { background: #0e3c6a; }

body.fonts-page .download-btn {
  font-family: "Faruma", Arial, sans-serif;
  font-size: 13px;
  line-height: 1;
  font-weight: normal;
  background: #0e6b3a;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 3px 7px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  display: none;
  min-width: 24px;
  text-align: center;
}

body.fonts-page .download-btn.active {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  animation: downloadPulse 2s ease-in-out infinite;
}

body.fonts-page .download-btn:hover {
  background: #0a5230;
}

@keyframes downloadPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(14, 107, 58, 0.4); }
  50% { box-shadow: 0 0 12px 3px rgba(14, 107, 58, 0.55); }
}

.order-unlock-bar {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(22, 84, 147, 0.2);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 24px;
  text-align: right;
}

.order-unlock-bar .unlock-title {
  font-weight: bold;
  color: #165493;
  margin: 0 0 6px;
}

.order-unlock-bar .unlock-hint {
  font-size: 14px;
  color: #555;
  margin: 0 0 12px;
  line-height: 1.5;
}

.order-unlock-bar .unlock-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  direction: ltr;
}

.order-unlock-bar input {
  flex: 1;
  min-width: 180px;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 15px;
}

.order-unlock-bar #checkOrderBtn {
  background: #165493;
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-family: "Faruma", Arial, sans-serif;
}

.order-status-msg {
  margin: 10px 0 0;
  font-size: 14px;
  font-weight: bold;
  color: #165493;
  min-height: 1.2em;
}

/* ================== Font cart (sidebar) ================== */
body.fonts-page .sidebar {
  overflow: visible;
}

body.fonts-page #fontCartButton {
  position: fixed;
  right: 22px;
  bottom: 48px;
  width: 126px;
  height: 40px;
  margin: 0;
  padding: 0 8px 0 12px;
  box-sizing: border-box;
  font-size: 11px;
  transform: translateX(-28px);
  clip-path: polygon(20px 0%, 100% 0%, 100% 100%, 20px 100%, 0% 50%);
  border-radius: 0;
  z-index: 1100;
  animation: fontCartBreathe 2.8s ease-in-out infinite;
}

body.fonts-page #fontCartButton svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

@keyframes fontCartBreathe {
  0%, 100% {
    transform: translateX(-28px) scale(1);
    box-shadow: 0 0 0 0 rgba(88, 166, 255, 0.2);
  }
  50% {
    transform: translateX(-28px) scale(1.05);
    box-shadow: 0 0 14px 4px rgba(88, 166, 255, 0.45);
  }
}

/* ================== Writing Area ================== */
body.fonts-page .font-preview {
  width: 100%;
  min-height: 120px;
  height: 120px;
  max-height: 120px;
  overflow: hidden;
  padding: 12px 16px;
  border-top: none;
  border: none;
  border-radius: 0 0 10px 10px;
  background: #fff;
  font-size: 32px;
  line-height: 1.5;
  word-break: break-word;
  outline: none;
  color: #000;
  margin: 0;
  transition: border-color .2s, box-shadow .2s;
}
body.fonts-page .font-preview:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  border-color: #bbb;
}

/* ================== Responsive ================== */
@media (max-width: 768px) {
  body.fonts-page .sidebar { display: none; }
  body.fonts-page .topbar { right: 0; }
  body.fonts-page .content {
    margin-right: 0;
    margin-left: 0;
    max-width: 100%;
    padding: 20px 16px 40px;
  }

  body.fonts-page #fontCartButton {
    display: flex;
    position: fixed;
    right: 16px;
    bottom: 24px;
    transform: none;
    clip-path: none;
    border-radius: 10px;
    width: auto;
    min-width: 120px;
    height: 44px;
    padding: 0 14px;
    font-size: 13px;
    z-index: 1100;
  }

  body.fonts-page .site-footer {
    margin-right: 0;
  }
  body.fonts-page .nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 60px; left: 0; right: 0;
    background: #f5f5f5;
    padding: 20px;
  }
  body.fonts-page .nav.open { display: flex; }
  .menu-btn { display: block; }
}

/* ================== Independent Styles ================== */
/* Price only */
body.fonts-page .price {
  font-family: "HWYGoth", Arial, sans-serif;
  font-size: 14px;
  line-height: 1;
  font-weight: normal;
  color: #c02f39;
  white-space: nowrap;
}

body.fonts-page .font-name {
  font-family: Arial, sans-serif;
  font-size: 16px;
  line-height: 1;
  font-weight: 600;
  color: #165493;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  direction: ltr;
  text-align: center;
}
/* Font section wrapper — see Font Sections block above */
body.fonts-page .font-section .font-header {
  border-radius: 0;
}

