/* ============================================================
   RUVEKA — Dedicated E-Book E-Commerce Storefront Styles
   Matches the 6-Step Digital Product Flow Reference:
   1. Product Showcase
   2. Checkout & Customer Details
   3. Razorpay UPI Payment
   4. Order Success
   5. Download / My Library Access
   ============================================================ */

:root {
  --primary-purple: #0f172a;
  --primary-purple-hover: #1e293b;
  --bg-white: #ffffff;
  --bg-slate: #f8fafc;
  --bg-subtle: #f1f5f9;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --text-body: #334155;
  --border-color: #e2e8f0;
  --success-green: #0f172a;
  --success-bg: #f1f5f9;
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body.ebook-ecommerce-page {
  margin: 0;
  padding: 0;
  background-color: var(--bg-slate);
  color: var(--text-dark);
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ------------------------------------------------------------
   Header & Navigation
   ------------------------------------------------------------ */
.ebook-nav {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.ebook-nav-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ebook-brand-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 800;
  font-size: 1.15rem;
}

.ebook-brand-logo img {
  height: 32px;
  width: auto;
  border-radius: 6px;
}

.ebook-nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.ebook-nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  transition: color 0.15s;
}

.ebook-nav-links a:hover {
  color: var(--text-dark);
}

.ebook-nav-trust {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: #0f172a;
  font-weight: 600;
  background: var(--bg-subtle);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border-color);
}

/* ------------------------------------------------------------
   Container & Layout
   ------------------------------------------------------------ */
.ebook-main-container {
  max-width: 1040px;
  margin: 2rem auto 4rem;
  padding: 0 1.25rem;
}

/* View Sections */
.ebook-flow-step {
  display: none;
}

.ebook-flow-step.active {
  display: block;
  animation: fadeIn 0.25s ease-out;
}

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

/* ------------------------------------------------------------
   STEP 1: PRODUCT PAGE
   ------------------------------------------------------------ */
.product-showcase-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  margin-bottom: 2rem;
}

.product-hero-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 3rem;
  align-items: start;
}

/* 3D E-Book Cover Showcase */
.ebook-cover-wrapper {
  position: relative;
  text-align: center;
  background: linear-gradient(145deg, #f1f5f9, #e2e8f0);
  border-radius: 16px;
  padding: 2rem 1.5rem;
  border: 1px solid var(--border-color);
}

.ebook-cover-img {
  width: 100%;
  max-width: 270px;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.22), -4px 4px 10px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease;
  transform: perspective(800px) rotateY(-8deg);
}

.ebook-cover-img:hover {
  transform: perspective(800px) rotateY(0deg) scale(1.02);
}

.ebook-cover-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: #0f172a;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
}

/* Product Info Column */
.product-info-col {
  display: flex;
  flex-direction: column;
}

.badge-bestseller {
  display: inline-block;
  background: #f1f5f9;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  width: fit-content;
  margin-bottom: 0.75rem;
}

.ebook-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.2;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}

.ebook-subtitle {
  font-size: 1.05rem;
  color: var(--text-body);
  line-height: 1.55;
  margin: 0 0 1.25rem;
}

.rating-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.stars {
  color: #0f172a;
  font-size: 1.05rem;
  letter-spacing: 1px;
}

.rating-score {
  font-weight: 700;
  color: var(--text-dark);
}

.price-block {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.price-current {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1;
}

.price-original {
  font-size: 1.35rem;
  color: #94a3b8;
  text-decoration: line-through;
}

.price-discount-tag {
  background: #f1f5f9;
  color: #0f172a;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.btn-buy-now {
  background: #0f172a;
  color: #ffffff;
  border: 1px solid #0f172a;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 0.95rem 1.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-buy-now:hover {
  background: #1e293b;
  border-color: #1e293b;
  transform: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.buy-subtext {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

/* Feature Value Props Strip (4 Icons) */
.feature-props-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem 1rem;
  margin-bottom: 2rem;
  text-align: center;
}

.prop-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.prop-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.prop-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dark);
}

/* What You'll Learn & Product Details Grid */
.details-sections-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
}

.details-box {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 2rem;
}

.details-box h3 {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0 0 1.25rem;
  color: var(--text-dark);
}

.learn-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.learn-checklist li {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.95rem;
  color: var(--text-body);
  line-height: 1.5;
}

.check-green {
  color: #0f172a;
  font-weight: 800;
  flex-shrink: 0;
  font-size: 1rem;
}

.specs-table {
  width: 100%;
  border-collapse: collapse;
}

.specs-table tr {
  border-bottom: 1px solid #f1f5f9;
}

