/* Dais Crackers — Order page (mobile-friendly, Aswitha-inspired) */

:root {
  --jd-brand: #ED3237;
  --jd-brand-light: #f04a4f;
  --jd-brand-mist: #fdebec;
  --jd-accent: #ff0a05;
  --jd-success: #027d15;
  --jd-radius: 12px;
  --jd-shadow: 0 8px 28px rgba(237, 50, 55, 0.1);
  --jd-font: 'Roboto', Arial, Helvetica, sans-serif;
}

.jd-order-page,
.jd-img-modal,
.jd-cart-bar {
  font-family: var(--jd-font);
  font-variant-numeric: lining-nums tabular-nums;
  -webkit-font-smoothing: antialiased;
}

.jd-order-page input,
.jd-order-page textarea,
.jd-order-page button,
.jd-order-page select,
.jd-order-page table,
.jd-order-page .form-control,
.jd-cart-bar-amount,
.jd-cart-stat-value,
.qty_control,
.num-pallets-input {
  font-family: var(--jd-font) !important;
  font-variant-numeric: lining-nums tabular-nums;
}

.jd-order-page {
  background: #faf7f7;
  padding-bottom: 2rem;
}

/* Notice banners */
.jd-order-notice {
  background: linear-gradient(90deg, #fff3cd, #ffe69c);
  color: #856404;
  text-align: center;
  padding: 0.65rem 1rem;
  font-weight: 600;
  font-size: 0.95rem;
  border-bottom: 1px solid #ffc107;
}

.jd-order-legal {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  background: #fff8e6;
  border-left: 4px solid #d4a017;
  border-radius: var(--jd-radius);
  padding: 1rem 1.15rem;
  margin: 1rem 0;
  color: #5c4816;
}

.jd-order-legal-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #d4a017;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.jd-order-legal p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
}

/* Sticky cart bar */
.jd-cart-bar {
  background: #fff;
  border: 2px solid var(--jd-brand-mist);
  border-radius: var(--jd-radius);
  padding: 0.85rem 1.15rem;
  margin: 1rem 0;
  box-shadow: var(--jd-shadow);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: border-color 0.2s, background 0.2s;
}

.jd-cart-bar.has-items {
  border-color: var(--jd-brand-light);
  background: linear-gradient(135deg, var(--jd-brand-mist), #fff);
}

.jd-cart-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.jd-cart-bar-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.jd-cart-bar-icon {
  font-size: 1.4rem;
  color: var(--jd-brand);
  flex-shrink: 0;
}

.jd-cart-bar-label {
  display: block;
  font-size: 0.78rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.jd-cart-bar-amount {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--jd-brand);
  line-height: 1.2;
}

.jd-cart-bar-meta {
  display: block;
  font-size: 0.82rem;
  color: #666;
}

.jd-cart-stats {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  flex: 1;
  justify-content: center;
}

.jd-cart-stat {
  text-align: center;
  min-width: 90px;
}

.jd-cart-stat-label {
  display: block;
  font-size: 0.72rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.jd-cart-stat-value {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: #222;
}

.jd-cart-stat-value.jd-save {
  color: var(--jd-success);
}

.jd-cart-bar-link {
  flex-shrink: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--jd-brand);
  text-decoration: none;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--jd-brand);
  border-radius: 999px;
  white-space: nowrap;
}

.jd-cart-bar-link:hover {
  background: var(--jd-brand);
  color: #fff;
}

.jd-cart-bar-link-short {
  display: none;
}

#showdis.jd-cart-bar-bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  top: auto;
  margin: 0;
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-bottom: none;
  z-index: 999;
  padding: 0.65rem 1rem;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
}

#showdis.jd-cart-bar-bottom .jd-cart-bar-inner {
  max-width: 1140px;
  margin: 0 auto;
}

#showdis.total-appear {
  position: fixed !important;
}

/* Category navigation */
.jd-category-nav {
  background: #fff;
  border-radius: var(--jd-radius);
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
  box-shadow: var(--jd-shadow);
}

.jd-category-nav-label {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--jd-brand);
  margin-bottom: 0.75rem;
}

.jd-category-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.35rem;
  scrollbar-width: thin;
}

.jd-category-chip {
  display: inline-block;
  flex-shrink: 0;
  padding: 0.45rem 1rem;
  background: var(--jd-brand-mist);
  color: var(--jd-brand);
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}

.jd-category-chip:hover {
  background: var(--jd-brand);
  color: #fff;
}

