/* ===== Course Listing ===== */
/* Prevent page-level horizontal scroll on mobile. iOS Safari requires
   overflow-x on html/body, not descendants. This stylesheet is only
   loaded when one of our shortcodes renders, so applying globally is
   effectively scoped. */
html, body {
    overflow-x: hidden !important;
    max-width: 100% !important;
}
@supports (overflow-x: clip) {
    html, body {
        overflow-x: clip !important;
    }
}

.hhs-scheduler-listing-wrap {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #333;
    padding-bottom: 80px;
    overflow-x: clip;
    box-sizing: border-box;
}
@media (min-width: 1101px) {
    .hhs-scheduler-listing-wrap { max-width: 1100px; }
}

/* ===== Filter Bar ===== */
.hhs-listing-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e0e0e0;
}
.hhs-listing-dropdowns {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.hhs-listing-filter-select {
    padding: 8px 32px 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="8"><path d="M1 1l5 5 5-5" stroke="%23666" stroke-width="1.5" fill="none"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    min-width: 150px;
    color: #333;
}
.hhs-listing-campus-toggles {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.hhs-listing-campus-btn {
    background: #6a7a3a;
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    min-height: 44px;
}
.hhs-listing-campus-btn:hover {
    background: #556630;
}
.hhs-listing-campus-btn.hhs-listing-campus-active {
    background: #2d2d6b;
    box-shadow: 0 2px 6px rgba(45,45,107,0.3);
}

/* ===== Title ===== */
.hhs-listing-title {
    font-size: 20px;
    font-weight: 400;
    color: #333;
    margin: 0 0 24px;
}

/* ===== Group Header (Program in Campus) ===== */
.hhs-listing-group-header {
    background: #2d2d6b;
    border-left: 6px solid #a0b860;
    border-radius: 4px;
    padding: 14px 20px;
    margin: 24px 0 0;
}
.hhs-listing-group-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.3px;
}

/* ===== Course Row ===== */
.hhs-listing-course {
    border-left: 6px solid #a0b860;
    background: #fff;
    margin-bottom: 0;
    border-bottom: 1px solid #e8e8e8;
}

/* Course header bar (sage green) */
.hhs-listing-course-header {
    background: #d9e6c2;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.hhs-listing-course-name {
    font-size: 16px;
    font-weight: 600;
    color: #2d2d6b;
    flex: 1;
}
.hhs-listing-more-btn {
    background: none;
    border: none;
    color: #666;
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}
.hhs-listing-more-btn:hover {
    color: #2d2d6b;
}

/* Course info (always visible) */
.hhs-listing-course-info {
    padding: 12px 20px 4px;
}
.hhs-listing-course-info p {
    margin: 0 0 8px;
    font-size: 14px;
    line-height: 1.5;
    color: #444;
}

/* Expandable details */
.hhs-listing-course-details {
    padding: 0 20px 8px;
}
.hhs-listing-course-details p {
    margin: 0 0 8px;
    font-size: 14px;
    line-height: 1.5;
    color: #555;
}

/* Course image */
.hhs-scheduler-course-image {
    margin-bottom: 12px;
}
.hhs-scheduler-course-image img {
    width: 100%;
    max-width: 300px;
    height: auto;
    border-radius: 6px;
    display: block;
}

/* Course Note */
.hhs-listing-course-note {
    background: #fef9e7;
    border-left: 4px solid #f0c929;
    padding: 10px 14px;
    margin: 8px 0;
    font-size: 14px;
    line-height: 1.5;
    color: #555;
    border-radius: 0 4px 4px 0;
}
.hhs-listing-course-note strong {
    color: #8a6d00;
}

/* Spots remaining */
.hhs-scheduler-spots {
    font-size: 13px;
    color: #c0392b;
    font-weight: 600;
}

/* Online badge */
.hhs-scheduler-online-badge {
    display: inline-block;
    background: #17a2b8;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* ===== Select / Selected Button ===== */
.hhs-listing-course-action {
    padding: 8px 20px 16px;
    text-align: right;
}
.hhs-listing-select-btn {
    background: #fff;
    color: #333;
    border: 2px solid #a0b860;
    padding: 10px 24px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    min-height: 44px;
}
.hhs-listing-select-btn:hover {
    background: #f0f5e6;
}
.hhs-listing-select-btn.hhs-listing-btn-selected {
    background: #d9e6c2;
    color: #2d5a0e;
    border-color: #6a7a3a;
}
.hhs-listing-select-btn.hhs-listing-btn-selected:hover {
    background: #c9d6b2;
}

/* Register By date */
.hhs-listing-register-by {
    font-size: 13px;
    color: #555;
}
.hhs-listing-register-by-passed {
    color: #c0392b;
}
.hhs-listing-deadline-passed {
    font-weight: 600;
    color: #c0392b;
}

/* Status labels */
.hhs-listing-status-label {
    display: inline-block;
    padding: 8px 24px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
}
.hhs-listing-status-closed {
    background: #f8d7da;
    color: #721c24;
}
.hhs-listing-status-full {
    background: #fff3cd;
    color: #856404;
}
.hhs-listing-status-registration-closed {
    background: #f8d7da;
    color: #721c24;
}

/* ===== Floating Cart Bar ===== */
.hhs-scheduler-cart-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1d2327;
    color: #fff;
    z-index: 99999;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.2);
    animation: hhs-slide-up 0.3s ease;
}
@keyframes hhs-slide-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
.hhs-scheduler-cart-bar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
}
.hhs-scheduler-cart-count {
    background: #2E6DA4;
    color: #fff;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 14px;
}
.hhs-scheduler-checkout-btn {
    margin-left: auto;
    background: #46b450;
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.hhs-scheduler-checkout-btn:hover {
    background: #3a9a42;
}

/* ===== Registration Modal / Checkout ===== */
.hhs-scheduler-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hhs-scheduler-modal-checkout {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    max-width: 1100px;
    width: 95%;
    max-height: 95vh;
    overflow-y: auto;
    padding: 32px;
    position: relative;
}
.hhs-scheduler-modal-close {
    position: absolute;
    top: 12px; right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    line-height: 1;
}
.hhs-scheduler-modal-close:hover {
    color: #000;
}
.hhs-scheduler-modal-title {
    margin: 0 0 20px;
    font-size: 20px;
    color: #222;
}

/* Checkout course cards */
.hhs-checkout-courses {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}
.hhs-checkout-course-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: #f8f9fa;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
}
.hhs-checkout-course-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.hhs-checkout-course-title {
    font-size: 15px;
    color: #222;
}
.hhs-checkout-course-meta {
    font-size: 13px;
    color: #666;
}
.hhs-checkout-course-schedule {
    font-size: 13px;
    color: #888;
}
.hhs-checkout-remove-btn {
    background: none;
    border: none;
    color: #c00;
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    flex-shrink: 0;
}
.hhs-checkout-remove-btn:hover {
    color: #900;
}
.hhs-checkout-empty {
    text-align: center;
    padding: 20px;
    color: #999;
}
.hhs-checkout-actions {
    margin-top: 16px;
}

