/**
 * HBM Guest Portal Styles
 *
 * Styles for the [hbm_my_bookings] shortcode
 * Material UI inspired design for guest-facing pages
 */


/* ==========================================================================
   Variables
   ========================================================================== */
/* Variables inherited from hbm-material-ui.css :root --md-* system */


/* ==========================================================================
   Container
   ========================================================================== */
.hbm-guest-portal {
    max-width: 920px;
    margin: 2.5rem auto;
    padding: 0 1rem;
    font-family: var(--md-font-family);
    font-size: 15px;
    line-height: 1.6;
    color: var(--md-on-surface);
}

.hbm-guest-portal h1,
.hbm-guest-portal h2,
.hbm-guest-portal h3,
.hbm-guest-portal h4 {
    font-family: var(--md-font-family) !important;
}

/* ==========================================================================
   Card
   ========================================================================== */
.hbm-portal-card {
    background: var(--md-surface);
    border-radius: var(--md-radius-md);
    box-shadow: var(--md-elevation-2);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.hbm-portal-card--wide {
    max-width: 920px;
    margin-inline: auto;
}

.hbm-guest-brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.hbm-guest-brand__logo {
    display: block;
    width: auto;
    height: 44px;
    max-width: 180px;
    object-fit: contain;
}

.hbm-guest-brand__name {
    color: var(--md-on-surface);
    font-size: 1rem;
    font-weight: 750;
    letter-spacing: -0.01em;
}

/* ==========================================================================
   Header
   ========================================================================== */
.hbm-portal-header {
    padding: 2rem 2rem 1.5rem;
    text-align: center;
    border-bottom: 1px solid var(--md-outline);
    background: linear-gradient(135deg, var(--md-background) 0%, var(--md-surface) 100%);
}

.hbm-portal-header h2 {
    margin: 0 0 0.5rem;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--md-on-surface);
}

.hbm-portal-subtitle {
    margin: 0;
    color: var(--md-on-surface-variant);
    font-size: 0.95rem;
}

/* ==========================================================================
   Form
   ========================================================================== */
.hbm-portal-form {
    padding: 2rem;
}

.hbm-portal-field {
    margin-bottom: 1.5rem;
}

.hbm-portal-field label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--md-on-surface);
}

.hbm-portal-field input[type="text"],
.hbm-portal-field input[type="email"] {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    border: 1px solid var(--md-outline);
    border-radius: var(--md-radius-sm);
    background: var(--md-surface);
    transition: border-color var(--md-transition-fast), box-shadow var(--md-transition-fast);
    box-sizing: border-box;
}

.hbm-portal-field input:focus {
    outline: none;
    border-color: var(--md-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--md-primary) 12%, transparent);
}

.hbm-portal-hint {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--md-on-surface-variant);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.hbm-portal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.9rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    border: none;
    border-radius: var(--md-radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    width: auto;
    min-height: 48px;
    box-sizing: border-box;
    box-shadow: var(--md-elevation-1);
}

.hbm-portal-btn--primary {
    background: var(--md-primary);
    color: var(--md-on-primary) !important;
}

.hbm-portal-btn--primary:hover {
    background: var(--md-primary-dark);
    color: var(--md-on-primary);
    box-shadow: var(--md-elevation-2);
}

.hbm-portal-btn--secondary {
    background: var(--md-background);
    color: var(--md-on-surface) !important;
    border: 1px solid var(--md-outline);
}

.hbm-portal-btn--secondary:hover {
    background: var(--md-surface-variant);
    box-shadow: var(--md-elevation-2);
}

.hbm-portal-btn--danger {
    background: var(--md-error);
    color: var(--md-on-primary);
}

.hbm-portal-btn--danger:hover {
    background: var(--md-error-dark);
    box-shadow: var(--md-elevation-2);
}

.hbm-portal-form > .hbm-portal-btn,
.hbm-portal-form .hbm-portal-btn--primary {
    width: 100%;
}

.hbm-portal-payment-retry {
    margin: 1rem 0 0;
}

/* ==========================================================================
   Alerts
   ========================================================================== */
.hbm-portal-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin: 1.5rem;
    padding: 1rem;
    border-radius: var(--md-radius-md);
    font-size: 0.95rem;
}

