/* ==========================================================
   AIER Cart Sidebar / Group Members / Recommended-for-you
   Shares the same design tokens as event-details.php and
   course-details.php: Mulish font, #143b66 navy, #1499a6 teal.
   ========================================================== */

#aier-cart-box, #aier-float-cart {
  font-family: 'Mulish', system-ui, -apple-system, sans-serif;
  color: #3f4a57;
}

/* ---- Cart box ---- */
.aier-cart-box {
  border: 1px solid #d3dae1;
  border-radius: 10px;
  background: #fff;
  padding: 18px 18px 20px;
}
.aier-cart-head {
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 800; color: #143b66; font-size: 15px; margin-bottom: 14px;
}
.aier-cart-close { cursor: pointer; font-size: 18px; color: #8a97a6; }
.aier-cart-items { max-height: 260px; overflow-y: auto; margin-bottom: 12px; }
.aier-cart-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid #eef1f4; align-items: flex-start; }
.aier-cart-item-icon { font-size: 18px; }
.aier-cart-item-body { flex: 1; min-width: 0; }
.aier-cart-item-name { font-weight: 700; color: #143b66; font-size: 13.5px; }
.aier-cart-item-meta { font-size: 12px; color: #82909c; }
.aier-cart-item-remove { font-size: 11px; color: #b3413f; cursor: pointer; text-decoration: underline; }
.aier-cart-item--fee { background: #fbfbfb; }
.aier-cart-item-required {
  display: inline-block; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em;
  background: #eef1f4; color: #5a6776; padding: 2px 7px; border-radius: 999px; margin-left: 4px; vertical-align: middle;
}
.aier-cart-item-price { font-weight: 800; color: #143b66; font-size: 13.5px; white-space: nowrap; }
.aier-cart-empty { font-size: 13px; color: #82909c; padding: 10px 0; }

.aier-cart-coupon { display: flex; gap: 8px; margin-bottom: 6px; }
.aier-cart-coupon input {
  flex: 1; padding: 8px 10px; border: 1px solid #cdd6de; border-radius: 6px; font-size: 12.5px; letter-spacing: .03em;
}
.aier-cart-coupon button {
  background: #143b66; color: #fff; border: none; border-radius: 6px; padding: 8px 16px; font-weight: 800; font-size: 12.5px; cursor: pointer;
}
.aier-cart-coupon-note { font-size: 11px; color: #97a3ae; margin-bottom: 14px; }
.aier-coupon-error { font-size: 12px; color: #b3413f; margin: 4px 0 10px; }

.aier-cart-addons {
  background: #fff8ec; border: 1px solid #f0d9a6; border-radius: 8px; padding: 12px 14px; margin-bottom: 14px;
}
.aier-cart-addons-title { font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: #9a6b1f; margin-bottom: 8px; }
.aier-addon-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; }
.aier-addon-name { font-weight: 700; color: #143b66; font-size: 13px; }
.aier-addon-price { font-size: 11.5px; color: #82909c; }
.aier-addon-add {
  background: #f5b93d; color: #4a2f00; border: none; border-radius: 999px; padding: 6px 14px; font-weight: 800; font-size: 12px; cursor: pointer;
}

.aier-cart-total-row { display: flex; justify-content: space-between; align-items: center; font-size: 14px; padding: 10px 0; border-top: 1px solid #e4e8ec; margin-top: 4px; }
.aier-cart-total-row b { color: #143b66; font-size: 16px; }

.aier-cart-checkout {
  width: 100%; background: #17a86b; color: #fff; border: none; border-radius: 8px;
  padding: 13px; font-weight: 800; font-size: 14.5px; cursor: pointer; margin-top: 6px;
}
.aier-cart-checkout:disabled { background: #b7c1cb; cursor: not-allowed; }
.aier-cart-checkout:hover:not(:disabled) { background: #128a58; }

.aier-cart-login-note { font-size: 12px; color: #82909c; text-align: center; margin-top: 10px; }
.aier-cart-login-note a { color: #1499a6; font-weight: 700; text-decoration: none; }

/* ---- Floating site-wide cart bubble ---- */
#aier-float-cart-btn span { font-weight: 800; }

/* ---- Group members form ---- */
.aier-group-box {
  margin: 18px 32px 0; border: 1px dashed #1499a6; background: #f7fdfe;
  border-radius: 10px; padding: 20px 22px;
}
.aier-group-box.aier-hidden { display: none; }
.aier-group-title { font-weight: 800; color: #143b66; font-size: 16px; margin-bottom: 4px; }
.aier-group-sub { font-size: 13px; color: #5a6776; margin-bottom: 16px; }
.aier-group-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: #fff; border: 1px solid #dfe5ea; border-radius: 8px; padding: 12px 14px; margin-bottom: 10px;
}
.aier-group-row-fields { display: flex; gap: 8px; flex: 1; min-width: 220px; }
.aier-group-row input[type=text], .aier-group-row input[type=email] {
  padding: 8px 10px; border: 1px solid #cdd6de; border-radius: 6px; font-size: 13.5px; width: 100%;
}
.aier-group-row .aier-g-email { flex: 1; min-width: 200px; }
.aier-group-row-roles { display: flex; gap: 12px; font-size: 12.5px; color: #5a6776; white-space: nowrap; }
.aier-group-row-roles label { display: flex; align-items: center; gap: 4px; cursor: pointer; }
.aier-group-row-remove { cursor: pointer; color: #b3413f; font-size: 18px; font-weight: 700; margin-left: auto; }

.aier-group-add-row {
  background: none; border: 2px solid #1499a6; color: #1499a6; font-weight: 800; font-size: 13px;
  padding: 8px 18px; border-radius: 999px; cursor: pointer; margin-top: 4px;
}
.aier-group-add-row:hover { background: #1499a6; color: #fff; }

.aier-group-summary { margin-top: 14px; font-size: 13.5px; color: #3f4a57; }
.aier-group-summary b { color: #143b66; }

/* ---- Recommended for you ---- */
.aier-recommend { padding: 28px 32px; }
.aier-recommend-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; flex-wrap: wrap; }
.aier-recommend-title { font-weight: 800; color: #143b66; font-size: 18px; }
.aier-recommend-badge-pill {
  display: inline-block; font-size: 11px; font-weight: 800; background: #fff2d6; color: #9a6b1f;
  padding: 3px 10px; border-radius: 999px; vertical-align: middle; margin-left: 6px;
}
.aier-recommend-sub { font-size: 12.5px; color: #82909c; display: block; margin-bottom: 14px; }
.aier-recommend-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.aier-recommend-card {
  border: 1px solid #e4e8ec; border-radius: 10px; background: #fff; padding: 16px 16px 18px;
  display: flex; flex-direction: column;
}

.aier-recommend-datebadge {
  width: 44px; border: 1px solid #e4e8ec; border-radius: 6px; overflow: hidden; margin-bottom: 10px;
}
.aier-recommend-datebadge-month {
  background: #d3453f; color: #fff; font-size: 10px; font-weight: 800; text-align: center; padding: 2px 0; letter-spacing: .03em;
}
.aier-recommend-datebadge-day { text-align: center; font-weight: 900; color: #143b66; font-size: 18px; padding: 2px 0; }

.aier-recommend-icon {
  width: 44px; height: 44px; border-radius: 8px; background: #eef3fb; display: flex; align-items: center;
  justify-content: center; font-size: 20px; margin-bottom: 10px;
}

.aier-recommend-badge {
  display: inline-block; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  padding: 3px 9px; border-radius: 999px; background: #fff2d6; color: #9a6b1f; margin-bottom: 8px; align-self: flex-start;
}
.aier-recommend-name { font-weight: 800; color: #143b66; font-size: 14.5px; margin-bottom: 3px; line-height: 1.3; }
.aier-recommend-date { font-size: 11.5px; color: #82909c; margin-bottom: 6px; }
.aier-recommend-desc { font-size: 12px; color: #5a6776; line-height: 1.45; margin-bottom: 10px; }

.aier-recommend-price-row { margin-bottom: 10px; }
.aier-recommend-price { font-weight: 800; color: #143b66; font-size: 15px; }
.aier-recommend-price small { font-weight: 600; color: #82909c; font-size: 11px; }
.aier-recommend-savings { display: block; font-size: 11.5px; font-weight: 700; color: #1499a6; margin-top: 2px; }

.aier-recommend-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.aier-recommend-link { font-size: 12.5px; font-weight: 800; color: #1499a6; text-decoration: none; }
.aier-recommend-add {
  background: #143b66; color: #fff; border: none; border-radius: 999px; padding: 6px 14px; font-weight: 800; font-size: 12px; cursor: pointer;
}
.aier-recommend-add--done { background: #d5dde3; color: #5a6776; cursor: default; }

@media (max-width: 760px) {
  .aier-recommend-grid { grid-template-columns: 1fr; }
  .aier-group-box { margin-left: 20px; margin-right: 20px; }
}

/* ---- Guest/Member price-preview toggle (header) ---- */
.aier-persona-toggle {
  display: inline-flex !important; align-items: center; gap: 8px; border: 1px solid #d8dde3 !important;
  border-radius: 999px !important; padding: 5px 6px 5px 12px !important; font-family: 'Mulish', system-ui, sans-serif !important;
  background: #fff !important; width: auto !important; margin: 12px 0 !important;
}
.aier-persona-lab { font-size: 12px !important; font-weight: 800 !important; color: #5a6776 !important; }
.aier-persona-seg { display: flex !important; background: #f3f7fb !important; border-radius: 999px !important; padding: 2px !important; width: auto !important; }
.aier-persona-toggle button.aier-persona-btn {
  border: none !important; background: transparent !important; color: #5a6776 !important; font-family: inherit !important; font-weight: 800 !important;
  font-size: 12px !important; padding: 5px 14px !important; border-radius: 999px !important; cursor: pointer !important;
  width: auto !important; height: auto !important; line-height: normal !important; display: inline-block !important;
  text-transform: none !important; letter-spacing: normal !important; box-shadow: none !important; margin: 0 !important;
}
.aier-persona-toggle button.aier-persona-btn.aier-persona-on { background: #143b66 !important; color: #fff !important; }
.aier-hidden { display: none !important; }

.aier-persona-toggle button.aier-persona-btn.aier-persona-mem.aier-persona-on { background: #0f7a5e !important; }

/* ---- Shared inline error/message styling (replaces alert() popups) ---- */
.aier-inline-error {
  background: #fdecea; border: 1px solid #f5c2c7; border-left: 4px solid #dc3545; color: #842029;
  border-radius: 6px; padding: 10px 14px; font-size: 13px; font-weight: 600; margin: 10px 0;
}
.aier-coupon-msg { font-size: 12.5px; font-weight: 700; margin: 6px 0 10px; min-height: 16px; }
.aier-coupon-msg--ok { color: #0f7a5e; }
.aier-coupon-msg--err { color: #b3413f; }
.aier-applied-coupons { margin-bottom: 14px; }
.aier-applied-coupon-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: #e9f8f1; border: 1px solid #b9e3d1; border-radius: 6px; padding: 8px 12px;
  font-size: 12.5px; color: #0f7a5e; font-weight: 700; margin-bottom: 6px;
}
.aier-applied-coupon-remove { cursor: pointer; text-decoration: underline; font-weight: 700; white-space: nowrap; }


/*  */
/* ==========================================================
   Shared Listing Layout (Events + Courses)
   ========================================================== */

.aier-listing-shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 40px 24px 20px;
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.aier-listing-main {
    flex: 1 1 auto;
    min-width: 0;
}

.aier-listing-cart {
    width: 340px;
    flex: 0 0 340px;
    position: sticky;
    top: 200px; /* Adjust if needed */
    align-self: flex-start;
    z-index: 20;

    max-height: calc(100vh - 220px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.aier-listing-cart .aier-cart-box {
    width: 100%;
    box-sizing: border-box;
}

.aier-listing-cart .aier-cart-items {
    max-height: 260px;
    overflow-y: auto;
}

@media (max-width: 1024px) {
    .aier-listing-shell {
        display: block;
    }

    .aier-listing-cart {
        position: static;
        width: 100%;
        max-height: none;
        overflow: visible;
        margin-top: 24px;
    }
}

/* ==========================================================
   AJAX Cart Loading State
   ========================================================== */

.aier-cart-box {
    position: relative;
}

.aier-cart-loading {
    pointer-events: none;
}

.aier-cart-loading::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.65);
    z-index: 100;
    border-radius: inherit;
}

.aier-cart-loading::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 34px;
    height: 34px;
    margin-left: -17px;
    margin-top: -17px;

    border: 3px solid #d8dee6;
    border-top-color: #143b66;
    border-radius: 50%;

    animation: aierCartSpin .7s linear infinite;
    z-index: 101;
}

@keyframes aierCartSpin {
    to {
        transform: rotate(360deg);
    }
}
/*  */