/* Checkout summary */
.hhs-checkout-summary {
    margin-bottom: 20px;
    padding: 12px 16px;
    background: #eef4fb;
    border: 1px solid #c5d9ed;
    border-radius: 6px;
}
.hhs-checkout-summary-label {
    margin: 0 0 6px;
    font-size: 14px;
    color: #333;
}
.hhs-checkout-summary-list {
    margin: 0;
    padding-left: 18px;
    font-size: 14px;
}
.hhs-checkout-summary-list li {
    margin: 4px 0;
}
.hhs-checkout-summary-campus {
    color: #888;
    font-size: 13px;
}

/* Form actions */
.hhs-checkout-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    align-items: stretch;
}
.hhs-scheduler-back-btn {
    background: #f0f0f1;
    color: #333;
    border: 1px solid #ccc;
    padding: 14px 24px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hhs-scheduler-back-btn:hover {
    background: #e5e5e5;
}
.hhs-checkout-form-actions .hhs-scheduler-submit-btn {
    flex: 1;
    margin-top: 0;
}

/* Confirmation step */
.hhs-checkout-confirmation {
    text-align: center;
    padding: 20px 0;
}
.hhs-checkout-checkmark {
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
    background: #d4edda;
    color: #155724;
    border-radius: 50%;
    font-size: 32px;
    line-height: 60px;
    font-weight: 700;
}
.hhs-checkout-confirmation h3 {
    font-size: 22px;
    color: #155724;
    margin: 0 0 10px;
}
.hhs-checkout-confirmation p {
    color: #555;
    font-size: 14px;
    margin: 0 0 16px;
}
.hhs-checkout-done-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
}
.hhs-checkout-done-list li {
    padding: 6px 12px;
    background: #f8f9fa;
    border-radius: 4px;
    margin: 4px 0;
    font-size: 14px;
}
.hhs-checkout-confirmation .hhs-scheduler-submit-btn {
    display: inline-block;
    width: auto;
    padding: 12px 40px;
}