.specs-table tr:last-child {
  border-bottom: none;
}

.specs-table td {
  padding: 0.75rem 0;
  font-size: 0.9rem;
}

.specs-label {
  color: var(--text-muted);
  font-weight: 500;
  width: 40%;
}

.specs-val {
  color: var(--text-dark);
  font-weight: 700;
  text-align: right;
}

/* ------------------------------------------------------------
   STEP 2: CHECKOUT PAGE
   ------------------------------------------------------------ */
.checkout-wrapper {
  max-width: 620px;
  margin: 0 auto;
}

/* Step Breadcrumb Bar */
.checkout-steps-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2rem;
}

.step-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #94a3b8;
}

.step-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.step-indicator.active {
  color: var(--primary-purple);
}

.step-indicator.active .step-circle {
  background: var(--primary-purple);
  color: #ffffff;
}

.step-indicator.completed {
  color: var(--success-green);
}

.step-indicator.completed .step-circle {
  background: var(--success-green);
  color: #ffffff;
}

.checkout-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 2rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  margin-bottom: 1.5rem;
}

.checkout-section-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-dark);
  margin: 0 0 1.25rem;
}

/* Order Summary Box */
.order-mini-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 1.25rem;
}

.order-mini-img {
  width: 52px;
  height: 64px;
  border-radius: 6px;
  object-fit: cover;
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.order-mini-info h4 {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-dark);
}

.order-mini-format {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.order-mini-price {
  margin-left: auto;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-dark);
}

/* Coupon Box */
.coupon-row {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.coupon-input {
  flex: 1;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.88rem;
  outline: none;
}

.coupon-btn {
  padding: 0.65rem 1.2rem;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: var(--text-dark);
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
}

.coupon-btn:hover {
  background: #e2e8f0;
}

/* Form Controls */
.form-group-item {
  margin-bottom: 1.15rem;
}

.form-group-item label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-body);
  margin-bottom: 0.4rem;
}

.form-group-item input {
  width: 100%;
  padding: 0.75rem 0.9rem;
  font-size: 0.92rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-sizing: border-box;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group-item input:focus {
  border-color: var(--primary-purple);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  display: block;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.82rem;
  color: var(--text-body);
  cursor: pointer;
  line-height: 1.45;
  margin-bottom: 1.5rem;
}

.btn-continue-pay {
  background: #0f172a;
  color: #ffffff;
  border: 1px solid #0f172a;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.9rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  width: 100%;
  transition: background 0.15s;
}

.btn-continue-pay:hover {
  background: #1e293b;
  border-color: #1e293b;
}

/* ------------------------------------------------------------
   STEP 3: PAYMENT SCREEN
   ------------------------------------------------------------ */
.payment-methods-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.payment-tab-btn {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.85rem 0.5rem;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-body);
  transition: all 0.15s ease;
}

.payment-tab-btn.active {
  border-color: #0f172a;
  background: #f1f5f9;
  color: #0f172a;
  box-shadow: 0 0 0 1px #0f172a;
}

.upi-brands-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 1.25rem 0;
  background: #f8fafc;
  border: 1px dashed var(--border-color);
  border-radius: 10px;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.upi-pill {
  font-size: 0.78rem;
  font-weight: 700;
  color: #334155;
  background: #ffffff;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.trust-badges-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------
   STEP 4: ORDER SUCCESS PAGE
   ------------------------------------------------------------ */
.success-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 3rem 2rem;
  text-align: center;
  max-width: 580px;
  margin: 0 auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

.success-check-icon {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: #0f172a;
  color: #ffffff;
  font-size: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  box-shadow: 0 0 0 8px #f1f5f9;
}

.success-title {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-dark);
  margin: 0 0 0.5rem;
}

.success-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0 0 2rem;
}

.receipt-box {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  text-align: left;
  margin-bottom: 2rem;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  padding: 0.45rem 0;
  font-size: 0.88rem;
  border-bottom: 1px solid #f1f5f9;
}

.receipt-row:last-child {
  border-bottom: none;
}

.receipt-label {
  color: var(--text-muted);
}

.receipt-val {
  font-weight: 700;
  color: var(--text-dark);
}

.btn-download-primary {
  background: #0f172a;
  color: #ffffff;
  border: 1px solid #0f172a;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 0.95rem 1.8rem;
  border-radius: 10px;
  cursor: pointer;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: background 0.15s, transform 0.15s;
  text-decoration: none;
  box-sizing: border-box;
}

.btn-download-primary:hover {
  background: #1e293b;
  transform: translateY(-1px);
}

.btn-secondary-link {
  display: block;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--primary-purple);
  text-decoration: none;
  font-weight: 600;
}