/* Product list */
.jd-order-thead-hidden {
  display: none;
}

.jd-product-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px auto;
  align-items: center;
  gap: 0.75rem 1.25rem;
  padding: 0.85rem 1rem;
}

.jd-product-main {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.jd-product-copy {
  min-width: 0;
}

.jd-product-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: #1a1a1a;
  line-height: 1.3;
  text-transform: uppercase;
}

.jd-product-unit {
  font-size: 0.78rem;
  color: #777;
  margin-top: 0.15rem;
}

.jd-product-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  line-height: 1.25;
  white-space: nowrap;
}

.jd-price-mrp {
  font-size: 0.82rem;
  color: #9a9a9a;
  text-decoration: line-through;
}

.jd-price-net {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--jd-brand);
}

.jd-product-qty {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
}

.jd-row-total {
  font-size: 0.75rem;
  color: var(--jd-brand);
  font-weight: 600;
  min-height: 1em;
}

.jd-thumb-offer {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 2;
  background: #f5c518;
  color: #1a1a1a;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1;
  padding: 0.22rem 0.35rem;
  border-radius: 4px;
}

/* Product table */
.jd-order-table-wrap {
  background: #fff;
  border-radius: var(--jd-radius);
  box-shadow: var(--jd-shadow);
  overflow: hidden;
  margin-bottom: 1.5rem;
  -webkit-overflow-scrolling: touch;
}

.jd-order-table-wrap .table {
  margin-bottom: 0;
  width: 100%;
  table-layout: fixed;
}

#order-table.jd-order-table thead th {
  background: var(--jd-brand);
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.75rem 0.5rem;
  border: none;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
}

#order-table.jd-order-table tbody td {
  padding: 0;
  vertical-align: middle;
  font-size: 0.88rem;
  border-color: #eee;
  background: #fff;
}

#order-table.jd-order-table tbody tr.jd-product-row:nth-child(even) td {
  background: #fafafa;
}

#order-table.jd-order-table tr.sub td {
  background: var(--jd-brand) !important;
  color: #fff !important;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.85rem 1rem;
  border: none;
  text-align: center;
}

#order-table.jd-order-table tr.sub td a.colorred i.fa {
  color: #fff;
}

#order-table.jd-order-table .product_name.product-title {
  text-align: left;
  font-weight: 600;
  color: #222 !important;
  line-height: 1.35;
}

#order-table.jd-order-table .product_image {
  width: 72px;
}

#order-table.jd-order-table .product_rate {
  color: #888 !important;
  text-decoration: line-through;
  font-size: 0.82rem;
}

#order-table.jd-order-table td.discounted_price {
  color: var(--jd-success) !important;
  font-weight: 700;
}

#order-table.jd-order-table .row-total {
  font-weight: 700;
  color: var(--jd-brand);
  white-space: nowrap;
}

.jd-col-hide-mobile {
  /* shown on desktop */
}

.jd-mobile-price {
  display: none;
  font-size: 0.82rem;
  margin-top: 0.25rem;
}

.jd-mobile-price .strike {
  text-decoration: line-through;
  color: #888;
  margin-right: 0.35rem;
}

.jd-mobile-price .net {
  color: var(--jd-success);
  font-weight: 700;
}

.jd-offer-badge {
  display: inline-block;
  background: #f5c518;
  color: #1a1a1a;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  margin-right: 0.35rem;
  vertical-align: middle;
  line-height: 1.2;
}

#order-table.jd-order-table td.jd-offer-col {
  text-align: center;
}

.jd-product-thumb {
  position: relative;
  display: inline-block;
  padding: 0;
  margin: 0;
  border: 1px solid #eee;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
  width: 64px;
  height: 64px;
  line-height: 0;
  flex-shrink: 0;
}

.jd-product-thumb img {
  width: 64px !important;
  height: 64px;
  object-fit: contain;
  display: block;
  padding: 4px;
}

.jd-product-thumb-zoom {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(237, 50, 55, 0.55);
  color: #fff;
  opacity: 0;
  transition: opacity 0.2s;
  font-size: 0.95rem;
}

.jd-product-thumb:hover .jd-product-thumb-zoom,
.jd-product-thumb:focus .jd-product-thumb-zoom {
  opacity: 1;
}

/* Qty controls */
.jd-qty-control {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  justify-content: flex-end;
}

.jd-qty-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--jd-brand-light);
  background: var(--jd-brand-mist);
  color: var(--jd-brand);
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.jd-qty-btn:hover {
  background: var(--jd-brand);
  color: #fff;
}