.hbm-portal-alert .hbm-icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.hbm-portal-alert--error {
    background: var(--md-error-light);
    color: var(--md-error-dark, #b71c1c);
    border: 1px solid var(--md-error);
}

.hbm-portal-alert--success {
    background: var(--md-success-light);
    color: var(--md-success-dark, #1b5e20);
    border: 1px solid var(--md-success);
}

/* ======================================================================
   Group Bookings
   ====================================================================== */
.hbm-portal-group-list {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.hbm-portal-group-item {
    border: 1px solid var(--md-outline);
    border-radius: var(--md-radius-md);
    padding: 12px 16px;
    background: var(--md-surface);
    display: grid;
    gap: 8px;
}

.hbm-portal-group-primary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.hbm-portal-group-secondary {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: var(--md-on-surface-variant);
    font-size: 0.9rem;
}

.hbm-portal-group-actions {
    display: flex;
    justify-content: flex-end;
}

.hbm-portal-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 0.75rem;
    font-weight: 600;
}

.hbm-portal-alert--warning {
    background: #fcf9e8;
    color: #856404;
    border: 1px solid var(--md-warning);
}

.hbm-portal-notice {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding: 0.9rem 1rem;
    border-radius: var(--md-radius-md);
}

.hbm-portal-notice--demo {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    color: #92400e;
}

.hbm-portal-notice--demo .hbm-icon {
    color: #d97706;
}

.hbm-portal-notice__text {
    font-weight: 500;
}

.hbm-portal-property-image--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 80px;
    border-radius: var(--md-radius-sm);
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    flex-shrink: 0;
}

.hbm-portal-property-image--placeholder .hbm-icon {
    width: 32px;
    height: 32px;
    color: #6366f1;
}

.hbm-portal-actions--wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hbm-portal-actions--wrap .hbm-portal-btn {
    width: auto;
    flex: 1 1 220px;
}

.hbm-portal-note {
    margin: 0.75rem 0 0;
    font-style: italic;
    color: var(--md-on-surface-variant);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.hbm-portal-footer {
    padding: 1.5rem 2rem;
    text-align: center;
    background: var(--md-background);
    border-top: 1px solid var(--md-outline);
}

.hbm-portal-footer p {
    margin: 0 0 0.5rem;
    color: var(--md-on-surface-variant);
    font-size: 0.9rem;
}

.hbm-portal-link {
    color: var(--md-primary);
    text-decoration: none;
    font-weight: 500;
}

.hbm-portal-link:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Booking Details
   ========================================================================== */
.hbm-portal-booking-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, color-mix(in srgb, var(--md-primary) 4%, transparent) 0%, var(--md-surface) 100%);
    border-bottom: 1px solid var(--md-outline);
}

.hbm-portal-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    padding: 1rem 2rem 1.25rem;
    background: linear-gradient(180deg, rgba(245, 248, 252, 0.96) 0%, rgba(255, 255, 255, 0.98) 100%);
    border-bottom: 1px solid var(--md-outline);
}

.hbm-portal-metric {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.9rem 1rem;
    background: var(--md-surface);
    border: 1px solid var(--md-outline);
    border-radius: var(--md-radius-md);
    box-shadow: var(--md-elevation-1);
}

.hbm-portal-metric__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--md-primary) 10%, transparent);
    color: var(--md-primary);
    flex-shrink: 0;
}

.hbm-portal-metric__body {
    min-width: 0;
}

.hbm-portal-metric__label {
    display: block;
    margin-bottom: 0.15rem;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--md-on-surface-variant);
}

.hbm-portal-metric__value {
    display: block;
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--md-on-surface);
    line-height: 1.35;
    word-break: break-word;
}

.hbm-portal-booking-ref .hbm-portal-label {
    display: block;
    font-size: 0.8rem;
    color: var(--md-on-surface-variant);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hbm-portal-booking-ref .hbm-portal-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--md-on-surface);
}

.hbm-portal-status {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 999px;
}

.hbm-status--pending,
.hbm-portal-status.hbm-status--pending {
    background: #fcf9e8;
    color: #856404;
}

