/* ================== Reset & Base ================== */
* { margin:0; padding:0; box-sizing:border-box; }

html, body {
  height:100%;
  font-family:"Faruma", Arial, sans-serif;
  background: #ffffff;
  background-attachment: fixed;
  color:#111;
  overflow-x:hidden;
}
html { scroll-behavior:smooth; }

html:has(body.vaahaka-page) {
  overflow-x: visible;
}

body.vaahaka-page {
  overflow-x: visible;
}

/* Topbar/nav — use style.css (do not duplicate here; keeps Lhenveriyaa button consistent) */

/* Adjust main content so title isn't hidden */
main.content {
  margin-top: var(--site-header-h);
  margin-right: 0;
  padding: 28px 40px 48px;
  max-width: none;
  box-sizing: border-box;
}

#vaahakaTitle {
  margin: 0 0 20px;
  text-align: center;
}

/* Vaahaka sidebar — keep logo + name fixed, cart at bottom */
body.vaahaka-page .sidebar {
  overflow: visible;
  padding-bottom: 0;
}

body.vaahaka-page .sidebar .logo-area,
body.vaahaka-page .sidebar .extra-image {
  flex-shrink: 0;
}

body.vaahaka-page .cart-box {
  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-origin: 70% 50%;
  clip-path: polygon(20px 0%, 100% 0%, 100% 100%, 20px 100%, 0% 50%);
  border-radius: 0;
  overflow: visible;
  animation: cartBreathe 2.8s ease-in-out infinite;
  z-index: 1100;
  cursor: pointer;
  will-change: transform, filter, box-shadow;
}

body.vaahaka-page .cart-box svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

body.vaahaka-page .cart-box #cartCount {
  display: inline-block;
  min-width: 1ch;
  text-align: center;
}

@keyframes cartBreathe {
  0%, 100% {
    transform: translateX(-28px) scale(1);
    filter: brightness(1) saturate(1);
    box-shadow: 0 0 0 0 rgba(88, 166, 255, 0.2);
  }
  50% {
    transform: translateX(-28px) scale(1.05);
    filter: brightness(1.12) saturate(1.12);
    box-shadow: 0 0 14px 4px rgba(88, 166, 255, 0.45);
  }
}

.topbar .cart-box {
  display: none;
}

/* Shared cart button look */
.cart-box {
  background: linear-gradient(135deg, #58A6FF, #1f6feb);
  color: #fff;
  font-family: "Faruma", Arial, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  gap: 4px;
}



/* ================== Page Title ================== */

/* ================== Grid (rows live in vaahaka-motion.css) ================== */
#vaahakaGrid {
  max-width: 100%;
  width: 100%;
  margin: 24px auto 60px;
  padding: 0 24px;
  box-sizing: border-box;
}
.story-card {
  border: 1px solid #ccc;
  border-radius: 12px;
  padding: 8px;
  background: #fff;
  text-align: center;
  display: inline-grid;
  grid-template-columns: max-content;
  justify-items: stretch;
  font-family: "Faruma", Arial, sans-serif;
  box-sizing: border-box;
}