/* ===== Confirmation Calendar & Actions ===== */
.hhs-done-calendar-wrap {
    margin: 20px 0 12px;
    text-align: left;
}
.hhs-done-calendar-title {
    font-size: 16px;
    font-weight: 700;
    color: #2d2d6b;
    margin: 0 0 12px;
    text-align: left;
}
.hhs-done-calendar {
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0,0,0,0.08);
    min-height: 700px;
}
.hhs-done-calendar .fc-toolbar-title {
    font-size: 16px !important;
    color: #2d2d6b;
}
.hhs-done-calendar .fc-button {
    background: #2d2d6b;
    border-color: #2d2d6b;
    font-size: 12px;
    padding: 4px 10px;
}
.hhs-done-calendar .fc-button:hover {
    background: #4a4a8a;
    border-color: #4a4a8a;
}
.hhs-done-calendar .fc-button-active {
    background: #1d1d4d !important;
    border-color: #1d1d4d !important;
}
.hhs-done-calendar .fc-daygrid-event {
    border: none;
    border-radius: 3px;
    font-size: 11px;
    cursor: default;
}
.hhs-done-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 16px;
}
.hhs-done-action-btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    text-align: center;
    white-space: nowrap;
}
.hhs-done-btn-calendar {
    background: #2d2d6b;
    color: #fff;
}
.hhs-done-btn-calendar:hover {
    background: #4a4a8a;
    color: #fff;
}
.hhs-done-btn-email {
    background: #46b450;
    color: #fff;
}
.hhs-done-btn-email:hover {
    background: #3a9a42;
    color: #fff;
}
.hhs-done-btn-email:disabled {
    background: #88c090;
    cursor: not-allowed;
}
.hhs-done-btn-download {
    background: #fff;
    color: #333;
    border: 2px solid #ccc;
}
.hhs-done-btn-download:hover {
    border-color: #999;
    color: #000;
}
.hhs-done-email-sent {
    color: #155724;
    font-size: 13px;
    margin-top: 8px;
    text-align: center;
}

/* Form fields */
.hhs-scheduler-field {
    margin-bottom: 16px;
}
.hhs-scheduler-field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #333;
}
.hhs-scheduler-req {
    color: #c00;
}
.hhs-scheduler-field input,
.hhs-scheduler-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    color: #333;
}
.hhs-scheduler-field input:focus,
.hhs-scheduler-field textarea:focus {
    border-color: #2E6DA4;
    outline: none;
    box-shadow: 0 0 0 2px rgba(46,109,164,0.2);
}
.hhs-scheduler-field-error {
    display: block;
    color: #c00;
    font-size: 13px;
    margin-top: 4px;
    min-height: 0;
}
.hhs-scheduler-field-error:not(:empty) {
    margin-bottom: 4px;
}
.hhs-scheduler-submit-btn {
    display: block;
    width: 100%;
    background: #2E6DA4;
    color: #fff;
    border: none;
    padding: 14px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
}
.hhs-scheduler-submit-btn:hover {
    background: #245a8a;
}
.hhs-scheduler-submit-btn:disabled {
    background: #88b0d0;
    cursor: not-allowed;
}

/* Messages */
.hhs-scheduler-form-message {
    margin-top: 16px;
    border-radius: 4px;
    font-size: 14px;
    clear: both;
}
.hhs-scheduler-form-message p {
    margin: 0;
    padding: 12px;
}
.hhs-scheduler-msg-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
}
.hhs-scheduler-msg-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
}