.hbm-status--confirmed,
.hbm-portal-status.hbm-status--confirmed {
    background: var(--md-success-light);
    color: var(--md-success-dark, #1b5e20);
}

.hbm-status--cancelled,
.hbm-portal-status.hbm-status--cancelled {
    background: var(--md-error-light);
    color: var(--md-error-dark, #b71c1c);
}

.hbm-status--completed,
.hbm-portal-status.hbm-status--completed {
    background: var(--md-success-light);
    color: var(--md-success-dark, #1b5e20);
}

/* ==========================================================================
   Sections
   ========================================================================== */
.hbm-portal-section {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--md-outline);
    background: var(--md-surface);
}

/* Keep guest cards aligned with the shared mobile spacing and radius scale. */
@media (max-width: 640px) {
    .hbm-portal-card,
    .hbm-portal-section,
    .hbm-portal-detail,
    .hbm-portal-property {
        border-radius: var(--md-radius-md);
    }

    .hbm-portal-section {
        padding: var(--md-space-md);
    }

    .hbm-portal-section h3 {
        margin-bottom: var(--md-space-sm);
        line-height: 1.35;
    }
}

.hbm-portal-section:last-of-type {
    border-bottom: none;
}

.hbm-portal-section h3 {
    margin: 0 0 0.9rem;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--md-primary);
    line-height: 1.25;
}

.hbm-portal-cancel-section h3 {
    font-size: 0.85rem !important;
    color: var(--md-error) !important;
}

/* Property display */
.hbm-portal-property {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    border-radius: var(--md-radius-md);
    background: linear-gradient(180deg, rgba(245, 248, 252, 0.96) 0%, var(--md-surface) 100%);
    border: 1px solid var(--md-outline);
}

.hbm-portal-property-image {
    flex-shrink: 0;
    width: 80px;
    height: 60px;
    border-radius: var(--md-radius-sm);
    overflow: hidden;
    background: var(--md-surface-variant);
}

.hbm-portal-property-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hbm-portal-property-info h4 {
    margin: 0 0 0.25rem;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    color: var(--md-on-surface);
}

.hbm-portal-property-info p {
    margin: 0;
    color: var(--md-on-surface-variant);
    font-size: 0.9rem;
}

.hbm-portal-stay-context {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.hbm-portal-copy {
    color: var(--md-on-surface-variant);
    font-size: 0.95rem;
    line-height: 1.65;
}

.hbm-portal-copy h4 {
    margin: 0 0 0.4rem;
    color: var(--md-on-surface);
    font-size: 0.95rem !important;
    font-weight: 700 !important;
}

.hbm-portal-copy p {
    margin: 0 0 0.75rem;
}

.hbm-portal-copy p:last-child {
    margin-bottom: 0;
}

.hbm-portal-copy--split {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.hbm-portal-location {
    display: grid;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid var(--md-outline);
    border-radius: var(--md-radius-md);
    background: var(--md-surface-variant);
}

.hbm-portal-address {
    margin: 0;
    color: var(--md-on-surface);
    font-weight: 600;
}

.hbm-portal-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    color: var(--md-on-surface-variant);
    font-size: 0.9rem;
}

.hbm-portal-map {
    display: grid;
    gap: 0.5rem;
}

.hbm-portal-map iframe {
    width: 100%;
    min-height: 240px;
    border: 1px solid var(--md-outline);
    border-radius: var(--md-radius-sm);
}

/* Details grid */
.hbm-portal-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}

.hbm-portal-detail {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 1rem;
    border-radius: var(--md-radius-md);
    background: var(--md-surface-variant);
    border: 1px solid var(--md-outline);
}

.hbm-portal-detail .hbm-portal-label {
    font-size: 0.8rem;
    color: var(--md-on-surface-variant);
    margin-bottom: 0.25rem;
    line-height: 1.35;
}

.hbm-portal-detail .hbm-portal-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--md-on-surface);
    line-height: 1.4;
    overflow-wrap: anywhere;
}

/* Payment section */
.hbm-portal-payment {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--md-radius-md);
    background: linear-gradient(135deg, color-mix(in srgb, var(--md-primary) 6%, transparent), color-mix(in srgb, var(--md-primary) 4%, transparent));
    border: 1px solid color-mix(in srgb, var(--md-primary) 15%, transparent);
}

.hbm-portal-total .hbm-portal-label {
    display: block;
    font-size: 0.85rem;
    color: var(--md-on-surface-variant);
}

.hbm-portal-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--md-on-surface);
}

/* ==========================================================================
   Cancel Section
   ========================================================================== */
.hbm-portal-actions {
    padding: 1.5rem 2rem;
    background: linear-gradient(180deg, rgba(245, 248, 252, 0.96) 0%, var(--md-surface) 100%);
    border-top: 1px solid var(--md-outline);
}

.hbm-portal-copy {
    padding: 1rem;
    background: var(--md-surface-variant);
    border: 1px solid var(--md-outline);
    border-radius: var(--md-radius-md);
}

.hbm-portal-copy p:last-child {
    margin-bottom: 0;
}

.hbm-portal-actions--document {
    display: flex;
    justify-content: center;
}

.hbm-portal-actions--document .hbm-portal-btn {
    max-width: 320px;
}

/* ==========================================================================
   Confirmation Document
   ========================================================================== */
.hbm-confirmation-document {
    max-width: 760px;
}

.hbm-confirmation-document__toolbar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.75rem;
    padding: 1.5rem 2rem;
    background: var(--md-background);
    border-bottom: 1px solid var(--md-outline);
}

.hbm-confirmation-document__header {
    padding: 2rem 2rem 1.5rem;
    border-bottom: 1px solid var(--md-outline);
    background: linear-gradient(135deg, color-mix(in srgb, var(--md-primary) 4%, transparent) 0%, var(--md-surface) 100%);
}

.hbm-confirmation-document__title,
.hbm-portal-booking-header__main {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
}

.hbm-confirmation-document__title {
    margin-top: 2rem;
}

.hbm-confirmation-document__generated {
    margin-top: 0.5rem !important;
}