.story-card .cover-wrap {
  display: block;
  line-height: 0;
  justify-self: center;
  margin-bottom: 10px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.story-card .cover-wrap img {
  display: block;
  width: auto;
  height: auto;
  max-height: 260px;
  max-width: 220px;
}

.story-card h3 {
  width: 100%;
  box-sizing: border-box;
  font-size: 16px;
  color: #1f84e8;
  margin: 6px 0 2px;
  word-break: break-word;
}

.story-card .price {
  width: 100%;
  box-sizing: border-box;
  color:#e63946;
  font-weight:bold;
  margin: 0 0 6px;
}

.story-card .add-cart {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  font-size: 12px;
  padding: 7px 4px;
  white-space: normal;
  line-height: 1.35;
}

/* Add-to-Cart Button inside book */
.add-cart {
  background: linear-gradient(135deg,#63a4e6,#1d5082);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;

  display: inline-flex;          /* ✅ inline so it sizes naturally */
  flex-direction: row;           /* ✅ force text + icon side by side */
  align-items: center;           /* ✅ vertical alignment */
  justify-content: center;       /* ✅ center content */
  gap: 6px;                      /* ✅ space between icon and text */

  font-family: "Faruma", Arial, sans-serif;
  font-size: 15px;
  line-height: 1;                /* ✅ avoids extra vertical spacing */
  white-space: nowrap;           /* ✅ prevent breaking into 2 lines */
  transition: all 0.25s ease;
}

.add-cart:hover {
  background: linear-gradient(135deg,#0e3c6a,#7daddc);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}



/* Optional subtle pulse if you want book buttons animated too */
@keyframes addCartPulse {
  0%, 100% { filter: brightness(1) saturate(1); }
  50%      { filter: brightness(1.25) saturate(1.15); }
}
.add-cart.pulse {
  animation: addCartPulse 1.8s ease-in-out infinite;
}

.add-cart:hover {
  background:linear-gradient(135deg,#0e3c6a,#165493);
}

/* ================== Book download (after approval) ================== */
.story-card .book-download-btn {
  width: 100%;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #0e6b3a;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-family: "Faruma", Arial, sans-serif;
  font-size: 14px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  animation: bookDownloadPulse 2s ease-in-out infinite;
}

.story-card .book-download-btn:hover {
  background: #0a5230;
  transform: scale(1.04);
}

@keyframes bookDownloadPulse {
  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 ================== */
.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: 0 auto 24px;
  max-width: 640px;
  text-align: right;
  font-family: "Faruma", Arial, sans-serif;
}

.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;
}

.order-unlock-bar .unlock-row {
  display: flex;
  gap: 8px;
  flex-direction: row-reverse;
}

.order-unlock-bar input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #bbb;
  border-radius: 6px;
  font-size: 14px;
}

.order-unlock-bar button {
  background: #165493;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  cursor: pointer;
  font-family: "Faruma", Arial, sans-serif;
  white-space: nowrap;
}

.order-unlock-bar button:hover { background: #0e3c6a; }

.order-unlock-bar .order-status-msg {
  margin: 10px 0 0;
  font-size: 14px;
  color: #165493;
  min-height: 1.2em;
}

/* ================== Cart Popup ================== */
#cartPopup {
  display:none;
  position:fixed;
  top:50%; left:50%;
  transform:translate(-50%,-50%);
  background:#fff;
  border:1px solid #ccc;
  border-radius:8px;
  padding:20px;
  z-index:2000;
  width:400px; max-width:90%;
  box-shadow:0 8px 30px rgba(0,0,0,.3);
  font-family:"Faruma", Arial, sans-serif;
}
#popupCartItems li {
  display:flex;
  align-items:center;
  gap:14px;
  margin-bottom:10px;
}
#popupCartItems img {
  width:40px; height:50px;
  border:1px solid #ccc;
}
#popupCartTotal {
  font-weight:bold;
  color:#e63946;
  margin-top:10px;
  text-align:center;
}

/* ================== Checkout Form ================== */
#checkoutForm {
  margin-top:15px;
  text-align:left;
  direction:ltr;
}
#checkoutForm label {
  display:block;
  margin:6px 0 4px;
  font-size:14px;
}
#checkoutForm input {
  width:100%;
  padding:6px;
  margin-bottom:10px;
  border:1px solid #ccc;
  border-radius:4px;
  font-family:"Faruma", Arial, sans-serif;
}
#checkoutCart {
  background:green;
  color:#fff;
  border:none;
  padding:12px 16px;
  border-radius:6px;
  cursor:pointer;
  margin-top:5px;
  width:100%;
  font-size:16px;
  font-family:"Faruma", Arial, sans-serif;
}
#closeCart {
  background:#165493;
  color:#fff;
  border:none;
  padding:8px 14px;
  border-radius:6px;
  cursor:pointer;
  margin-top:12px;
  font-size:14px;
  display:block;
  margin-left:auto;
  margin-right:auto;
  font-family:"Faruma", Arial, sans-serif;
}

