/* A Lot Tech — modern Flatsome / WooCommerce mini cart */
:root {
  --alot-cart-ink: #151515;
  --alot-cart-muted: #6b7280;
  --alot-cart-line: #e9e9e7;
  --alot-cart-yellow: #ffc800;
  --alot-cart-yellow-hover: #f2bd00;
}

.header .cart-item .nav-dropdown {
  width: min(390px, calc(100vw - 32px));
  min-width: 360px;
  padding: 0;
  overflow: hidden;
  color: var(--alot-cart-ink);
  background: #fff;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(17, 17, 17, 0.18), 0 3px 12px rgba(17, 17, 17, 0.08);
}

/* Flatsome adds a dropdown pointer above the cart; the card looks cleaner without it. */
.header .nav-dropdown-has-arrow .cart-item.has-dropdown::before,
.header .nav-dropdown-has-arrow .cart-item.has-dropdown::after,
.header .cart-item.has-dropdown.current-dropdown::before,
.header .cart-item.has-dropdown.current-dropdown::after {
  display: none !important;
}

.header .cart-item .nav-dropdown::before {
  content: "ตะกร้าของคุณ";
  display: block;
  padding: 20px 22px 16px;
  color: var(--alot-cart-ink);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
  border-bottom: 1px solid var(--alot-cart-line);
}

.header .cart-item .nav-dropdown > .html {
  padding: 0;
}

.header .cart-item .widget_shopping_cart_content {
  color: var(--alot-cart-ink);
}

.header .cart-item .woocommerce-mini-cart {
  max-height: min(48vh, 420px);
  padding: 4px 22px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #cacaca transparent;
}

.header .cart-item .mini_cart_item {
  position: relative;
  min-height: 104px;
  padding: 18px 36px 18px 92px;
  color: var(--alot-cart-ink);
  border-bottom: 1px solid var(--alot-cart-line);
}

.header .cart-item .mini_cart_item:last-child {
  border-bottom: 0;
}