.hbm-portal-booking-header {
    display: block;
    padding: 2rem;
    background: linear-gradient(135deg, #f3f8fb 0%, #fff 68%);
}

.hbm-portal-booking-header__main {
    margin-top: 2rem;
}

.hbm-portal-booking-ref h2 {
    margin: 0 0 0.75rem;
    color: var(--md-on-surface);
    font-size: clamp(1.75rem, 4vw, 2.5rem) !important;
    line-height: 1.1;
    letter-spacing: -0.035em;
}

.hbm-portal-booking-header__intro {
    max-width: 620px;
    margin: 1rem 0 1.25rem;
    color: var(--md-on-surface-variant);
}

.hbm-confirmation-document__header h2 {
    margin: 0.25rem 0;
    font-size: 1.75rem;
    color: var(--md-on-surface);
}

.hbm-confirmation-document__header p {
    margin: 0;
    color: var(--md-on-surface-variant);
}

@media print {
    @page {
        size: A4;
        margin: 12mm;
    }

    body * {
        visibility: hidden;
    }

    .hbm-confirmation-document,
    .hbm-confirmation-document * {
        visibility: visible;
    }

    .hbm-confirmation-document {
        position: absolute;
        inset: 0;
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 0;
        color: #17212b;
        font-size: 9pt;
        line-height: 1.4;
    }

    .hbm-confirmation-document__toolbar,
    .hbm-portal-footer {
        display: none;
    }

    .hbm-confirmation-document__card {
        box-shadow: none;
        border-radius: 0;
        border: 0;
    }

    .hbm-confirmation-document__header {
        padding: 0 0 7mm;
        background: #fff;
        break-after: avoid;
    }

    .hbm-confirmation-document .hbm-portal-section {
        padding: 3.5mm 0;
        break-inside: auto;
        background: #fff;
    }

    .hbm-confirmation-document .hbm-portal-detail,
    .hbm-confirmation-document .hbm-portal-location,
    .hbm-confirmation-document .hbm-portal-group-item {
        padding: 3mm;
        background: #fff;
        box-shadow: none;
        break-inside: avoid;
    }

    .hbm-confirmation-document .hbm-portal-copy {
        padding: 2.5mm;
        background: #fff;
        box-shadow: none;
        orphans: 3;
        widows: 3;
    }

    .hbm-confirmation-document .hbm-portal-map,
    .hbm-confirmation-document .hbm-portal-copy--split,
    .hbm-confirmation-document__links,
    .hbm-confirmation-document .hbm-calendar-buttons {
        display: none !important;
    }

    .hbm-confirmation-document a {
        color: inherit;
        text-decoration: none;
    }

    .hbm-confirmation-document .hbm-portal-details-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 3mm;
    }

    .hbm-confirmation-document .hbm-portal-section h3 {
        margin-bottom: 3mm;
        break-after: avoid;
    }

    .hbm-confirmation-document .hbm-guest-brand__logo {
        max-height: 14mm;
    }
}

.hbm-portal-cancel-section h3 {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--md-error);
}

.hbm-portal-cancel-info {
    margin: 0 0 1rem;
    font-size: 0.9rem;
    color: var(--md-on-surface-variant);
}

.hbm-portal-cancel-info--warning {
    color: var(--md-error);
    font-weight: 500;
}

@media (max-width: 640px) {
    .hbm-guest-portal {
        margin: 1rem auto;
        padding: 0 0.75rem;
    }

    .hbm-portal-header,
    .hbm-portal-form,
    .hbm-portal-section,
    .hbm-portal-booking-header,
    .hbm-portal-actions,
    .hbm-confirmation-document__header,
    .hbm-confirmation-document__toolbar {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .hbm-portal-property {
        align-items: flex-start;
    }

    .hbm-portal-actions--wrap .hbm-portal-btn {
        flex-basis: 100%;
    }

    .hbm-portal-booking-header__main,
    .hbm-confirmation-document__title {
        align-items: flex-start;
        flex-direction: column;
    }

    .hbm-portal-booking-header__action {
        width: 100%;
    }
}

.hbm-portal-checkbox {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	min-height: 44px;
	align-items: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--md-on-surface);
    cursor: pointer;
}