.jd-qty-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.qty_control,
.num-pallets-input {
  width: 52px !important;
  height: 34px;
  margin: 0 !important;
  text-align: center;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  color: #222;
  -moz-appearance: textfield;
}

.qty_control::-webkit-outer-spin-button,
.qty_control::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.strikeout::after {
  border-bottom: 0.125em solid #080808;
  content: "";
  left: 0;
  margin-top: calc(0.125em / 2 * -1);
  position: absolute;
  right: 0;
  top: 50%;
  z-index: 0;
}

.strikeout {
  position: relative;
  color: red;
}

.red_alert {
  display: none;
}

tr.red_alert td {
  background-color: #989191 !important;
}

.label-danger,
.stock-badge {
  display: inline-block;
  background: #dc3545;
  color: #fff;
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  margin-left: 0.35rem;
  font-weight: 600;
}

/* Checkout section */
.jd-checkout-section {
  max-width: 900px;
  margin: 2rem auto 0;
  padding: 0 1rem;
}

.jd-checkout-card,
.jd-payment-card,
.jd-terms-card,
.jd-cart-panel {
  background: #fff;
  border-radius: var(--jd-radius);
  box-shadow: var(--jd-shadow);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.jd-checkout-card h3,
.jd-payment-card h3,
.jd-terms-card h3,
.jd-cart-panel h3 {
  color: var(--jd-brand);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--jd-brand-mist);
}

.jd-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.jd-form-group {
  margin-bottom: 0;
}

.jd-form-group.jd-full {
  grid-column: 1 / -1;
}

.jd-form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  color: #333;
  margin-bottom: 0.35rem;
}

.jd-form-group .form-control {
  width: 100% !important;
  margin: 0 !important;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 0.6rem 0.85rem;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.jd-form-group .form-control:focus {
  border-color: var(--jd-brand);
  outline: none;
  box-shadow: 0 0 0 3px rgba(237, 50, 55, 0.15);
}

.jd-submit-wrap {
  grid-column: 1 / -1;
  text-align: center;
  padding-top: 0.5rem;
}

#submit_btns {
  min-width: 220px;
  padding: 0.75rem 2rem;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: 999px;
  border: none;
  background: var(--jd-brand) !important;
  color: #fff !important;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

#submit_btns:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(237, 50, 55, 0.35);
}

#submit_btns:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

label.error {
  color: #f00;
  font-size: 0.82rem;
  margin-top: 0.25rem;
  display: block;
}

/* Payment */
.jd-payment-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  text-align: center;
}

.jd-payment-grid img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.jd-payment-note {
  font-weight: 700;
  color: #f00;
  margin-top: 1rem;
  font-size: 0.9rem;
}

/* Terms */
.jd-terms-card ul {
  list-style: disc;
  padding-left: 1.25rem;
  margin: 0;
}

.jd-terms-card li {
  margin-bottom: 0.5rem;
  line-height: 1.5;
  font-size: 0.9rem;
}

.jd-cart-panel {
  max-width: 900px;
  margin: 1.5rem auto;
}

.jd-cart-table-wrap {
  overflow-x: auto;
}

.jd-cart-table th {
  background: var(--jd-brand);
  color: #fff;
  border: none;
  font-size: 0.85rem;
}

.jd-cart-table td {
  vertical-align: middle;
  font-size: 0.9rem;
}

.jd-cart-empty td {
  text-align: center;
  color: #777;
  padding: 1.25rem !important;
}

.jd-cart-remove {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: #fde8e8;
  color: #c1121f;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.jd-cart-qty {
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.jd-cart-qty-input {
  width: 48px !important;
  height: 34px;
  margin: 0 !important;
  text-align: center;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-weight: 600;
  font-family: var(--jd-font) !important;
  font-variant-numeric: lining-nums tabular-nums;
}

.jd-cart-panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 2px solid var(--jd-brand-mist);
}

.jd-cart-min-note {
  margin: 0;
  font-size: 0.9rem;
  color: #555;
}

.jd-cart-grand {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--jd-brand);
}

.jd-img-modal[hidden] {
  display: none;
}

.jd-img-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.jd-img-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 10, 32, 0.78);
}