/* ===== Checkout Page ===== */
.hhs-scheduler-checkout-page {
    max-width: 1100px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.hhs-scheduler-checkout-page h2 {
    font-size: 24px;
    color: #222;
    margin-bottom: 20px;
}

/* ===== Responsive — Tablet ===== */
@media (max-width: 768px) {
    .hhs-scheduler-listing-wrap {
        padding-bottom: 70px;
    }
    .hhs-listing-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .hhs-listing-dropdowns {
        flex-direction: column;
    }
    .hhs-listing-filter-select {
        width: 100%;
        min-width: auto;
    }
    .hhs-listing-campus-toggles {
        justify-content: flex-start;
    }
    .hhs-listing-course-name {
        font-size: 14px;
    }
    .hhs-listing-group-header h3 {
        font-size: 15px;
    }
    .hhs-scheduler-checkout-page {
        padding: 0 12px;
    }
}

/* ===== Responsive — Phone ===== */
@media (max-width: 600px) {
    .hhs-scheduler-listing-wrap {
        padding-bottom: 60px;
        max-width: 100%;
        overflow-x: clip;
    }
    .hhs-listing-course-header {
        padding: 8px 14px;
    }
    .hhs-listing-course-name {
        font-size: 13px;
        width: 100%;
    }
    .hhs-listing-course-info {
        padding: 10px 14px 4px;
    }
    .hhs-listing-course-info p {
        font-size: 13px;
    }
    .hhs-listing-course-action {
        padding: 6px 14px 12px;
    }
    .hhs-listing-campus-btn {
        font-size: 11px;
        padding: 6px 12px;
    }
    .hhs-listing-title {
        font-size: 16px;
    }
    .hhs-listing-group-header {
        padding: 10px 14px;
    }
    .hhs-listing-group-header h3 {
        font-size: 14px;
    }
    .hhs-listing-course-details {
        padding: 0 14px 8px;
    }

    /* Cart bar */
    .hhs-scheduler-cart-bar-inner {
        flex-wrap: wrap;
        font-size: 13px;
        padding: 10px 14px;
        gap: 8px;
    }
    .hhs-scheduler-checkout-btn {
        width: 100%;
        text-align: center;
        padding: 10px;
        font-size: 14px;
    }

    /* Checkout */
    .hhs-checkout-form-actions {
        flex-direction: column;
    }
    .hhs-scheduler-back-btn {
        text-align: center;
    }

    /* Modal — bottom sheet on phone */
    .hhs-scheduler-modal-checkout {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 12px 12px 0 0 !important;
        max-height: 90vh !important;
        padding: 16px !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        margin: 0 !important;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .hhs-scheduler-modal-overlay {
        align-items: flex-end !important;
    }

    /* Touch targets */
    .hhs-listing-select-btn {
        width: 100%;
        padding: 12px 24px;
        font-size: 15px;
    }
    .hhs-listing-campus-btn {
        padding: 10px 16px;
    }
    .hhs-listing-more-btn {
        min-height: 44px;
        min-width: 44px;
    }

    /* Inputs — prevent iOS zoom */
    .hhs-scheduler-field input,
    .hhs-scheduler-field textarea,
    .hhs-scheduler-field select {
        font-size: 16px;
    }
    .hhs-scheduler-modal-title {
        font-size: 18px;
    }
    .hhs-scheduler-checkout-page {
        padding: 0 16px;
    }
    .hhs-scheduler-checkout-page h2 {
        font-size: 20px;
    }
    .hhs-scheduler-course-row {
        overflow: hidden;
    }
}

/* ===== Landscape phone ===== */
@media (orientation: landscape) and (max-height: 500px) {
    .hhs-scheduler-listing-wrap {
        padding-bottom: 50px;
    }
    .hhs-listing-filter-bar {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .hhs-listing-dropdowns {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .hhs-listing-filter-select {
        width: auto;
        min-width: 140px;
    }
    .hhs-listing-title {
        font-size: 16px;
        margin: 8px 0;
    }
    .hhs-listing-group-header {
        padding: 8px 14px;
    }
    .hhs-listing-course-info {
        padding: 6px 14px 4px;
    }
    .hhs-listing-course-info p {
        margin: 2px 0;
    }
    /* Compact modal in landscape */
    .hhs-scheduler-modal-checkout {
        max-height: 100vh !important;
        border-radius: 0 !important;
    }
    /* Cart bar single row */
    .hhs-scheduler-cart-bar-inner {
        flex-wrap: nowrap;
        padding: 6px 14px;
    }
    .hhs-scheduler-checkout-btn {
        width: auto;
        padding: 8px 20px;
    }
}

/* ===== Safe area for notched phones ===== */
@supports (padding: env(safe-area-inset-bottom)) {
    .hhs-scheduler-cart-bar {
        padding-bottom: env(safe-area-inset-bottom);
    }
    .hhs-scheduler-cart-bar-inner {
        padding-left: max(14px, env(safe-area-inset-left));
        padding-right: max(14px, env(safe-area-inset-right));
    }
    .hhs-scheduler-modal-checkout {
        padding-bottom: max(16px, env(safe-area-inset-bottom)) !important;
    }
}