.hbm-portal-checkbox input {
	appearance: auto;
	-webkit-appearance: auto;
	accent-color: var(--md-primary, #1565c0);
	width: 22px;
	height: 22px;
	min-width: 22px;
	margin: 0;
	flex: 0 0 22px;
}

.hbm-portal-cancel-form .hbm-portal-btn--danger {
    width: auto;
}

.hbm-portal-cancel-unavailable {
    padding: 1rem;
    background: var(--md-background);
    border-radius: var(--md-radius-sm);
    text-align: center;
}

.hbm-portal-cancel-unavailable p {
    margin: 0;
    color: var(--md-on-surface-variant);
}

/* ==========================================================================
   Success State
   ========================================================================== */
.hbm-portal-success {
    padding: 3rem 2rem;
    text-align: center;
}

.hbm-portal-success .hbm-icon {
    width: 64px;
    height: 64px;
    color: var(--md-success);
    margin-bottom: 1rem;
}

.hbm-portal-success h2 {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
    color: var(--md-on-surface);
}

.hbm-portal-success p {
    margin: 0 0 0.5rem;
    color: var(--md-on-surface-variant);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 600px) {
    .hbm-guest-portal {
        margin: 1rem auto;
    }

    .hbm-portal-header,
    .hbm-portal-form,
    .hbm-portal-section,
    .hbm-portal-footer,
    .hbm-portal-actions {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .hbm-portal-booking-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .hbm-portal-details-grid {
        grid-template-columns: 1fr 1fr;
    }

    .hbm-portal-payment {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .hbm-portal-property {
        flex-direction: column;
        align-items: flex-start;
    }

    .hbm-portal-property-image {
        width: 100%;
        height: 150px;
    }
}

/* ==========================================================================
   Badge (payment status)
   ========================================================================== */
.hbm-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 999px;
}

.hbm-badge--paid {
    background: var(--md-success-light);
    color: var(--md-success-dark, #1b5e20);
}

.hbm-badge--unpaid {
    background: #fcf9e8;
    color: #856404;
}

.hbm-badge--refunded {
    background: var(--md-success-light);
    color: var(--md-success-dark, #1b5e20);
}

.hbm-badge--partial {
    background: #fcf9e8;
    color: #856404;
}

/* ==========================================================================
   Calendar Integration
   ========================================================================== */
.hbm-portal-calendar {
    border-top: 1px solid var(--md-outline);
}

.hbm-calendar-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.hbm-calendar-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: var(--md-background);
    border: 1px solid var(--md-outline);
    border-radius: var(--md-radius-sm);
    color: var(--md-on-surface);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.hbm-calendar-btn:hover {
    background: var(--md-primary);
    border-color: var(--md-primary);
    color: var(--md-on-primary);
}

.hbm-calendar-icon {
    font-size: 1.1rem;
}

/* ==========================================================================
   Messenger Integration
   ========================================================================== */
.hbm-portal-messenger {
    border-top: 1px solid var(--md-outline);
}

.hbm-messenger-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 1.25rem;
    border-radius: var(--md-radius-sm);
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.hbm-messenger-whatsapp {
    background: #25d366;
    color: #fff;
}

.hbm-messenger-whatsapp:hover {
    background: #1ebe57;
    color: #fff;
}

.hbm-messenger-telegram {
    background: #0088cc;
    color: #fff;
}

.hbm-messenger-telegram:hover {
    background: #0077b5;
    color: #fff;
}

.hbm-messenger-facebook {
    background: #0084ff;
    color: #fff;
}

.hbm-messenger-facebook:hover {
    background: #0073e6;
    color: #fff;
}

.hbm-messenger-icon {
    font-size: 1.25rem;
}

/* ==========================================================================
   Check-in Time Selection
   ========================================================================== */
.hbm-portal-arrival-time {
    border-top: 1px solid var(--md-outline);
}

.hbm-arrival-form {
    margin-top: 1rem;
}

.hbm-arrival-select-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.hbm-arrival-select {
    flex: 1;
    min-width: 180px;
    padding: 0.625rem 1rem;
    font-size: 0.9375rem;
    border: 1px solid var(--md-outline);
    border-radius: var(--md-radius-sm);
    background: var(--md-surface);
    color: var(--md-on-surface);
}

.hbm-arrival-select:focus {
    outline: none;
    border-color: var(--md-primary);
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.2);
}

.hbm-late-checkin-notice {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: #fcf9e8;
    border: 1px solid #f0c33c;
    border-radius: var(--md-radius-sm);
    color: #856404;
    font-size: 0.875rem;
}

/* ==========================================================================
   Share Booking
   ========================================================================== */
.hbm-portal-share {
    border-top: 1px solid var(--md-outline);
}

.hbm-share-form {
    margin-top: 1rem;
}

.hbm-share-input-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.hbm-share-email {
    flex: 1;
    min-width: 200px;
    padding: 0.625rem 1rem;
    font-size: 0.9375rem;
    border: 1px solid var(--md-outline);
    border-radius: var(--md-radius-sm);
    background: var(--md-surface);
}

.hbm-share-email:focus {
    outline: none;
    border-color: var(--md-primary);
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.2);
}

/* ==========================================================================
   Success Alert
   ========================================================================== */
.hbm-portal-alert--success {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    margin: 1rem 1.5rem;
    background: var(--md-success-light);
    border: 1px solid var(--md-success);
    border-radius: var(--md-radius-sm);
    color: var(--md-success-dark, #1b5e20);
    font-size: 0.9375rem;
}

/* ==========================================================================
   Responsive Adjustments for New Sections
   ========================================================================== */
@media (max-width: 480px) {
    .hbm-calendar-buttons {
        flex-direction: column;
    }

    .hbm-calendar-btn {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    .hbm-arrival-select-wrapper,
    .hbm-share-input-wrapper {
        flex-direction: column;
    }

    .hbm-arrival-select,
    .hbm-share-email {
        width: 100%;
    }

    .hbm-arrival-select-wrapper .hbm-portal-btn,
    .hbm-share-input-wrapper .hbm-portal-btn {
        width: 100%;
    }
}

/* ==========================================================================
   Compact Guest Portal dashboard
   ========================================================================== */
.hbm-guest-portal:has(.hbm-portal-command-bar) {
    max-width: 1240px;
    font-size: 14px;
    line-height: 1.5;
}

.hbm-guest-portal .hbm-portal-card--wide:has(.hbm-portal-command-bar) {
    display: block;
    padding: 0 24px 20px;
    overflow: visible;
    background: #fff;
    border-color: #dce3eb;
    box-shadow: 0 12px 35px rgba(23, 42, 65, 0.08);
}

.hbm-portal-card--wide:has(.hbm-portal-command-bar) > .hbm-portal-booking-header,
.hbm-portal-card--wide:has(.hbm-portal-command-bar) > .hbm-alert,
.hbm-portal-card--wide:has(.hbm-portal-command-bar) > .hbm-portal-overview,
.hbm-portal-card--wide:has(.hbm-portal-command-bar) > .hbm-portal-command-bar,
.hbm-portal-card--wide:has(.hbm-portal-command-bar) > .hbm-portal-group-section,
.hbm-portal-card--wide:has(.hbm-portal-command-bar) > .hbm-portal-footer {
    grid-column: 1 / -1;
}

.hbm-portal-card--wide:has(.hbm-portal-command-bar) > .hbm-portal-booking-header {
    margin: 0 -24px;
    padding: 22px 28px 14px;
    background: #fff;
    border-bottom: 0;
}

.hbm-portal-card--wide:has(.hbm-portal-command-bar) .hbm-portal-booking-header__main {
    align-items: center;
    margin-top: 14px;
}

.hbm-portal-card--wide:has(.hbm-portal-command-bar) .hbm-portal-booking-ref {
    display: grid;
    grid-template-columns: auto auto;
    align-items: baseline;
    gap: 3px 8px;
}

.hbm-portal-card--wide:has(.hbm-portal-command-bar) .hbm-portal-booking-ref h2 {
    grid-column: 1 / -1;
    margin: 0;
    font-size: clamp(1.75rem, 3vw, 2.15rem) !important;
}

.hbm-portal-card--wide:has(.hbm-portal-command-bar) .hbm-portal-booking-ref .hbm-portal-label {
    font-size: 0.78rem;
    text-transform: none;
    letter-spacing: 0;
}

.hbm-portal-card--wide:has(.hbm-portal-command-bar) .hbm-portal-booking-ref .hbm-portal-value {
    font-size: 1rem;
    color: var(--md-primary);
}

.hbm-portal-card--wide:has(.hbm-portal-command-bar) > .hbm-portal-overview {
    grid-template-columns: 1.1fr 1.2fr 0.9fr 1fr 1.35fr;
    gap: 0;
    padding: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid #dce3eb;
    border-radius: 10px;
}

.hbm-portal-content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.85fr);
    gap: 12px;
    margin-top: 12px;
}

.hbm-portal-column {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 12px;
}

.hbm-portal-card--wide:has(.hbm-portal-command-bar) .hbm-portal-metric {
    min-width: 0;
    padding: 14px 16px;
    border: 0;
    border-right: 1px solid #dce3eb;
    border-radius: 0;
    box-shadow: none;
}

.hbm-portal-card--wide:has(.hbm-portal-command-bar) .hbm-portal-metric:last-child {
    border-right: 0;
}

.hbm-portal-card--wide:has(.hbm-portal-command-bar) .hbm-portal-metric__icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: #edf5ff;
}

.hbm-portal-card--wide:has(.hbm-portal-command-bar) .hbm-portal-metric__label {
    margin: 0;
    font-size: 0.68rem;
}

.hbm-portal-card--wide:has(.hbm-portal-command-bar) .hbm-portal-metric__value {
    font-size: 0.9rem;
}

.hbm-portal-card--wide:has(.hbm-portal-command-bar) .hbm-portal-metric small,
.hbm-portal-disclosure summary small {
    display: block;
    color: var(--md-on-surface-variant);
    font-size: 0.76rem;
    font-weight: 500;
}

.hbm-portal-command-bar {
    position: relative;
    z-index: 5;
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    min-height: 54px;
    padding: 4px 8px;
    background: #f5f9ff;
    border: 1px solid #a9cdfb;
    border-radius: 10px;
    margin-top: 12px;
}

.hbm-portal-command-bar > a,
.hbm-portal-command-menu > summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 44px;
    padding: 8px 14px;
    color: #075cb8;
    font-size: 0.86rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 7px;
    cursor: pointer;
}

