/* v2 booking layout */
:root {
    --v2-header-h: 56px;
    --v2-footer-h: 72px;
    --v2-border: #e8e8e8;
    --v2-muted: #6c757d;
    --v2-radius: 10px;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body.v2-body {
    background: var(--obg, #f5f5f5);
    color: var(--obtext, #212529);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    height: 100dvh;
    height: 100svh;
}

.v2-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: none;
    margin: 0 auto;
    height: 100%;
    height: 100dvh;
    height: 100svh;
    min-height: 0;
    max-height: 100dvh;
    max-height: 100svh;
    overflow: hidden;
    background: #fff;
}

.v2-app {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    position: relative;
    overflow: hidden;
}

/* Header */
.v2-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: var(--v2-header-h);
    padding: 0 12px;
    border-bottom: 1px solid var(--v2-border);
    background: #fff;
    z-index: 20;
}

.v2-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--obaccent, #198754);
    font-size: 1.25rem;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
}

.v2-back-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.v2-back-btn.hidden {
    visibility: hidden;
    pointer-events: none;
}

.v2-header-title {
    flex: 1;
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.v2-header-sub {
    font-size: 0.75rem;
    color: var(--v2-muted);
    font-weight: 400;
}

/* Content */
.v2-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    position: relative;
}

.v2-panels {
    display: flex;
    height: 100%;
    transition: transform 0.28s ease;
    will-change: transform;
}

.v2-panel {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 16px 24px;
}

.v2-panel-inner {
    min-height: min-content;
}

/* Footer – always visible */
.v2-footer {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: var(--v2-footer-h);
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--v2-border);
    background: #fff;
    z-index: 30;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
}

.v2-footer-summary {
    flex: 1;
    min-width: 0;
}

.v2-footer-count {
    font-size: 0.8rem;
    color: var(--v2-muted);
}

.v2-footer-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--obtext, #212529);
}

.v2-next-btn {
    flex-shrink: 0;
    min-width: 120px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--v2-radius);
    background: var(--obtn, #198754);
    color: var(--obbtn-text, #fff);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}

.v2-next-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.v2-next-btn:not(:disabled):hover {
    filter: brightness(0.95);
}

.v2-app > .ob-book-branding {
    padding: 4px 16px calc(4px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--v2-border);
    background: #fff;
}

.v2-app > .ob-book-branding .ob-book-branding-logo {
    max-width: 52px;
}

/* List rows (categories, departments) */
.v2-list-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-radius);
    margin-bottom: 10px;
    background: #fff;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.v2-list-row:hover {
    background: rgba(0, 0, 0, 0.02);
    border-color: var(--obaccent, #198754);
}

.v2-list-row-body {
    flex: 1;
    min-width: 0;
}

.v2-list-row-title {
    font-weight: 600;
    font-size: 1rem;
    margin: 0 0 2px;
}

.v2-list-row-sub {
    font-size: 0.85rem;
    color: var(--v2-muted);
    margin: 0;
}

.v2-list-row-chevron {
    color: var(--v2-muted);
    font-size: 1.1rem;
}

/* Service / addon cards */
.v2-item-card {
    display: flex;
    gap: 12px;
    padding: 14px;
    border: 2px solid var(--v2-border);
    border-radius: var(--v2-radius);
    margin-bottom: 10px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    background: #fff;
}

.v2-item-card.selected {
    border-color: var(--obaccent, #198754);
    background: rgba(25, 135, 84, 0.06);
}

.v2-item-img {
    width: 72px;
    height: 72px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: #f0f0f0;
}

.v2-item-body {
    flex: 1;
    min-width: 0;
}

.v2-item-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin: 0 0 4px;
}

.v2-item-desc {
    font-size: 0.8rem;
    color: var(--v2-muted);
    margin: 0 0 6px;
    line-height: 1.4;
}

.v2-item-meta {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--obaccent, #198754);
}

.v2-item-check {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border: 2px solid var(--v2-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
}

.v2-item-card.selected .v2-item-check {
    border-color: var(--obaccent, #198754);
    background: var(--obaccent, #198754);
    color: #fff;
}

/* Selected pills */
.v2-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.v2-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    background: var(--obtn, #198754);
    color: var(--obbtn-text, #fff);
    font-size: 0.85rem;
}

.v2-pill-remove {
    border: none;
    background: transparent;
    color: inherit;
    padding: 0;
    cursor: pointer;
    line-height: 1;
}

/* Employee grid */
.v2-employee-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.v2-employee-card {
    flex: 0 0 calc(50% - 6px);
    text-align: center;
    padding: 16px 8px;
    border: 2px solid var(--v2-border);
    border-radius: var(--v2-radius);
    cursor: pointer;
}

.v2-employee-card.selected {
    border-color: var(--obaccent, #198754);
    background: rgba(25, 135, 84, 0.06);
}

.v2-employee-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    margin: 0 auto 8px;
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 1.5rem;
    color: var(--v2-muted);
}

.v2-employee-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Calendar & times */
.v2-datetime-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 768px) {
    .v2-datetime-layout {
        grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr);
        align-items: start;
    }
}

.v2-employee-times-block {
    width: 100%;
}

.v2-times-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 8px;
}

@media (min-width: 480px) {
    .v2-times-grid {
        grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    }
}

@media (min-width: 1024px) {
    .v2-times-grid {
        grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    }
}
#v2Calendar {
    position: relative;
}

#v2Calendar.v2-calendar-loading .ui-datepicker-calendar {
    visibility: hidden;
}