.header .cart-item .mini_cart_item > a:not(.remove) {
  display: block;
  color: var(--alot-cart-ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  text-transform: none;
}

.header .cart-item .mini_cart_item img {
  position: absolute;
  top: 18px;
  left: 0;
  width: 74px;
  height: 74px;
  margin: 0;
  object-fit: contain;
  background: #f7f7f5;
  border: 1px solid #efefed;
  border-radius: 12px;
}

.header .cart-item .mini_cart_item .remove {
  top: 18px;
  right: 0;
  width: 26px;
  height: 26px;
  color: #737373;
  font-size: 20px;
  font-weight: 400;
  line-height: 23px;
  background: #f4f4f2;
  border: 0;
  border-radius: 50%;
  transition: color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.header .cart-item .mini_cart_item .remove:hover,
.header .cart-item .mini_cart_item .remove:focus-visible {
  color: #fff;
  background: #d92d20;
  transform: scale(1.06);
}

.header .cart-item .ux-mini-cart-qty {
  margin-top: 8px;
}

.header .cart-item .ux-mini-cart-qty .quantity {
  color: var(--alot-cart-muted);
  font-size: 13px;
  font-weight: 500;
}

.header .cart-item .ux-mini-cart-qty .amount {
  color: var(--alot-cart-ink);
  font-size: 15px;
  font-weight: 700;
}

.header .cart-item .ux-mini-cart-footer {
  padding: 18px 22px 22px;
  background: #fafaf8;
  border-top: 1px solid var(--alot-cart-line);
}

.header .cart-item .woocommerce-mini-cart__total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 16px;
  padding: 0;
  color: var(--alot-cart-muted);
  font-size: 14px;
  border: 0;
}

.header .cart-item .woocommerce-mini-cart__total .amount {
  color: var(--alot-cart-ink);
  font-size: 20px;
  font-weight: 750;
}

.header .cart-item .woocommerce-mini-cart__buttons {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 10px;
  margin: 0;
}

.header .cart-item .woocommerce-mini-cart__buttons .button {
  min-height: 46px;
  margin: 0;
  padding: 12px 14px;
  color: var(--alot-cart-ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  text-transform: none;
  background: #fff;
  border: 1px solid #d9d9d6;
  border-radius: 12px;
  box-shadow: none;
  transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.header .cart-item .woocommerce-mini-cart__buttons .button:hover {
  color: var(--alot-cart-ink);
  background: #f3f3f0;
  border-color: #bdbdb8;
  transform: translateY(-1px);
}

.header .cart-item .woocommerce-mini-cart__buttons .checkout {
  color: #111;
  background-color: var(--alot-cart-yellow) !important;
  border-color: var(--alot-cart-yellow) !important;
}

.header .cart-item .woocommerce-mini-cart__buttons .checkout:hover {
  color: #111;
  background-color: var(--alot-cart-yellow-hover) !important;
  border-color: var(--alot-cart-yellow-hover) !important;
}

.header .cart-item .woocommerce-mini-cart__empty-message {
  margin: 0;
  padding: 34px 22px 38px;
  color: var(--alot-cart-muted);
  text-align: center;
}

/* Flatsome off-canvas cart (mobile and touch layouts). */
.off-canvas-cart {
  width: min(420px, 100vw) !important;
  color: var(--alot-cart-ink);
  background: #fff;
}

.off-canvas-cart #cart-popup,
.off-canvas-cart .cart-popup-inner {
  min-height: 100dvh;
}

.off-canvas-cart .cart-popup-inner {
  display: flex;
  flex-direction: column;
  padding: 0;
}

.off-canvas-cart .cart-popup-title {
  padding: 22px 56px 18px 22px;
  text-align: left;
  border-bottom: 1px solid var(--alot-cart-line);
}

.off-canvas-cart .cart-popup-title .heading-font {
  color: var(--alot-cart-ink);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.35;
  text-transform: none;
}

.off-canvas-cart .cart-popup-title .is-divider {
  display: none;
}

.off-canvas-cart .widget_shopping_cart,
.off-canvas-cart .widget_shopping_cart_content {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.off-canvas-cart .woocommerce-mini-cart {
  flex: 1;
  margin: 0;
  padding: 4px 22px;
  overflow-y: auto;
}

.off-canvas-cart .mini_cart_item {
  position: relative;
  min-height: 112px;
  padding: 20px 34px 20px 90px;
  border-bottom: 1px solid var(--alot-cart-line);
}

.off-canvas-cart .mini_cart_item > a:not(.remove) {
  display: block;
  color: var(--alot-cart-ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  text-transform: none;
}

.off-canvas-cart .mini_cart_item img {
  position: absolute;
  top: 20px;
  left: 0;
  width: 72px;
  height: 72px;
  margin: 0;
  object-fit: contain;
  background: #f7f7f5;
  border: 1px solid #efefed;
  border-radius: 12px;
}

.off-canvas-cart .mini_cart_item .remove {
  top: 20px;
  right: 0;
  width: 26px;
  height: 26px;
  color: #737373;
  font-size: 20px;
  line-height: 23px;
  background: #f4f4f2;
  border: 0;
  border-radius: 50%;
}

.off-canvas-cart .ux-mini-cart-qty {
  margin-top: 8px;
}

.off-canvas-cart .ux-mini-cart-qty .quantity {
  color: var(--alot-cart-muted);
  font-size: 13px;
  font-weight: 500;
}

.off-canvas-cart .ux-mini-cart-qty .amount {
  color: var(--alot-cart-ink);
  font-size: 15px;
  font-weight: 700;
}

.off-canvas-cart .ux-mini-cart-footer {
  position: sticky;
  bottom: 0;
  left: 0 !important;
  right: 0 !important;
  z-index: 2;
  box-sizing: border-box;
  width: 100% !important;
  margin: 0 !important;
  padding: 18px 22px max(22px, env(safe-area-inset-bottom));
  background: #fafaf8;
  border-top: 1px solid var(--alot-cart-line);
}

.off-canvas-cart .woocommerce-mini-cart__total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 16px;
  padding: 0;
  color: var(--alot-cart-muted);
  font-size: 14px;
  border: 0;
}

.off-canvas-cart .woocommerce-mini-cart__total .amount {
  color: var(--alot-cart-ink);
  font-size: 20px;
  font-weight: 750;
}

.off-canvas-cart .woocommerce-mini-cart__buttons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 0;
}

.off-canvas-cart .woocommerce-mini-cart__buttons .button {
  min-height: 48px;
  margin: 0;
  padding: 13px 16px;
  color: var(--alot-cart-ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  text-transform: none;
  background: #fff;
  border: 1px solid #d9d9d6;
  border-radius: 12px;
  box-shadow: none;
}

.off-canvas-cart .woocommerce-mini-cart__buttons .checkout {
  color: #111;
  background-color: var(--alot-cart-yellow) !important;
  border-color: var(--alot-cart-yellow) !important;
}

.off-canvas.mfp-wrap .mfp-close {
  top: 14px;
  right: 12px;
  color: #666;
}

@media (prefers-reduced-motion: no-preference) {
  .header .cart-item.current-dropdown .nav-dropdown {
    animation: alot-cart-reveal 180ms cubic-bezier(0.22, 1, 0.36, 1);
    transform-origin: top right;
  }

  @keyframes alot-cart-reveal {
    from { opacity: 0; transform: translateY(-6px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }
}

@media (max-width: 849px) {
  .header .cart-item .nav-dropdown {
    width: calc(100vw - 24px);
    min-width: 0;
    max-height: calc(100dvh - 96px);
    border-radius: 16px;
  }

  .header .cart-item .nav-dropdown::before {
    padding: 18px 18px 14px;
  }

  .header .cart-item .woocommerce-mini-cart {
    max-height: calc(100dvh - 310px);
    padding-inline: 18px;
  }

  .header .cart-item .ux-mini-cart-footer {
    padding: 16px 18px 18px;
  }
}

@media (max-width: 420px) {
  .header .cart-item .mini_cart_item {
    padding-left: 80px;
  }

  .header .cart-item .mini_cart_item img {
    width: 64px;
    height: 64px;
  }

  .header .cart-item .woocommerce-mini-cart__buttons {
    grid-template-columns: 1fr;
  }
}