.hbm-portal-command-bar > a:hover,
.hbm-portal-command-bar > a:focus-visible,
.hbm-portal-command-menu > summary:hover,
.hbm-portal-command-menu > summary:focus-visible {
    background: #e4f0ff;
    outline: 2px solid transparent;
}

.hbm-portal-command-bar > a + a,
.hbm-portal-command-bar > details + a,
.hbm-portal-command-bar > a + details {
    border-left: 1px solid #d2e0f0;
}

.hbm-portal-command-bar > .hbm-portal-command-bar__whatsapp {
    margin: 3px 4px 3px auto;
    padding-inline: 18px;
    min-height: 38px;
    color: #fff;
    background: #16883b;
    border-left: 0;
}

.hbm-portal-command-bar > .hbm-portal-command-bar__whatsapp:hover,
.hbm-portal-command-bar > .hbm-portal-command-bar__whatsapp:focus-visible {
    color: #fff;
    background: #116f31;
}

.hbm-portal-command-menu {
    position: relative;
}

.hbm-portal-command-menu > summary {
    list-style: none;
}

.hbm-portal-command-menu > summary::-webkit-details-marker {
    display: none;
}

.hbm-portal-command-menu > div {
    position: absolute;
    top: calc(100% + 4px);
    left: 8px;
    display: grid;
    min-width: 160px;
    padding: 6px;
    background: #fff;
    border: 1px solid #dce3eb;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(23, 42, 65, 0.14);
}