/* ================== Payment Popup (bank transfer) ================== */
#paymentPopup {
  display:none;
  position:fixed;
  top:50%; left:50%;
  transform:translate(-50%,-50%);
  background:#fff;
  border:1px solid #ccc;
  border-radius:10px;
  padding:24px 20px;
  width:400px; max-width:92%;
  text-align:center;
  box-shadow:0 8px 25px rgba(0,0,0,0.4);
  font-family:"Faruma", Arial, sans-serif;
  z-index:3000;
}
#paymentPopupTitle {
  color:#165493;
  font-size:20px;
  margin:0 0 14px;
}
#paymentPopup .bank-details {
  text-align:right;
  direction:rtl;
  margin-bottom:12px;
}
#paymentPopup .bank-dl {
  margin:0;
  font-size:14px;
}
#paymentPopup .bank-dl dt {
  color:#666;
  font-size:12px;
  margin-top:8px;
}
#paymentPopup .bank-dl dd {
  margin:2px 0 0;
  font-weight:bold;
  color:#111;
}
#paymentPopup .copy-row {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  direction:ltr;
}
#paymentPopup .copy-btn {
  flex-shrink:0;
  background:#eee;
  border:1px solid #ccc;
  border-radius:4px;
  padding:2px 8px;
  font-size:12px;
  cursor:pointer;
  font-family:"Faruma", Arial, sans-serif;
}
#paymentPopup .order-ref {
  font-size:13px;
  color:#b45309;
  font-weight:bold;
  margin:10px 0;
  line-height:1.5;
}
#paymentPopup .payment-note {
  font-size:13px;
  color:#444;
  font-weight:normal;
  line-height:1.6;
  margin-bottom:14px;
}
#paymentPopup .whatsapp-btn {
  display:inline-flex;
  align-items:center;
  gap:6px;
  margin:8px 0 12px;
  background:#25D366;
  color:#fff;
  padding:10px 18px;
  border-radius:6px;
  text-decoration:none;
  font-size:15px;
  font-family:"Faruma", Arial, sans-serif;
  text-decoration:none;
}
#closePaymentPopup {
  background:#165493;
  color:#fff;
  border:none;
  padding:10px 18px;
  border-radius:6px;
  cursor:pointer;
  font-size:14px;
  margin-top:12px;
  font-family:"Faruma", Arial, sans-serif;
}

#vaahakaTitle {
  margin: 0 0 20px;
  text-align: center;
}

/* ================== Mobile ================== */
@media (max-width: 768px) {
  html:has(body.vaahaka-page),
  body.vaahaka-page {
    overflow-x: hidden;
  }

  body.vaahaka-page main.content {
    margin-right: 0;
    margin-left: 0;
    max-width: 100%;
    padding: 20px 12px 48px;
  }

  body.vaahaka-page .sidebar {
    display: none;
  }

  body.vaahaka-page .cart-box {
    position: fixed;
    right: 16px;
    bottom: 24px;
    left: auto;
    width: auto;
    min-width: 120px;
    height: 44px;
    padding: 0 14px;
    font-size: 13px;
    transform: none;
    clip-path: none;
    border-radius: 10px;
    animation: none;
    z-index: 1100;
  }

  body.vaahaka-page .site-header {
    right: 0;
  }

  #vaahakaGrid {
    display: flex;
    flex-direction: column;
    padding: 0 4px;
    margin-bottom: 40px;
    gap: 32px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  #vaahakaTitle {
    font-size: clamp(22px, 6.5vw, 34px);
    line-height: 1.45;
    padding: 0 6px;
  }

  .story-card {
    width: 100%;
    max-width: min(300px, 100%);
  }

  .story-card h3 {
    font-size: 15px;
    word-break: break-word;
  }

  .order-unlock-bar {
    padding: 14px 16px;
  }

  .order-unlock-bar .unlock-row {
    flex-direction: column;
    align-items: stretch;
  }

  .order-unlock-bar button {
    width: 100%;
  }
}

/* Topbar/nav — use style.css */
