/**
 * Isolated KingEvent 2.8.4-style cart UI adapted to GlassCommerce theme colors.
 * No global WooCommerce layout rules are changed here.
 */

/* Inherit the website palette instead of imposing external brand colors. */
.gc-cart-drawer,
.gc-ke-cart-control {
  --gc-ke-primary: var(--gc-primary, #00b86b);
  --gc-ke-secondary: var(--gc-primary-2, #6c5ce7);
  --gc-ke-primary-soft: color-mix(in srgb, var(--gc-ke-primary) 9%, #fff);
  --gc-ke-secondary-soft: color-mix(in srgb, var(--gc-ke-secondary) 8%, #fff);
}

/* Drawer tabs — same compact two-tab anatomy as KingEvent 2.8.4. */
.gc-cart-drawer .gc-cart-tabs {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin: 0 14px 12px;
  padding: 5px;
  direction: rtl;
  background: var(--gc-ke-primary-soft);
  border: 1px solid color-mix(in srgb, var(--gc-ke-primary) 13%, transparent);
  border-radius: 15px;
}
.gc-cart-drawer .gc-cart-tabs .gc-drawer-tab {
  position: relative;
  min-width: 0;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 34px 8px 8px;
  color: var(--gc-muted);
  background: transparent;
  border: 0;
  border-radius: 11px;
  font: inherit;
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}
.gc-cart-drawer .gc-cart-tabs .gc-drawer-tab > svg {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  padding: 6px;
  color: var(--gc-ke-primary);
  background: var(--gc-ke-primary-soft);
  border-radius: 8px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.gc-cart-drawer .gc-cart-tabs .gc-drawer-tab.is-active,
.gc-cart-drawer .gc-cart-tabs .gc-drawer-tab[aria-selected="true"] {
  color: var(--gc-ke-primary);
  background: #fff;
  box-shadow: 0 5px 16px color-mix(in srgb, var(--gc-ke-primary) 12%, transparent);
}
.gc-cart-drawer .gc-cart-tabs .gc-drawer-tab.is-active > svg,
.gc-cart-drawer .gc-cart-tabs .gc-drawer-tab[aria-selected="true"] > svg {
  color: #fff;
  background: var(--gc-ke-primary);
}
.gc-cart-drawer .gc-cart-tabs .gc-cart-count,
.gc-cart-drawer .gc-cart-tabs .gc-shopping-list-count {
  position: absolute !important;
  top: 50% !important;
  right: 8px !important;
  left: auto !important;
  min-width: 22px !important;
  height: 22px !important;
  padding: 0 5px !important;
  display: grid !important;
  place-items: center !important;
  color: var(--gc-ke-primary) !important;
  background: #fff !important;
  border: 1px solid color-mix(in srgb, var(--gc-ke-primary) 14%, transparent) !important;
  border-radius: 20px !important;
  box-shadow: none !important;
  font-size: 9px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  transform: translateY(-50%) !important;
}

/* Drawer panel reset — strictly scoped. */
.gc-cart-drawer .gc-drawer-tab-panel {
  padding: 0 14px 16px;
  direction: rtl;
  text-align: right;
}
.gc-cart-drawer .gc-ke-cart-items-content,
.gc-cart-drawer .gc-shopping-list-content,
.gc-cart-drawer .gc-ke-mini-list,
.gc-cart-drawer .gc-shopping-list-items {
  direction: rtl;
  text-align: right;
}

/* Cart and saved-list cards use the same geometry. */
.gc-cart-drawer .gc-ke-mini-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.gc-cart-drawer .gc-ke-mini-item,
.gc-cart-drawer .gc-shopping-list-item {
  position: relative;
  width: 100%;
  min-height: 88px;
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 12px;
  margin: 0 0 10px;
  padding: 11px;
  overflow: visible;
  direction: rtl;
  text-align: right;
  background: #fff;
  border: 1px solid var(--gc-line);
  border-radius: 16px;
  box-shadow: var(--gc-shadow-soft);
}
.gc-cart-drawer .gc-ke-mini-thumb,
.gc-cart-drawer .gc-shopping-list-thumb {
  width: 64px;
  height: 64px;
  display: block;
  overflow: hidden;
  align-self: start;
  background: #fff;
  border-radius: 12px;
}
.gc-cart-drawer .gc-ke-mini-thumb img,
.gc-cart-drawer .gc-shopping-list-thumb img {
  width: 64px !important;
  height: 64px !important;
  display: block !important;
  margin: 0 !important;
  object-fit: cover;
  border-radius: 12px;
}
.gc-cart-drawer .gc-ke-mini-copy,
.gc-cart-drawer .gc-shopping-list-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  direction: rtl;
  text-align: right;
}
.gc-cart-drawer .gc-ke-mini-title,
.gc-cart-drawer .gc-shopping-list-title {
  display: -webkit-box;
  overflow: hidden;
  color: var(--gc-text) !important;
  text-decoration: none !important;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.65;
  white-space: normal;
  text-overflow: initial;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.gc-cart-drawer .gc-ke-mini-variation,
.gc-cart-drawer .gc-shopping-list-variation {
  margin-top: 3px;
  color: var(--gc-muted);
  font-size: 10px;
  line-height: 1.6;
}
.gc-cart-drawer .gc-ke-mini-variation:empty { display: none; }
.gc-cart-drawer .gc-ke-mini-variation dl,
.gc-cart-drawer .gc-ke-mini-variation dt,
.gc-cart-drawer .gc-ke-mini-variation dd {
  margin: 0 0 0 3px !important;
  float: none !important;
  display: inline;
  direction: rtl;
  text-align: right;
}
.gc-cart-drawer .gc-ke-mini-meta,
.gc-cart-drawer .gc-shopping-list-meta {
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--gc-muted);
  font-size: 10px;
}
.gc-cart-drawer .gc-ke-mini-meta strong,
.gc-cart-drawer .gc-shopping-list-meta > span {
  color: var(--gc-ke-primary);
  font-size: 11px;
  font-weight: 900;
}
.gc-cart-drawer .gc-shopping-list-meta > small { color: var(--gc-muted); font-size: 10px; }
.gc-cart-drawer .gc-ke-mini-actions,
.gc-cart-drawer .gc-shopping-list-actions {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 6px;
  direction: rtl;
}
.gc-cart-drawer .gc-ke-mini-actions a,
.gc-cart-drawer .gc-shopping-list-actions button {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 8px;
  text-decoration: none !important;
  font: inherit;
  font-size: 9px;
  font-weight: 900;
  line-height: 1.4;
  cursor: pointer;
}
.gc-cart-drawer .gc-ke-mini-actions svg,
.gc-cart-drawer .gc-shopping-list-actions svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.gc-cart-drawer .gc-ke-move-later,
.gc-cart-drawer .gc-list-primary {
  flex: 0 1 auto;
  color: var(--gc-ke-secondary) !important;
  background: var(--gc-ke-secondary-soft) !important;
  border: 1px solid color-mix(in srgb, var(--gc-ke-secondary) 12%, transparent) !important;
  box-shadow: none !important;
}
.gc-cart-drawer .gc-ke-mini-remove,
.gc-cart-drawer .gc-list-remove {
  width: auto;
  height: auto;
  color: #a43c48 !important;
  background: #fff1f2 !important;
  border: 1px solid #ffe1e4 !important;
  box-shadow: none !important;
}
.gc-cart-drawer .gc-ke-mini-remove:hover,
.gc-cart-drawer .gc-list-remove:hover { color: #8d2935 !important; background: #ffe8eb !important; }

/* Existing saved-list toolbar is retained, only visually integrated. */
.gc-cart-drawer .gc-shopping-list-toolbar {
  margin: 0 0 10px;
  padding: 8px 9px;
  border-color: var(--gc-line);
  border-radius: 12px;
  background: rgba(255,255,255,.74);
  font-size: 9px;
}
.gc-cart-drawer .gc-list-toolbar-btn {
  color: var(--gc-ke-secondary);
  background: var(--gc-ke-secondary-soft);
}
.gc-cart-drawer .gc-list-toolbar-btn-danger { color: #a43c48; background: #fff1f2; }

/* Empty states. */
.gc-cart-drawer .gc-ke-empty,
.gc-cart-drawer .gc-list-empty {
  min-height: 0;
  padding: 46px 18px;
  display: block;
  color: var(--gc-muted);
  text-align: center;
  background: transparent;
  border: 0;
  border-radius: 0;
}
.gc-cart-drawer .gc-ke-empty-icon,
.gc-cart-drawer .gc-list-empty-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  color: var(--gc-ke-secondary);
  background: var(--gc-ke-secondary-soft);
  border-radius: 17px;
  box-shadow: none;
  font-size: 22px;
}
.gc-cart-drawer .gc-ke-empty-icon svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.gc-cart-drawer .gc-ke-empty strong,
.gc-cart-drawer .gc-list-empty strong { display: block; color: var(--gc-text); font-size: 13px; }
.gc-cart-drawer .gc-ke-empty p,
.gc-cart-drawer .gc-list-empty small { max-width: 250px; margin: 7px auto 0; color: var(--gc-muted); font-size: 11px; line-height: 1.9; }

/* Drawer footer. */
.gc-cart-drawer .gc-ke-cart-summary {
  margin-top: 12px;
  padding-top: 13px;
  direction: rtl;
  text-align: right;
  border-top: 1px solid var(--gc-line);
}
.gc-cart-drawer .gc-ke-cart-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--gc-muted);
  font-size: 11px;
}
.gc-cart-drawer .gc-ke-cart-total strong { color: var(--gc-text); font-size: 13px; font-weight: 900; }
.gc-cart-drawer .gc-ke-cart-buttons { margin-top: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.gc-cart-drawer .gc-ke-cart-buttons a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border-radius: 10px;
  text-decoration: none !important;
  font-size: 10px;
  font-weight: 900;
}
.gc-cart-drawer .gc-ke-view-cart { color: var(--gc-ke-secondary) !important; background: var(--gc-ke-secondary-soft); border: 1px solid color-mix(in srgb, var(--gc-ke-secondary) 13%, transparent); }
.gc-cart-drawer .gc-ke-checkout { color: #fff !important; background: var(--gc-ke-primary); border: 1px solid var(--gc-ke-primary); }

/* Product card and single-product quantity control. */
.gc-ke-cart-control {
  width: 154px;
  min-height: 41px;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 10px;
  padding: 3px;
  direction: ltr;
}
.gc-ke-cart-control.is-visible { display: inline-flex; }
.gc-ke-cart-stepper {
  min-width: 112px;
  min-height: 39px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--gc-ke-primary) 20%, transparent);
  border-radius: 11px;
  box-shadow: 0 5px 15px rgba(32,42,70,.055);
}
.gc-ke-cart-control button {
  width: 35px;
  height: 37px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0 !important;
  color: var(--gc-ke-primary) !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  cursor: pointer;
  transform: none !important;
}
.gc-ke-cart-control button:hover { background: var(--gc-ke-primary-soft) !important; }
.gc-ke-cart-control button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.gc-ke-cart-control strong { min-width: 24px; color: var(--gc-text); text-align: center; font-size: 13px; font-weight: 900; }
.gc-ke-cart-control .gc-ke-cart-remove {
  width: 36px;
  height: 39px;
  color: #8b838e !important;
  background: #fff !important;
  border: 1px solid color-mix(in srgb, var(--gc-ke-primary) 17%, transparent) !important;
  border-radius: 10px !important;
  box-shadow: 0 5px 15px rgba(32,42,70,.045) !important;
}
.gc-ke-cart-control .gc-ke-cart-remove:hover { color: #b43847 !important; background: #fff1f2 !important; border-color: #ffdce1 !important; }
.gc-ke-cart-control.is-loading { opacity: .6; pointer-events: none; }
.woocommerce ul.products li.product .gc-ke-cart-control,
.wc-block-grid__product .gc-ke-cart-control { margin-right: auto; margin-left: auto; }
.woocommerce ul.products li.product .button.gc-ke-is-in-cart,
.wc-block-grid__product .button.gc-ke-is-in-cart,
form.cart .single_add_to_cart_button.gc-ke-is-in-cart,
.added_to_cart.gc-ke-hide-view-cart { display: none !important; }
form.cart .quantity.gc-ke-native-quantity-hidden { display: none !important; }
.single-product form.cart .gc-ke-cart-control { width: 178px; min-height: 50px; margin: 0; }
.single-product form.cart .gc-ke-cart-stepper { min-width: 132px; min-height: 48px; border-radius: 12px; }
.single-product form.cart .gc-ke-cart-control .gc-ke-cart-remove { width: 40px; height: 48px; }
.single-product form.cart .gc-ke-cart-control button:not(.gc-ke-cart-remove) { width: 43px; height: 46px; }

@media (max-width: 420px) {
  .gc-cart-drawer .gc-cart-tabs .gc-drawer-tab { min-height: 46px; padding-right: 31px; font-size: 10px; }
  .gc-cart-drawer .gc-cart-tabs .gc-cart-count,
  .gc-cart-drawer .gc-cart-tabs .gc-shopping-list-count { right: 6px !important; min-width: 20px !important; height: 20px !important; font-size: 8px !important; }
}