.hbm-portal-command-menu > div a {
    padding: 9px 10px;
    color: var(--md-on-surface);
    font-weight: 600;
    text-decoration: none;
    border-radius: 5px;
}

.hbm-portal-command-menu > div a:hover,
.hbm-portal-command-menu > div a:focus-visible {
    background: #edf5ff;
}

.hbm-portal-card--wide:has(.hbm-portal-command-bar) > .hbm-portal-section,
.hbm-portal-card--wide:has(.hbm-portal-command-bar) > details.hbm-portal-section,
.hbm-portal-card--wide:has(.hbm-portal-command-bar) .hbm-portal-column > .hbm-portal-section,
.hbm-portal-card--wide:has(.hbm-portal-command-bar) .hbm-portal-column > details.hbm-portal-section {
    align-self: stretch;
    padding: 18px;
    border: 1px solid #dce3eb;
    border-radius: 10px;
    background: #fff;
}

.hbm-portal-card--wide:has(.hbm-portal-command-bar) > .hbm-portal-fees,
.hbm-portal-card--wide:has(.hbm-portal-command-bar) > .hbm-portal-guest-information,
.hbm-portal-card--wide:has(.hbm-portal-command-bar) > .hbm-portal-cancellation-terms,
.hbm-portal-card--wide:has(.hbm-portal-command-bar) > .hbm-portal-adjustments,
.hbm-portal-card--wide:has(.hbm-portal-command-bar) > .hbm-portal-share,
.hbm-portal-card--wide:has(.hbm-portal-command-bar) > .hbm-portal-manage {
    grid-column: 2;
}

.hbm-portal-card--wide:has(.hbm-portal-command-bar) > .hbm-portal-arrival,
.hbm-portal-card--wide:has(.hbm-portal-command-bar) > .hbm-portal-about,
.hbm-portal-card--wide:has(.hbm-portal-command-bar) > .hbm-portal-beds,
.hbm-portal-card--wide:has(.hbm-portal-command-bar) > .hbm-portal-stay-choices,
.hbm-portal-card--wide:has(.hbm-portal-command-bar) > .hbm-portal-general-rules,
.hbm-portal-card--wide:has(.hbm-portal-command-bar) > .hbm-portal-arrival-time {
    grid-column: 1;
}

.hbm-portal-card--wide:has(.hbm-portal-command-bar) .hbm-portal-section h3 {
    margin-bottom: 12px;
    color: #075cb8;
    font-size: 1rem !important;
    font-weight: 720 !important;
    text-transform: none;
    letter-spacing: 0;
}

.hbm-portal-arrival__layout {
    display: grid;
    grid-template-columns: minmax(210px, 0.85fr) minmax(0, 1.15fr);
    gap: 18px;
}

.hbm-portal-arrival__layout--without-map {
    grid-template-columns: 1fr;
}

.hbm-portal-arrival .hbm-map-widget {
    height: 220px !important;
    border-radius: 8px;
}

.hbm-portal-arrival__times {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    margin-bottom: 10px;
    border-bottom: 1px solid #dce3eb;
}

.hbm-portal-arrival__times p {
    display: grid;
    margin: 0 0 10px;
}

.hbm-portal-copy--plain,
.hbm-portal-card--wide:has(.hbm-portal-command-bar) .hbm-portal-copy {
    padding: 0;
    color: #42526a;
    background: transparent;
    border: 0;
    border-radius: 0;
    line-height: 1.55;
}

.hbm-portal-card--wide:has(.hbm-portal-command-bar) .hbm-portal-details-grid {
    gap: 8px;
}

.hbm-portal-card--wide:has(.hbm-portal-command-bar) .hbm-portal-detail {
    padding: 10px 12px;
    background: #f7f9fc;
    border-color: #e5e9ef;
}

.hbm-portal-disclosure {
    padding: 0 !important;
    overflow: hidden;
}

.hbm-portal-disclosure > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 52px;
    padding: 10px 14px;
    color: #075cb8;
    list-style: none;
    cursor: pointer;
}

.hbm-portal-disclosure > summary::-webkit-details-marker {
    display: none;
}

.hbm-portal-disclosure[open] > summary {
    background: #f5f9ff;
    border-bottom: 1px solid #dce3eb;
}

.hbm-portal-disclosure[open] > summary .hbm-icon {
    transform: rotate(180deg);
}

.hbm-portal-disclosure__body {
    margin: 0;
    padding: 14px !important;
}

.hbm-portal-manage .hbm-portal-disclosure + .hbm-portal-disclosure,
.hbm-portal-manage .hbm-portal-actions {
    margin-top: 10px;
}

.hbm-change-request-form,
.hbm-change-request-form label {
    display: grid;
    gap: 5px;
}

.hbm-change-request-form {
    gap: 12px;
}

