/*
 * WGE slide-out cart — inc/wge-cart-drawer.php + js/wge-cart-drawer.js.
 * Loaded wherever a product can be added (not cart/checkout).
 */

.wge-drawer {
  position: fixed;
  inset: 0;
  z-index: 99999;
}

.wge-drawer[hidden] {
  display: none;
}

.wge-drawer__scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  opacity: 0;
  transition: opacity .25s ease;
}

.wge-drawer.is-open .wge-drawer__scrim {
  opacity: 1;
}

.wge-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 360px;
  max-width: 92vw;
  background: #fff;
  box-shadow: -4px 0 24px rgba(0, 0, 0, .25);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform .25s ease;
}

.wge-drawer.is-open .wge-drawer__panel {
  transform: translateX(0);
}

@media (prefers-reduced-motion: reduce) {

  .wge-drawer__scrim,
  .wge-drawer__panel {
    transition: none;
  }
}

.wge-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  background: #000;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 1;
}

.wge-drawer__title {
  font-family: bebas neue, sans-serif;
  font-size: 22px;
  letter-spacing: 1.5px;
  margin: 0;
  color: #fff;
}

.wge-drawer__close {
  background: none;
  border: 0;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
}

.wge-drawer__body {
  padding: 16px 18px 24px;
}

.wge-drawer__empty {
  font-family: lato, sans-serif;
  color: #55585c;
  margin: 10px 0;
}

.wge-drawer__items {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
}

.wge-drawer__item {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #ececec;
}

.wge-drawer__item::before {
  content: none;
}

.wge-drawer__thumb img {
  width: 56px;
  height: auto;
  display: block;
}

.wge-drawer__meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.wge-drawer__name {
  font-family: lato, sans-serif;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.wge-drawer__name a {
  color: #2b2d2f;
}

.wge-drawer__qty {
  font-family: lato, sans-serif;
  font-size: 12px;
  color: #55585c;
}

.wge-drawer__subtotal {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-family: lato, sans-serif;
  font-size: 15px;
  padding: 10px 0 14px;
}

.wge-drawer__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.wge-drawer__btn {
  display: block;
  text-align: center;
  padding: 11px 8px;
  background: #af111c;
  color: #fff;
  font-family: lato, sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.wge-drawer__btn:hover,
.wge-drawer__btn:focus {
  background: #8c0d16;
  color: #fff;
}

.wge-drawer__btn--ghost {
  background: #fff;
  color: #2b2d2f;
  border: 1px solid #cfcfcf;
}

.wge-drawer__btn--ghost:hover,
.wge-drawer__btn--ghost:focus {
  background: #f3f3f3;
  color: #2b2d2f;
}

.wge-drawer__continue {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 6px;
  background: none;
  border: 0;
  font-family: lato, sans-serif;
  font-size: 12px;
  text-decoration: underline;
  color: #55585c;
  cursor: pointer;
}

/* --- cross-sell --- */

.wge-drawer__crosssell {
  margin-top: 22px;
  border-top: 1px solid #ececec;
  padding-top: 14px;
}

.wge-drawer__crosssell h3 {
  font-family: bebas neue, sans-serif;
  font-size: 20px;
  letter-spacing: 1px;
  margin: 0 0 10px;
}

.wge-drawer__crosssell ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.wge-drawer__crosssell li::before {
  content: none;
}

.wge-drawer__crosssell a {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 10px;
  align-items: center;
  color: #2b2d2f;
}

.wge-drawer__crosssell img {
  width: 44px;
  height: auto;
  display: block;
}

.wge-drawer__cross-name {
  font-family: lato, sans-serif;
  font-size: 12px;
  line-height: 1.3;
}

.wge-drawer__cross-price {
  font-family: lato, sans-serif;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.wge-drawer__cross-price del {
  display: none;
}

/* Stop the page scrolling behind the panel. */
body.wge-drawer-open {
  overflow: hidden;
}

@media only screen and (max-width: 480px) {

  .wge-drawer__panel {
    width: 100%;
    max-width: 100%;
  }
}
