﻿
/* ================== 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: #ffffff;
  background-attachment: fixed;
  color: #111;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  font-weight: normal; /* default normal weight */
}

/* Main content — header/apps bar from style.css */
body.fonts-page .content {
  margin-top: var(--site-header-h);
  margin-right: 0 !important;
  margin-left: 0;
  padding: 28px 40px 48px;
  max-width: none !important;
  width: auto;
  box-sizing: border-box;
}

/* ================== Category bar ================== */
body.fonts-page .font-category-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  position: sticky;
  top: var(--site-header-h);
  z-index: 920;
  direction: ltr; /* keep All/Free on visual left despite page RTL */
}

body.fonts-page .font-category-bar .cat-bar-left,
body.fonts-page .font-category-bar .cat-bar-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

body.fonts-page .font-category-bar .cat-bar-spacer {
  flex: 1;
  min-width: 12px;
}

body.fonts-page .font-category-bar .cat-btn {
  font-family: Arial, sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  cursor: pointer;
  background: #f5f5f5;
  color: #333;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

body.fonts-page .font-category-bar .cat-btn:hover {
  background: #e8f0fa;
  border-color: #165493;
  color: #165493;
}

body.fonts-page .font-category-bar .cat-btn.active {
  background: #165493;
  border-color: #165493;
  color: #fff;
}

body.fonts-page .font-category-bar .cat-btn-new {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 16px 7px 10px;
  border: 2px solid transparent;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(135deg, #3d9970 0%, #2a8f6a 55%, #1e7a58 100%) border-box;
  color: #1a6b4a;
  box-shadow: 0 2px 10px rgba(42, 143, 106, 0.2);
}

body.fonts-page .font-category-bar .cat-btn-new.active {
  background:
    linear-gradient(#1a6b4a, #1a6b4a) padding-box,
    linear-gradient(135deg, #3d9970 0%, #2a8f6a 55%, #1e7a58 100%) border-box;
  color: #fff;
}

body.fonts-page .font-category-bar .cat-btn-new .cat-new-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 2px 5px;
  border-radius: 3px;
  background: #2a8f6a;
  color: #fff;
}

body.fonts-page .font-category-bar .cat-btn-new.active .cat-new-badge {
  background: rgba(255, 255, 255, 0.25);
}

body.fonts-page .price-free {
  color: #1a6b4a;
  font-weight: 700;
}

body.fonts-page .price-akuru {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: #165493;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

body.fonts-page .buy-btn--external {
  text-decoration: none;
}

body.fonts-page #fontList {
  scroll-margin-top: 200px;
}

body.fonts-page #fontList .font-section:first-child {
  scroll-margin-top: 200px;
}

/* ================== 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: calc(var(--site-header-h) + 58px);
  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: 38px;
  padding: 6px 12px;
  border-radius: 10px 10px 0 0;
}

body.fonts-page .font-header-actions {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  direction: rtl;
  min-width: 130px;
}

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% - 300px);
  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: 13px;
  line-height: 1.35;
  font-weight: normal;
  background: #165493;
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 7px 16px;
  min-width: 118px;
  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.payment-unlock {
  margin: 12px 0 0;
  padding: 12px 0 0;
  background: transparent;
  border: none;
  border-top: 1px solid rgba(22, 84, 147, 0.15);
  border-radius: 0;
}

.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 ================== */
body.fonts-page .sidebar {
  display: none !important;
}

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 .content {
    margin-right: 0;
    margin-left: 0;
    max-width: 100%;
    padding: 20px 16px 40px;
  }

  body.fonts-page .font-category-bar {
    top: var(--site-header-h);
    padding: 10px;
    gap: 6px;
  }

  body.fonts-page .font-category-bar .cat-btn {
    font-size: 12px;
    padding: 6px 10px;
  }

  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 .font-header {
    flex-wrap: wrap;
    justify-content: flex-end;
    min-height: auto;
    padding: 10px;
    gap: 8px;
  }

  body.fonts-page .font-header > .font-name {
    position: static;
    transform: none;
    max-width: 100%;
    width: 100%;
    order: -1;
    text-align: right;
    pointer-events: auto;
    margin: 0 0 4px;
    white-space: normal;
  }

  body.fonts-page .font-header-actions {
    min-width: 0;
  }

  body.fonts-page .font-controls {
    top: calc(var(--site-header-h) + 52px);
    padding: 10px 12px;
    gap: 12px;
  }

  body.fonts-page .left-controls,
  body.fonts-page .slider-group {
    gap: 12px;
  }
}

/* ================== 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;
}

/* Nav consistency fix (match global, stops page-to-page jumping) */
body.fonts-page .nav { gap: 2px; flex-wrap: nowrap; }
body.fonts-page .nav a { font-size: 16px; padding: 7px 10px; }
body.fonts-page .nav a.active,
body.fonts-page .nav .active { font-size: 16px; padding: 7px 10px; }