.hbm-change-request-form__dates {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.hbm-change-request-form input,
.hbm-change-request-form textarea,
.hbm-change-request-form select {
    width: 100%;
    min-height: 44px;
    padding: 9px 11px;
    color: var(--md-on-surface);
    font: inherit;
    background: #fff;
    border: 1px solid var(--md-outline);
    border-radius: 7px;
    box-sizing: border-box;
}

.hbm-change-request-form textarea {
    resize: vertical;
}

.hbm-portal-card--wide:has(.hbm-portal-command-bar) .hbm-portal-alert {
    margin: 0 0 12px;
    padding: 10px 12px;
    font-size: 0.84rem;
}

.hbm-portal-card--wide:has(.hbm-portal-command-bar) .hbm-portal-actions {
    padding: 14px;
    background: #fff9f8;
    border: 1px solid #f1d2ce;
    border-radius: 8px;
}

.hbm-portal-card--wide:has(.hbm-portal-command-bar) .hbm-portal-cancel-section h3 {
    margin-bottom: 6px;
    font-size: 0.9rem !important;
}

.hbm-portal-card--wide:has(.hbm-portal-command-bar) > .hbm-portal-footer {
    margin: 4px -24px -20px;
    padding: 14px 24px;
}

@media (max-width: 900px) {
    .hbm-guest-portal .hbm-portal-card--wide:has(.hbm-portal-command-bar) {
        padding-inline: 16px;
    }

    .hbm-portal-content-grid {
        grid-template-columns: 1fr;
    }

    .hbm-portal-card--wide:has(.hbm-portal-command-bar) > .hbm-portal-section,
    .hbm-portal-card--wide:has(.hbm-portal-command-bar) > details.hbm-portal-section {
        grid-column: 1;
    }

    .hbm-portal-card--wide:has(.hbm-portal-command-bar) > .hbm-portal-overview {
        grid-template-columns: repeat(2, 1fr);
    }

    .hbm-portal-card--wide:has(.hbm-portal-command-bar) .hbm-portal-metric:nth-child(even) {
        border-right: 0;
    }

    .hbm-portal-card--wide:has(.hbm-portal-command-bar) .hbm-portal-metric--address {
        grid-column: 1 / -1;
        border-top: 1px solid #dce3eb;
        border-right: 0;
    }

    .hbm-portal-card--wide:has(.hbm-portal-command-bar) > .hbm-portal-booking-header {
        margin-inline: -16px;
    }

    .hbm-portal-card--wide:has(.hbm-portal-command-bar) > .hbm-portal-footer {
        margin-inline: -16px;
    }
}

@media (max-width: 640px) {
    .hbm-guest-portal:has(.hbm-portal-command-bar) {
        padding: 0 8px;
    }

    .hbm-guest-portal .hbm-portal-card--wide:has(.hbm-portal-command-bar) {
        gap: 8px;
        padding-inline: 10px;
    }

    .hbm-portal-card--wide:has(.hbm-portal-command-bar) > .hbm-portal-booking-header {
        margin-inline: -10px;
        padding: 18px 16px 12px;
    }

    .hbm-portal-card--wide:has(.hbm-portal-command-bar) .hbm-portal-booking-header__main {
        gap: 10px;
    }

    .hbm-portal-card--wide:has(.hbm-portal-command-bar) .hbm-portal-status {
        padding: 5px 9px;
        font-size: 0.7rem;
    }

    .hbm-portal-card--wide:has(.hbm-portal-command-bar) > .hbm-portal-overview {
        grid-template-columns: 1fr;
    }

    .hbm-portal-card--wide:has(.hbm-portal-command-bar) .hbm-portal-metric,
    .hbm-portal-card--wide:has(.hbm-portal-command-bar) .hbm-portal-metric:nth-child(even) {
        padding: 10px 12px;
        border-right: 0;
        border-bottom: 1px solid #dce3eb;
    }

    .hbm-portal-card--wide:has(.hbm-portal-command-bar) .hbm-portal-metric:last-child {
        border-bottom: 0;
    }

    .hbm-portal-command-bar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 5px;
    }

    .hbm-portal-command-bar > a,
    .hbm-portal-command-menu > summary {
        width: 100%;
        padding-inline: 8px;
        border-left: 0 !important;
        box-sizing: border-box;
    }

    .hbm-portal-command-bar > .hbm-portal-command-bar__whatsapp {
        margin: 2px;
    }

    .hbm-portal-arrival__layout,
    .hbm-change-request-form__dates {
        grid-template-columns: 1fr;
    }

    .hbm-portal-card--wide:has(.hbm-portal-command-bar) .hbm-portal-details-grid {
        grid-template-columns: 1fr;
    }

    .hbm-portal-card--wide:has(.hbm-portal-command-bar) .hbm-portal-value {
        overflow-wrap: anywhere;
    }

    .hbm-portal-arrival .hbm-map-widget {
        height: 190px !important;
    }

    .hbm-portal-card--wide:has(.hbm-portal-command-bar) > .hbm-portal-section,
    .hbm-portal-card--wide:has(.hbm-portal-command-bar) > details.hbm-portal-section,
    .hbm-portal-card--wide:has(.hbm-portal-command-bar) .hbm-portal-column > .hbm-portal-section,
    .hbm-portal-card--wide:has(.hbm-portal-command-bar) .hbm-portal-column > details.hbm-portal-section {
        padding: 14px;
    }

    .hbm-portal-card--wide:has(.hbm-portal-command-bar) > .hbm-portal-footer {
        margin-inline: -10px;
    }
}
