/* ecom5 + Royal Tech integration */
body.rt-body { background: var(--rt-bg); }
body.rt-body main { min-height: 50vh; }

.announcement-rt {
  background: var(--rt-navy-dark);
  color: #dfe8ec;
  text-align: center;
  padding: .45rem 1rem;
  font-size: .88rem;
  font-weight: 600;
}

.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(30, 43, 50, .45);
  opacity: 0; visibility: hidden; transition: .2s; z-index: 1040;
}
.drawer-backdrop.show { opacity: 1; visibility: visible; }
.cart-drawer {
  position: fixed; top: 0; inset-inline-end: 0; width: min(420px, 100%);
  height: 100%; background: #fff; z-index: 1050;
  transform: translateX(110%); transition: .25s ease;
  box-shadow: -8px 0 30px rgba(0,0,0,.12); display: flex; flex-direction: column;
}
[dir="rtl"] .cart-drawer { transform: translateX(-110%); box-shadow: 8px 0 30px rgba(0,0,0,.12); }
.cart-drawer.show { transform: translateX(0); }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid #e8eef1;
}
.drawer-head h3 { margin: 0; font-size: 1.05rem; font-weight: 800; color: var(--rt-navy); }
.drawer-close {
  border: 0; background: #e9f0f4; width: 36px; height: 36px; border-radius: 10px;
  font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--rt-navy);
}
#cartDrawerBody { padding: 16px; overflow: auto; flex: 1; }
.cart-drawer-item {
  display: grid; grid-template-columns: 72px 1fr auto; gap: 12px; align-items: start;
  padding: 12px 0; border-bottom: 1px solid #e8eef1;
}
.cart-drawer-item img {
  width: 72px; height: 72px; object-fit: contain; background: #f2f6f8;
  border-radius: 10px; padding: 6px;
}
.cart-drawer-item h4 { margin: 0 0 4px; font-size: .92rem; font-weight: 800; color: var(--rt-ink); line-height: 1.35; }
.cart-drawer-item small { color: var(--rt-muted); font-size: .78rem; }
.cart-drawer-item p { margin: 6px 0 0; font-weight: 800; color: var(--rt-navy); font-size: .9rem; }
.cart-drawer-item .remove-link {
  border: 0; background: #fdecea; color: #c0392b; width: 32px; height: 32px;
  border-radius: 8px; font-size: 1.2rem; line-height: 1; cursor: pointer;
}
.cart-drawer-footer { padding-top: 12px; border-top: 1px solid #e8eef1; margin-top: 8px; }
.cart-drawer-footer p { font-size: .82rem; color: var(--rt-muted); margin-bottom: 10px; }
.free-shipping-bar { height: 6px; background: #e8eef1; border-radius: 99px; overflow: hidden; margin-bottom: 12px; }
.free-shipping-bar span { display: block; height: 100%; background: var(--rt-navy); border-radius: 99px; }
.cart-drawer .summary-line.total { font-weight: 800; color: var(--rt-navy); margin: 8px 0 12px; }
.cart-drawer .checkout-btn { width: 100%; text-align: center; text-decoration: none; }

.toast-stack { position: fixed; top: 88px; inset-inline-start: 16px; z-index: 1060; display: grid; gap: 8px; }
.toast {
  background: var(--rt-navy); color: #fff; padding: 12px 16px; border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.15); display: flex; gap: 10px; align-items: center;
}
.toast.error { background: #c0392b; }
.toast-close { border: 0; background: transparent; color: inherit; font-size: 1.2rem; cursor: pointer; }

.rt-product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}
@media (max-width: 1199.98px) { .rt-product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 991.98px) { .rt-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575.98px) { .rt-product-grid { grid-template-columns: 1fr; } }

.rt-card-wrap { min-width: 0; }
.rt-card { overflow: hidden; }
.rt-card .product-body { padding: 1rem 1.1rem 1.15rem; display: flex; flex-direction: column; gap: .35rem; }
.rt-card .product-brand { color: var(--rt-muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }
.rt-card .product-title { font-weight: 800; font-size: .95rem; line-height: 1.45; margin: 0; }
.rt-card .product-title a { color: var(--rt-ink); }
.rt-card .product-title a:hover { color: var(--rt-navy); }
.rt-card .badge-wrap { position: absolute; top: 12px; inset-inline-start: 12px; display: flex; flex-wrap: wrap; gap: 6px; z-index: 2; }
.rt-card .badge-sale { background: #c0392b; color: #fff; font-size: .72rem; padding: .2rem .5rem; border-radius: 8px; font-weight: 700; }
.rt-card .badge-new { background: var(--rt-navy); color: #fff; font-size: .72rem; padding: .2rem .5rem; border-radius: 8px; font-weight: 700; }
.rt-card .badge-sold { background: #6b7f89; color: #fff; font-size: .72rem; padding: .2rem .5rem; border-radius: 8px; font-weight: 700; }

.rt-cat-card {
  display: flex; align-items: center; gap: 1rem;
  background: #fff; border: 1px solid #e8eef1; border-radius: 18px;
  padding: 1.1rem 1.2rem; height: 100%; transition: .28s; color: inherit;
}
.rt-cat-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(30,43,50,.1); border-color: #cfdde4; color: inherit; }
.rt-cat-card img { width: 64px; height: 64px; object-fit: contain; background: #f2f6f8; border-radius: 14px; flex-shrink: 0; padding: 8px; }

.whats-float {
  position: fixed; bottom: 22px; inset-inline-end: 22px; width: 56px; height: 56px;
  background: #25d366; color: #fff; border-radius: 50%; display: grid; place-items: center;
  font-size: 1.6rem; box-shadow: 0 8px 24px rgba(0,0,0,.2); z-index: 1000;
}
.whats-float:hover { color: #fff; transform: scale(1.07); }

.rt-footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem;
}
.rt-footer-dev-link { color: #fff; opacity: .9; font-weight: 700; }
.rt-footer-dev-link:hover { color: #fff; opacity: 1; }

.rt-pagination { display: flex; gap: 8px; justify-content: center; margin-top: 2rem; flex-wrap: wrap; }
.rt-pagination a {
  min-width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 10px; border: 1px solid #dbe3e7; color: var(--rt-ink); font-weight: 700;
}
.rt-pagination a.active, .rt-pagination a:hover { background: var(--rt-navy); color: #fff; border-color: var(--rt-navy); }

.rt-quick-modal {
  position: fixed; inset: 0; z-index: 2000; display: none; align-items: center; justify-content: center;
  padding: 1rem; background: rgba(30,43,50,.5);
}
.rt-quick-modal.show { display: flex; }
.rt-quick-modal-dialog {
  background: #fff; border-radius: 18px; max-width: 520px; width: 100%; padding: 1.5rem; position: relative;
}
.rt-quick-modal-close {
  position: absolute; top: 12px; inset-inline-start: 12px; border: 0; background: #e9f0f4;
  width: 36px; height: 36px; border-radius: 10px; font-size: 1.3rem; cursor: pointer;
}

.shop-products .filter-box .btn-rt { width: 100%; }

/* Product detail page (Royal theme) */
body.rt-body .product-page { padding: 2rem 0 4rem; }
body.rt-body .product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: start; }
body.rt-body .gallery { display: grid; grid-template-columns: 92px 1fr; gap: 1rem; }
body.rt-body .gallery-thumbs { display: flex; flex-direction: column; gap: .75rem; }
body.rt-body .gallery-thumb { border: 2px solid #e8eef1; background: #fff; padding: 0; border-radius: 10px; overflow: hidden; cursor: pointer; }
body.rt-body .gallery-thumb.active { border-color: var(--rt-navy); }
body.rt-body .gallery-thumb img { width: 90px; aspect-ratio: 1; object-fit: cover; }
body.rt-body .gallery-main { background: #f2f6f8; border-radius: 16px; overflow: hidden; }
body.rt-body .gallery-main img { width: 100%; aspect-ratio: 1; object-fit: contain; }
body.rt-body .product-info .brand { font-size: .75rem; letter-spacing: .12em; color: var(--rt-muted); text-transform: uppercase; }
body.rt-body .product-info h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800; margin: .5rem 0 1rem; color: var(--rt-ink); }
body.rt-body .product-price { font-size: 1.4rem; font-weight: 800; display: flex; gap: .75rem; align-items: center; }
body.rt-body .product-description { color: var(--rt-muted); border-top: 1px solid #e8eef1; padding-top: 1rem; margin-top: 1rem; }
body.rt-body .product-variant-grid { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
body.rt-body .product-variant { border: 2px solid #e8eef1; border-radius: 12px; padding: 4px; background: #fff; width: 52px; height: 52px; }
body.rt-body .product-variant.active { border-color: var(--rt-navy); }
body.rt-body .product-variant img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
body.rt-body .product-buy-row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; margin-top: 1rem; }
body.rt-body .qty-control { display: flex; align-items: center; border: 1px solid #e8eef1; border-radius: 12px; overflow: hidden; }
body.rt-body .qty-control button { border: 0; background: #f2f6f8; width: 40px; height: 44px; }
body.rt-body .qty-control input { width: 52px; text-align: center; border: 0; }
body.rt-body .add-to-cart, body.rt-body #productAddBtn { background: var(--rt-navy); color: #fff; border: 0; border-radius: 12px; padding: .75rem 1.5rem; font-weight: 700; flex: 1; min-width: 180px; }
body.rt-body .breadcrumbs { font-size: .88rem; color: var(--rt-muted); margin-bottom: 1.5rem; }
body.rt-body .breadcrumbs a { color: var(--rt-navy); }
@media (max-width: 991px) {
  body.rt-body .product-detail, body.rt-body .gallery { grid-template-columns: 1fr; }
  body.rt-body .gallery-thumbs { flex-direction: row; flex-wrap: wrap; }
}
