/* ==========================================================================
   itDealSg — Mega menu + Added-to-cart drawer (Nov 2026 design)
   Loaded on every page after product.css. Overrides the earlier mega menu
   and drawer styles; nothing else is touched.
   ========================================================================== */

/* ---------- "All categories" button: white with a close icon while open ---------- */
.itd-rednav__all[aria-expanded="true"] { background: #fff; color: var(--itd-red); }
.itd-rednav__all[aria-expanded="true"] .itd-ico { display: none; }
.itd-rednav__all[aria-expanded="true"]::before {
  content: ""; width: 16px; height: 16px; flex: 0 0 auto; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---------- Mega menu: floating card ---------- */
.itd-mega { background: transparent; border-top: 0; box-shadow: none; pointer-events: none; }
.itd-mega.is-open { pointer-events: auto; }
.itd-mega > .itd-wrap { padding-top: 0; }
.itd-mega .itd-mega__inner { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: 0; background: #fff; border-radius: 0 0 20px 20px; box-shadow: 0 24px 60px rgba(11,13,18,.22); overflow: hidden; max-height: calc(100vh - 170px); }

/* Departments */
.itd-mega .itd-mega__depts { background: #fff; border-right: 1px solid var(--itd-line); padding: 10px 0 14px; margin: 0; list-style: none; overflow-y: auto; }
.itd-mega .itd-mega__depts button { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 10px 22px; border: 0; background: transparent; font-size: 14px; font-weight: 500; color: var(--itd-ink); text-align: left; box-shadow: none; }
.itd-mega .itd-mega__depts button .itd-mega__chev { color: #9AA0AC; flex: 0 0 auto; }
.itd-mega .itd-mega__depts button:hover { background: var(--itd-soft); color: var(--itd-ink); box-shadow: none; }
.itd-mega .itd-mega__depts button.is-active { background: #FFF5F5; color: var(--itd-red); font-weight: 600; box-shadow: inset 3px 0 0 var(--itd-red); }
.itd-mega .itd-mega__depts button.is-active .itd-mega__chev { color: var(--itd-red); }

/* Panel: columns + chips on the left, deal card on the right */
.itd-mega .itd-mega__body { min-width: 0; overflow-y: auto; }
.itd-mega .itd-mega__panel { display: none; grid-template-columns: minmax(0, 1fr) 280px; gap: 28px; padding: 24px 24px 24px 28px; }
.itd-mega .itd-mega__panel.is-active { display: grid; }
.itd-mega .itd-mega__main { display: flex; flex-direction: column; min-width: 0; }
.itd-mega .itd-mega__title { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin: 4px 0 22px; }
.itd-mega .itd-mega__title strong { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: var(--itd-ink); }
.itd-body .itd-rednav .itd-mega__title a { color: var(--itd-red); font-size: 14px; font-weight: 600; white-space: nowrap; }
.itd-body .itd-rednav .itd-mega__title a:hover { color: var(--itd-red-dark); text-decoration: none; }
.itd-mega .itd-mega__cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; align-items: start; }
.itd-mega .itd-mega__col h4 { margin: 0 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--itd-line); font-size: 15px; font-weight: 700; line-height: 1.3; }
.itd-body .itd-rednav .itd-mega__col h4 a { color: var(--itd-ink); }
.itd-mega .itd-mega__col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.itd-body .itd-rednav .itd-mega__col li a { color: var(--itd-ink-3); font-size: 14px; font-weight: 400; }
.itd-body .itd-rednav .itd-mega__col a:hover { color: var(--itd-red); text-decoration: none; }

.itd-mega .itd-mega__foot { grid-column: auto; margin-top: auto; padding: 18px 0 0; border-top: 1px solid var(--itd-line); display: flex; flex-direction: column; gap: 12px; font-size: 14px; }
.itd-mega .itd-mega__cols + .itd-mega__foot { margin-top: 28px; }
.itd-mega .itd-mega__chiprow { display: flex; align-items: center; gap: 14px; }
.itd-mega .itd-mega__chiprow > strong { flex: 0 0 92px; font-size: 13px; color: var(--itd-ink-3); font-weight: 600; }
.itd-mega .itd-mega__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.itd-body .itd-rednav .itd-mega__chips a { display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border: 1px solid var(--itd-line-2); border-radius: 999px; color: var(--itd-ink); font-size: 13px; font-weight: 500; background: #fff; }
.itd-body .itd-rednav .itd-mega__chips a:hover { border-color: var(--itd-ink); text-decoration: none; }
.itd-body .itd-rednav .itd-mega__chips--need a { background: var(--itd-red-soft); border-color: transparent; color: var(--itd-red-dark); }
.itd-body .itd-rednav .itd-mega__chips--need a:hover { background: var(--itd-red-tint); border-color: transparent; color: var(--itd-red-dark); }

/* Deal of the day */
.itd-mega .itd-mega__deal { display: flex; flex-direction: column; border: 1px solid var(--itd-line); border-radius: 16px; overflow: hidden; background: #fff; align-self: stretch; padding: 0; gap: 0; }
.itd-body .itd-rednav a.itd-mega__dealimg { position: relative; display: block; height: 150px; background: var(--itd-soft); }
.itd-mega .itd-mega__dealimg .itd-media { height: 100%; background: transparent; }
.itd-mega .itd-mega__dealimg .itd-media > img { object-fit: contain; padding: 16px; }
.itd-mega .itd-mega__dealtag { position: absolute; top: 10px; left: 10px; z-index: 2; background: var(--itd-red); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 8px; border-radius: 6px; }
.itd-mega .itd-mega__dealbody { display: flex; flex-direction: column; gap: 4px; padding: 16px; flex: 1 1 auto; }
.itd-body .itd-rednav a.itd-mega__dealname { color: var(--itd-ink); font-size: 15px; font-weight: 700; line-height: 1.3; }
.itd-mega .itd-mega__dealspec { font-size: 12px; color: var(--itd-muted); }
.itd-mega .itd-mega__dealprice { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; }
.itd-mega .itd-mega__dealprice b { font-family: var(--itd-mono); font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.itd-mega .itd-mega__dealprice s { font-family: var(--itd-mono); font-size: 12px; color: var(--itd-faint); }
.itd-mega .itd-mega__dealeta { font-size: 12px; font-weight: 600; color: var(--itd-green); }
.itd-mega .itd-mega__dealnote { font-size: 12px; color: var(--itd-muted); }
.itd-body .itd-rednav a.itd-mega__dealbtn { display: flex; align-items: center; justify-content: center; height: 40px; margin-top: auto; border-radius: 8px; background: var(--itd-ink); color: #fff; font-size: 14px; font-weight: 700; }
.itd-mega .itd-mega__dealnote + .itd-mega__dealbtn { margin-top: 18px; }
.itd-body .itd-rednav a.itd-mega__dealbtn:hover { background: #262A35; color: #fff; text-decoration: none; }

@media (max-width: 1180px) {
  .itd-mega .itd-mega__panel { grid-template-columns: minmax(0, 1fr); }
  .itd-mega .itd-mega__deal { display: none; }
}
@media (max-width: 1024px) {
  .itd-mega .itd-mega__inner { grid-template-columns: 240px minmax(0, 1fr); }
  .itd-mega .itd-mega__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Added to cart: express pay ---------- */
.itd-sheet__express { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.itd-body .itd-sheet__pay { display: flex; align-items: center; justify-content: center; height: 46px; border-radius: 10px; font-size: 15px; font-weight: 700; padding: 0 12px; border: 1.5px solid var(--itd-ink); }
.itd-body .itd-sheet__pay--apple { background: var(--itd-ink); color: #fff; }
.itd-body .itd-sheet__pay--apple:hover { background: #262A35; color: #fff; }
.itd-body .itd-sheet__pay--google { background: #fff; color: var(--itd-ink); border-color: var(--itd-line-2); }
.itd-body .itd-sheet__pay--google:hover { border-color: var(--itd-ink); color: var(--itd-ink); }
.itd-sheet__expressnote { margin: -2px 0 2px; text-align: center; font-size: 12px; color: var(--itd-muted); }
.itd-sheet__actions { display: flex; flex-direction: column; }
.itd-sheet__row .itd-btn--outline { width: 100%; }
.itd-sheet-is-open .itd-toast { display: none; }
.itd-sheet__item .itd-sheet__price { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.itd-sheet__item .itd-sheet__price s { display: inline; }
.itd-sheet__addon { text-align: left; align-items: stretch; }
.itd-sheet__abuy { align-items: stretch; }
.itd-body .itd-sheet__abuy .itd-btn { width: 100%; justify-content: center; }
@media (max-width: 767px) {
  .itd-body .itd-sheet__abuy .itd-btn { width: auto; }
  .itd-sheet__express .itd-sheet__pay { height: 44px; }
}

/* Mega menu v3: grey department column, white active row (design 03 Nov). */
.itd-mega .itd-mega__depts { background: #F7F7F9; }
.itd-mega .itd-mega__depts button:hover { background: #EFF0F3; }
.itd-mega .itd-mega__depts button.is-active { background: #fff; }
.itd-mega .itd-mega__col h4 { font-size: 14px; }
.itd-mega .itd-mega__chiprow > strong { flex-basis: 96px; }

/* Added to cart: products added from "Goes well with it" are listed under the product. */
.itd-sheet__also { display: flex; flex-direction: column; gap: 8px; padding: 0 20px 16px; margin-top: -6px; }
.itd-sheet__alsoitem { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px; border-radius: 12px; background: var(--itd-green-bg); animation: itd-also-in .25s ease; }
.itd-sheet__alsoitem .itd-media { width: 56px; height: 56px; border-radius: 10px; background: #fff; }
.itd-sheet__alsoitem .itd-media > img { object-fit: contain; padding: 6px; box-sizing: border-box; }
.itd-sheet__alsoinfo { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 14px; }
.itd-sheet__alsoinfo strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.itd-sheet__alsotag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; }
.itd-sheet__alsotag svg { width: 14px; height: 14px; }
.itd-sheet__alsoitem > b { font-size: 14px; }
@keyframes itd-also-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