.jd-img-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.jd-img-modal-close {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.jd-img-modal-media {
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
}

.jd-img-modal-media img {
  max-width: 100%;
  max-height: 62vh;
  object-fit: contain;
}

.jd-img-modal-info {
  padding: 1.1rem 1.25rem 1.35rem;
}

.jd-img-modal-info h3 {
  margin: 0.45rem 0 0.2rem;
  color: var(--jd-brand);
  font-size: 1.25rem;
}

.jd-img-modal-unit {
  margin: 0 0 0.65rem;
  color: #666;
  font-size: 0.9rem;
}

.jd-img-modal-prices {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
}

.jd-img-modal-mrp {
  text-decoration: line-through;
  color: #888;
}

.jd-img-modal-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--jd-success);
}

.jd-img-modal-video {
  display: inline-block;
  margin-top: 0.85rem;
  font-weight: 600;
  color: var(--jd-brand);
}

body.jd-img-modal-open {
  overflow: hidden;
}

/* Float buttons */
.jd-float-whatsapp {
  position: fixed;
  bottom: 80px;
  right: 16px;
  z-index: 998;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.45);
  text-decoration: none;
}

.jd-float-whatsapp:hover {
  color: #fff;
  transform: scale(1.05);
}

/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

@media screen and (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Mobile */
@media (max-width: 767px) {
  .jd-cart-bar {
    top: 0;
    padding: 0.55rem 0.75rem;
    margin: 0.5rem 0;
  }

  .jd-cart-bar-label {
    display: none;
  }

  .jd-cart-bar-amount {
    font-size: 1.1rem;
  }

  .jd-cart-bar-meta {
    font-size: 0.72rem;
    display: inline;
  }

  .jd-cart-bar-meta::before {
    content: '·';
    margin: 0 0.2rem;
  }

  .jd-cart-stats {
    gap: 0.5rem;
  }

  .jd-cart-stat {
    min-width: 70px;
  }

  .jd-cart-stat-label {
    font-size: 0.65rem;
  }

  .jd-cart-stat-value {
    font-size: 0.85rem;
  }

  .jd-col-hide-mobile {
    display: none !important;
  }

  .jd-mobile-price {
    display: block;
  }

  .jd-cart-bar-link-full {
    display: none;
  }

  .jd-cart-bar-link-short {
    display: inline;
  }

  .jd-product-card {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 0.4rem 0.55rem;
    padding: 0.7rem 0.65rem;
  }

  .jd-product-main {
    gap: 0.55rem;
    min-width: 0;
  }

  .jd-product-price {
    align-items: flex-end;
    padding-left: 0;
  }

  .jd-product-qty {
    align-self: center;
  }

  .jd-product-name {
    font-size: 0.8rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .jd-price-mrp {
    font-size: 0.72rem;
  }

  .jd-price-net {
    font-size: 0.98rem;
  }

  .jd-row-total {
    display: none;
  }

  .jd-product-thumb,
  .jd-product-thumb img {
    width: 52px !important;
    height: 52px;
  }

  .jd-qty-btn {
    width: 32px;
    height: 32px;
  }

  .qty_control,
  .num-pallets-input {
    width: 40px !important;
    height: 32px;
  }

  .jd-img-modal-media img {
    max-height: 50vh;
  }

  #order-table.jd-order-table tbody td {
    font-size: 0.8rem;
    padding: 0.5rem 0.35rem;
  }

  #order-table.jd-order-table tr.sub td {
    font-size: 0.88rem;
    padding: 0.65rem 0.5rem;
  }

  .jd-qty-btn {
    width: 30px;
    height: 30px;
    font-size: 1rem;
  }

  .qty_control,
  .num-pallets-input {
    width: 42px !important;
    height: 30px;
    font-size: 0.88rem;
  }

  .jd-form-grid {
    grid-template-columns: 1fr;
  }

  .jd-payment-grid {
    grid-template-columns: 1fr;
  }

  .jd-checkout-section {
    padding: 0 0.65rem;
  }

  .jd-checkout-card,
  .jd-payment-card,
  .jd-terms-card,
  .jd-cart-panel {
    padding: 1rem;
  }

  #showdis.jd-cart-bar-bottom {
    padding: 0.5rem 0.65rem;
  }

  body.jd-order-has-bottom-bar {
    padding-bottom: 70px;
  }
}

@media (max-width: 420px) {
  .jd-product-card {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "main qty"
      "price qty";
  }

  .jd-product-main { grid-area: main; }
  .jd-product-price {
    grid-area: price;
    align-items: flex-start;
    padding-left: 60px;
  }
  .jd-product-qty { grid-area: qty; }
}

@media (min-width: 768px) {
  .jd-order-table-wrap {
    overflow-x: auto;
  }
}