#v2Calendar .v2-calendar-month-loading {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    top: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.85);
    z-index: 2;
}

#v2Calendar .ui-datepicker {
    width: 100% !important;
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-radius);
    padding: 8px;
}

#v2Calendar .ui-datepicker-header {
    background: #fff !important;
    border: none;
}

#v2Calendar .ui-datepicker-title {
    background: #fff !important;
    color: var(--obtext, #212529);
}

#v2Calendar .ui-datepicker-title select {
    background: #fff !important;
    color: var(--obtext, #212529);
}

#v2Calendar .ui-datepicker table {
    border-collapse: separate;
    border-spacing: 3px;
    width: 100%;
}

#v2Calendar .ui-datepicker td {
    padding: 2px;
    text-align: center;
}

#v2Calendar .ui-datepicker-calendar td a,
#v2Calendar .ui-datepicker-calendar td span {
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    padding: 8px;
}

#v2Calendar .ui-datepicker-calendar td.ui-state-disabled span,
#v2Calendar .ui-datepicker-calendar td.ui-datepicker-unselectable span {
    text-align: center;
    color: #adb5bd;
    opacity: 1;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

#v2Calendar .available-day a {
    background: var(--obtn, #198754) !important;
    color: var(--obbtn-text, #fff) !important;
    border-radius: 6px;
}

#v2Calendar .ui-state-active {
    border-color: var(--obbtn, #198754) !important;
}

.v2-time-slot {
    padding: 10px 8px;
    text-align: center;
    border: 1px solid var(--v2-border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    background: #fff;
}

.v2-time-slot:hover {
    border-color: var(--obaccent, #198754);
}

.v2-time-slot.selected {
    background: var(--obbtn, #198754);
    border-color: var(--obbtn, #198754);
    color: var(--obbtn-text, #fff);
}

/* Forms */
.v2-form .form-control,
.v2-form .form-select {
    border-radius: 8px;
    padding: 12px;
}

.v2-form .form-control.is-invalid,
.v2-form .form-select.is-invalid {
    border-color: #dc3545;
}

.v2-form .form-control.is-invalid:focus,
.v2-form .form-select.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

.v2-form .form-check-input.is-invalid {
    border-color: #dc3545;
}

.v2-form .invalid-feedback {
    display: block;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.v2-form .form-check .invalid-feedback {
    margin-left: 1.5em;
}

.v2-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 16px;
}

.v2-alert-inline {
    border-radius: var(--v2-radius);
    margin-bottom: 16px;
}

/* Product qty */
.v2-qty-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.v2-qty-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--v2-border);
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Loading & empty */
.v2-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 48px 16px;
}

.v2-empty {
    text-align: center;
    padding: 48px 16px;
    color: var(--v2-muted);
}

/* Success */
.v2-success {
    text-align: center;
    padding: 32px 16px;
}

.v2-success-icon {
    font-size: 4rem;
    color: var(--obaccent, #198754);
    margin-bottom: 16px;
}

.v2-success-notify p {
    margin-bottom: 0.5rem;
    color: var(--v2-text, #212529);
}

.v2-success-notify p:last-child {
    margin-bottom: 0;
}

/* Payment */
.v2-payment-card {
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-radius);
    padding: 16px;|
    margin-bottom: 12px;
}

.v2-payment-summary dt {
    font-weight: 600;
    font-size: 0.85rem;
}

.v2-payment-summary dd {
    margin-bottom: 8px;
}

/* Top links */
.v2-top-links {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 10px 16px;
    background: #fff;
    border-bottom: 1px solid var(--v2-border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.v2-top-links::-webkit-scrollbar {
    display: none;
}

.v2-top-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid #e9ecef;
    background: #f8f9fa;
    color: var(--obtext, #212529);
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.v2-top-link i {
    font-size: 0.95rem;
    color: var(--obaccent, #198754);
    line-height: 1;
}

.v2-top-link:hover {
    background: #fff;
    border-color: var(--obaccent, #198754);
    color: var(--obtext, #212529);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    text-decoration: none;
}

.v2-top-link:active {
    transform: scale(0.98);
}

.v2-brand-bar {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 0;
    padding: 0;
    background: #fff;
    border-bottom: 1px solid var(--v2-border);
    text-align: center;
}

.v2-brand-logo-wrap {
    width: 100%;
    height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.v2-brand-logo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

@media (min-width: 768px) {
    .v2-brand-logo-wrap {
        max-width: 600px;
        height: 144px;
        margin: 0 auto;
    }

    .v2-top-links {
        justify-content: center;
        padding: 12px 24px;
    }
}

/* Venteliste btn in datetime */
.v2-waitlist-btn {
    width: 100%;
    margin-top: 12px;
}

@media (min-width: 768px) {
    .v2-panel {
        padding: 20px 24px 28px;
    }

    .v2-header,
    .v2-footer {
        padding-left: 24px;
        padding-right: 24px;
    }

    .v2-list-row,
    .v2-item-card {
        padding: 18px;
    }
}

/* Week calendar */
.v2-week-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.v2-week-label {
    font-weight: 600;
    font-size: 0.95rem;
}

.v2-week-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
}

.v2-week-day {
    border: 1px solid var(--v2-border);
    border-radius: 8px;
    min-height: 80px;
    padding: 6px;
    font-size: 0.75rem;
    cursor: default;
}

.v2-week-day.available {
    cursor: pointer;
    border-color: var(--obaccent, #198754);
}

.v2-week-day.available:hover,
.v2-week-day.selected {
    background: rgba(25, 135, 84, 0.08);
    border-color: var(--obaccent, #198754);
}

.v2-week-day.past,
.v2-week-day.unavailable {
    opacity: 0.45;
    pointer-events: none;
}

.v2-week-day-hd {
    font-weight: 600;
    text-align: center;
    margin-bottom: 4px;
}

.v2-week-times {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
}

.v2-week-time {
    border: 1px solid var(--v2-border);
    border-radius: 4px;
    background: #fff;
    padding: 2px 6px;
    font-size: 0.7rem;
    cursor: pointer;
}

.v2-week-time.selected {
    background: var(--obaccent, #198754);
    color: #fff;
    border-color: var(--obaccent, #198754);
}

.v2-portal-bar {
    flex-shrink: 0;
}

@media (max-width: 767px) {
    .v2-week-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1200px) {
    .v2-panel {
        padding: 24px 32px 32px;
        max-width: 1200px;
        margin: 0 auto;
    }
}