.btn-secondary-link:hover {
  text-decoration: underline;
}

/* ------------------------------------------------------------
   STEP 5: MY LIBRARY / ACCESS PAGE
   ------------------------------------------------------------ */
.library-header {
  margin-bottom: 2rem;
}

.library-header h2 {
  font-size: 1.8rem;
  font-weight: 800;
  margin: 0 0 0.4rem;
}

.library-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2rem;
  display: grid;
  grid-template-columns: 180px 1fr auto;
  gap: 2rem;
  align-items: center;
  margin-bottom: 2rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
}

.library-cover-img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.library-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-width: 200px;
}

.btn-lib-download {
  background: var(--primary-purple);
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.btn-lib-view {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.support-help-card {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ------------------------------------------------------------
   Responsive Rules
   ------------------------------------------------------------ */
@media (max-width: 860px) {
  .product-hero-grid,
  .details-sections-grid,
  .library-card {
    grid-template-columns: 1fr;
  }

  .ebook-cover-wrapper {
    max-width: 320px;
    margin: 0 auto;
  }

  .feature-props-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .library-actions {
    width: 100%;
  }
}

/* Checkout polish and compact screen layouts. */
.ebook-ecommerce-page { overflow-x: clip; }
.ebook-nav-container, .ebook-main-container { width: min(100%, 1160px); }
.ebook-nav { box-shadow: 0 2px 12px rgba(15, 23, 42, .04); }
.product-showcase-card, .checkout-card, .details-box, .success-card, .library-card {
  border-radius: 20px;
  box-shadow: 0 8px 26px rgba(15, 23, 42, .055);
}
.product-showcase-card { border-color: #e4e9f5; }
.ebook-cover-wrapper { background: radial-gradient(ellipse at 50% 35%, #eef1ff 0%, #f5f6fb 65%, #f8fafc 100%); }
.ebook-cover-badge, .btn-buy-now, .btn-continue-pay, .btn-download-primary {
  background: #3157d5;
  border-color: #3157d5;
}
.btn-buy-now:hover, .btn-continue-pay:hover, .btn-download-primary:hover { background: #2446ba; }
.badge-bestseller, .ebook-nav-trust { color: #3157d5; background: #eef2ff; border-color: #dbe4ff; }
.ebook-flow-step :is(input, button, a) { min-height: 44px; }
.payment-tab-btn { cursor: pointer; }
.btn-buy-now:disabled, .btn-continue-pay:disabled { opacity: .58; cursor: not-allowed; }

@media (max-width: 640px) {
  .ebook-nav-container { padding: .7rem 1rem; gap: .55rem; flex-wrap: wrap; }
  .ebook-brand-logo { font-size: 1rem; }
  .ebook-brand-logo img { height: 28px; }
  .ebook-nav-links { order: 3; width: 100%; justify-content: center; gap: 1.5rem; padding-top: .35rem; border-top: 1px solid var(--border-color); }
  .ebook-nav-trust { margin-left: auto; font-size: .7rem; padding: .3rem .55rem; }
  .ebook-main-container { margin: 1rem auto 2rem; padding-inline: .85rem; }
  .product-showcase-card { padding: 1.15rem; border-radius: 16px; }
  .product-hero-grid { gap: 1.35rem; }
  .ebook-cover-wrapper { max-width: 260px; padding: 1.35rem 1rem; }
  .ebook-cover-img { max-width: 205px; }
  .ebook-title { font-size: clamp(1.7rem, 8vw, 2.15rem); }
  .rating-row { flex-wrap: wrap; row-gap: .2rem; }
  .feature-props-strip { gap: .55rem; }
  .prop-item { padding: .8rem .5rem; text-align: center; }
  .details-sections-grid { gap: .85rem; }
  .details-box, .checkout-card { padding: 1.1rem; }
  .checkout-wrapper { gap: .85rem; }
  .checkout-steps-bar { gap: .4rem; }
  .step-indicator { gap: .35rem; font-size: .75rem; }
  .coupon-row { gap: .45rem; }
  .payment-methods-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .upi-brands-strip, .trust-badges-strip { flex-wrap: wrap; justify-content: center; gap: .45rem; }
  .success-card { padding: 1.25rem; }
  .library-card { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: .8rem; padding: 1rem; }
  .library-cover-img { width: 64px; }
  .library-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr; gap: .5rem; }
}

@media (max-width: 360px) {
  .ebook-nav-trust { display: none; }
  .ebook-main-container { padding-inline: .65rem; }
  .product-showcase-card, .checkout-card, .details-box { padding: .9rem; }
  .step-indicator { font-size: .68rem; }
}
