/*
 * Smash Booking — Structural CSS
 *
 * Colors are controlled via CSS custom properties.
 * Set the Color Scheme in Smash Booking → Settings to switch between
 * Inherit (default), Light, or Dark.
 */

/* ── Root / inherit (default) ─────────────────────────────────── */
.smash-booking {
    --sb-text:        inherit;
    --sb-invert-bg:   var(--wp--preset--color--contrast, #111111);
    --sb-invert-text: var(--wp--preset--color--base, #ffffff);
    --sb-error:       #e53e3e;
    --sb-radius:      4px;
    --sb-gap:         1.25rem;
    --sb-field-bg:    transparent;
    --sb-field-text:  inherit;

    color:      var(--sb-text);
    box-sizing: border-box;
    width:      100%;
}

/* ── Light scheme — dark text for light/white backgrounds ─────── */
.smash-booking[data-scheme="light"] {
    --sb-text:        #111111;
    --sb-invert-bg:   #111111;
    --sb-invert-text: #ffffff;
    --sb-error:       #c0392b;
    --sb-field-bg:    rgba(255, 255, 255, 0.9);
    --sb-field-text:  #111111;

    color: var(--sb-text);
}

/* ── Dark scheme — light text for dark/black backgrounds ──────── */
.smash-booking[data-scheme="dark"] {
    --sb-text:        rgba(255, 255, 255, 0.92);
    --sb-invert-bg:   rgba(255, 255, 255, 0.92);
    --sb-invert-text: #111111;
    --sb-error:       #ff6b6b;
    --sb-field-bg:    #1a1a1a;
    --sb-field-text:  rgba(255, 255, 255, 0.92);

    color: var(--sb-text);
}

.smash-booking *,
.smash-booking *::before,
.smash-booking *::after {
    box-sizing: inherit;
}

/* Force headings and labels to inherit the scheme color.
   Themes commonly apply an explicit color to h1–h6 which breaks
   the currentColor cascade — this override wins. */
.smash-booking h1,
.smash-booking h2,
.smash-booking h3,
.smash-booking h4,
.smash-booking h5,
.smash-booking h6,
.smash-booking p,
.smash-booking label,
.smash-booking dt,
.smash-booking dd,
.smash-booking span:not(.smash-btn--primary span) {
    color: inherit;
}

/* ── Step nav ─────────────────────────────────────────────────── */
.smash-booking__steps-nav {
    display:        flex;
    flex-wrap:      wrap;
    gap:            0;
    margin-bottom:  var(--sb-gap);
    border-bottom:  1px solid currentColor;
    padding-bottom: 0;
}

.smash-step {
    display:        inline-flex;
    align-items:    center;
    gap:            .35rem;
    padding:        .5rem 1rem;
    font-size:      .78rem;
    font-weight:    600;
    text-transform: uppercase;
    letter-spacing: .06em;
    opacity:        .35;
    cursor:         default;
    border:         1px solid transparent;
    border-bottom:  none;
    margin-bottom:  -1px;
    user-select:    none;
}

.smash-step--active {
    opacity:      1;
    border-color: currentColor;
    background:   transparent;
}

.smash-step--done {
    opacity: .6;
}

.smash-step__num,
.smash-step__check {
    font-size: .75rem;
}

/* ── Layout ───────────────────────────────────────────────────── */
.smash-booking__layout {
    display:               grid;
    grid-template-columns: 1fr;
    gap:                   var(--sb-gap);
    align-items:           start;
}

@media (min-width: 768px) {
    .smash-booking__layout {
        grid-template-columns: 1fr 280px;
    }
}

/* ── Summary sidebar ──────────────────────────────────────────── */
.smash-summary {
    border:  1px solid currentColor;
    padding: var(--sb-gap);
    opacity: .9;
}

.smash-summary__eyebrow {
    font-size:      .7rem;
    font-weight:    700;
    text-transform: uppercase;
    letter-spacing: .12em;
    opacity:        .45;
    margin-bottom:  .5rem;
}

.smash-summary__pkg-name {
    font-size:      1.1rem;
    font-weight:    800;
    text-transform: uppercase;
    letter-spacing: .02em;
    margin-bottom:  .25rem;
}

.smash-summary__desc {
    font-size:    .83rem;
    opacity:      .6;
    margin:       0 0 .75rem;
    line-height:  1.4;
}

.smash-summary__rows {
    display:               grid;
    grid-template-columns: auto 1fr;
    gap:                   .35rem .75rem;
    margin:                0 0 1rem;
    padding:               0;
}

.smash-summary__row {
    display: contents;
}

.smash-summary__row dt {
    font-size: .83rem;
    opacity:   .55;
}

.smash-summary__row dd {
    font-size:  .83rem;
    font-weight: 600;
    text-align: right;
    margin:     0;
}

.smash-summary__total {
    display:         flex;
    justify-content: space-between;
    align-items:     baseline;
    border-top:      1px solid currentColor;
    padding-top:     .75rem;
    font-size:       .85rem;
    font-weight:     700;
    text-transform:  uppercase;
    letter-spacing:  .05em;
}

.smash-summary__total strong {
    font-size: 1.4rem;
}

/* ── Step content ─────────────────────────────────────────────── */
.smash-step-title {
    font-size:      1.15rem;
    font-weight:    800;
    text-transform: uppercase;
    letter-spacing: .03em;
    margin:         0 0 1.25rem;
}

/* ── Category groups ──────────────────────────────────────────── */
.smash-category {
    margin-bottom: 1.75rem;
}

.smash-category__heading {
    font-size:      .7rem;
    font-weight:    800;
    text-transform: uppercase;
    letter-spacing: .18em;
    color:          var(--sb-category-color, currentColor);
    margin-bottom:  .4rem;
}

.smash-category__stripe {
    height:        2px;
    background:    var(--sb-category-color, currentColor);
    opacity:       .5;
    margin-bottom: .85rem;
}

/* ── Card grid ────────────────────────────────────────────────── */
.smash-grid {
    display:               grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap:                   .75rem;
    margin-bottom:         1.25rem;
}

/* ── Cards ────────────────────────────────────────────────────── */
.smash-card {
    display:        flex;
    flex-direction: column;
    gap:            .3rem;
    padding:        .875rem 1rem;
    border:         1px solid currentColor;
    background:     transparent;
    color:          inherit;
    font-family:    inherit;
    text-align:     left;
    cursor:         pointer;
    border-radius:  var(--sb-radius);
    opacity:        .65;
    transition:     opacity .12s ease;
}

.smash-card:hover,
.smash-card:focus-visible {
    opacity: 1;
    outline: none;
}

.smash-card--selected {
    opacity:        1;
    background:     var(--sb-invert-bg);
    color:          var(--sb-invert-text);
    border-color:   var(--sb-invert-bg);
}

.smash-card__top {
    display:         flex;
    justify-content: space-between;
    align-items:     flex-start;
    gap:             .5rem;
}

.smash-card__name {
    font-size:      .85rem;
    font-weight:    700;
    text-transform: uppercase;
    letter-spacing: .04em;
    line-height:    1.2;
}

.smash-card__price {
    font-size:   .85rem;
    font-weight: 700;
    white-space: nowrap;
}

.smash-card__meta {
    font-size: .75rem;
    opacity:   .65;
}

.smash-card__desc {
    font-size:   .75rem;
    opacity:     .6;
    margin-top:  .2rem;
    line-height: 1.4;
}

/* ── Actions bar ──────────────────────────────────────────────── */
.smash-actions {
    display:         flex;
    justify-content: space-between;
    align-items:     center;
    gap:             1rem;
    margin-top:      1.5rem;
    padding-top:     1rem;
    border-top:      1px solid currentColor;
    opacity:         .9;
}

/* ── Buttons ──────────────────────────────────────────────────── */
.smash-btn {
    padding:        .55rem 1.4rem;
    border:         1px solid currentColor;
    background:     transparent;
    color:          inherit;
    font-family:    inherit;
    font-size:      .82rem;
    font-weight:    700;
    text-transform: uppercase;
    letter-spacing: .06em;
    cursor:         pointer;
    border-radius:  var(--sb-radius);
    transition:     opacity .12s ease;
}

.smash-btn:hover:not(:disabled) {
    opacity: .7;
}

.smash-btn:focus-visible {
    outline:        2px solid currentColor;
    outline-offset: 2px;
}

.smash-btn:disabled {
    opacity: .3;
    cursor:  not-allowed;
}

.smash-btn--primary {
    background:   var(--sb-invert-bg);
    color:        var(--sb-invert-text);
    border-color: var(--sb-invert-bg);
}

/* ── Form fields ──────────────────────────────────────────────── */
.smash-field {
    display:       flex;
    flex-direction: column;
    gap:           .3rem;
    margin-bottom: var(--sb-gap);
}

.smash-label {
    font-size:      .78rem;
    font-weight:    700;
    text-transform: uppercase;
    letter-spacing: .07em;
}

.smash-req {
    opacity:     .4;
    font-weight: 400;
}

.smash-optional {
    font-weight:    400;
    opacity:        .5;
    font-size:      .78em;
    text-transform: none;
    letter-spacing: 0;
}

.smash-input,
.smash-textarea {
    padding:       .55rem .75rem;
    border:        1px solid currentColor;
    color:         var(--sb-field-text) !important;
    font-family:   inherit;
    font-size:     .9rem;
    border-radius: var(--sb-radius);
    opacity:       .8;
}

/* Inputs need an explicit background — browsers render their own grey otherwise */
.smash-input {
    background-color: var(--sb-field-bg) !important;
}

/* Textareas render transparent correctly — keep it that way */
.smash-textarea {
    background: transparent !important;
}

.smash-input:focus,
.smash-textarea:focus {
    outline:        2px solid currentColor;
    outline-offset: 2px;
    opacity:        1;
}

.smash-textarea {
    resize:     vertical;
    min-height: 90px;
}

/* ── Form two-column row ──────────────────────────────────────── */
.smash-form-row {
    display:               grid;
    grid-template-columns: 1fr 1fr;
    gap:                   1rem;
}

@media (max-width: 600px) {
    .smash-form-row {
        grid-template-columns: 1fr;
    }
}

/* ── Form field colours ───────────────────────────────────────── */
/*
 * --sb-field-bg and --sb-field-text are defined per scheme above.
 * The shortcode can override them inline when an admin color is set.
 * .smash-input / .smash-textarea use the vars directly (see above).
 * The rule below catches any other inputs the theme might style.
 */
/* Inputs & selects need an explicit bg — textareas are fine with transparent */
.smash-booking input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
.smash-booking select {
    background-color: var(--sb-field-bg) !important;
    color:            var(--sb-field-text) !important;
}

.smash-booking textarea {
    background: transparent !important;
    color:      var(--sb-field-text) !important;
}

/* ── Override browser autofill background colour ──────────────── */
/* box-shadow inset trick paints over the browser's forced autofill bg */
.smash-booking input:-webkit-autofill,
.smash-booking input:-webkit-autofill:hover,
.smash-booking input:-webkit-autofill:focus,
.smash-booking input:-webkit-autofill:active {
    -webkit-text-fill-color: var(--sb-field-text) !important;
    -webkit-box-shadow:      0 0 0 1000px var(--sb-field-bg, #1a1a1a) inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* ── Date & time grid ─────────────────────────────────────────── */
.smash-date-time-grid {
    display:               grid;
    grid-template-columns: auto 1fr;
    gap:                   1.5rem;
    align-items:           start;
}

@media (max-width: 600px) {
    .smash-date-time-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Custom calendar ──────────────────────────────────────────── */
.sb-cal {
    user-select: none;
    min-width:   220px;
}

.sb-cal__hdr {
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    margin-bottom:   .6rem;
}

.sb-cal__month {
    font-size:      .82rem;
    font-weight:    700;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.sb-cal__nav {
    background:    none;
    border:        1px solid currentColor;
    color:         inherit;
    font-family:   inherit;
    font-size:     1rem;
    width:         1.8rem;
    height:        1.8rem;
    cursor:        pointer;
    border-radius: var(--sb-radius);
    display:       flex;
    align-items:   center;
    justify-content: center;
    opacity:       .7;
    transition:    opacity .1s;
}
.sb-cal__nav:hover:not(:disabled) { opacity: 1; }
.sb-cal__nav:disabled { opacity: .2; cursor: default; }

.sb-cal__grid {
    display:               grid;
    grid-template-columns: repeat(7, 2rem);
    gap:                   2px;
}

.sb-cal__dow {
    font-size:      .68rem;
    font-weight:    700;
    text-align:     center;
    padding:        .3rem 0;
    opacity:        .45;
    text-transform: uppercase;
}
.sb-cal__dow--off { opacity: .18; }

.sb-cal__cell {
    display:         flex;
    align-items:     center;
    justify-content: center;
    height:          2rem;
    font-size:       .82rem;
    font-weight:     500;
    border-radius:   var(--sb-radius);
    background:      none;
    border:          1px solid transparent;
    color:           inherit;
    font-family:     inherit;
    cursor:          pointer;
    transition:      opacity .1s;
}
.sb-cal__cell--blank { cursor: default; border: none; }

.sb-cal__cell--off {
    opacity:         .2;
    cursor:          default;
    text-decoration: line-through;
}

.sb-cal__cell--today {
    border-color: currentColor;
    opacity:      1;
}

.sb-cal__cell--sel {
    background:   var(--sb-invert-bg);
    color:        var(--sb-invert-text);
    border-color: var(--sb-invert-bg);
    opacity:      1;
}

.sb-cal__cell:not(.sb-cal__cell--off):not(.sb-cal__cell--sel):not(.sb-cal__cell--blank):hover {
    opacity:      1;
    border-color: currentColor;
}

/* ── Time slot buttons ────────────────────────────────────────── */
.smash-slots {
    display:   flex;
    flex-wrap: wrap;
    gap:       .4rem;
}

.smash-slot-btn {
    padding:        .45rem .875rem;
    border:         1px solid currentColor;
    background:     transparent;
    color:          inherit;
    font-family:    inherit;
    font-size:      .85rem;
    font-weight:    600;
    cursor:         pointer;
    border-radius:  var(--sb-radius);
    opacity:        .65;
    transition:     opacity .12s ease;
}

.smash-slot-btn:hover {
    opacity: 1;
}

.smash-slot-btn:focus-visible {
    outline:        2px solid currentColor;
    outline-offset: 2px;
}

.smash-slot-btn--selected {
    background:   var(--sb-invert-bg);
    color:        var(--sb-invert-text);
    border-color: var(--sb-invert-bg);
    opacity:      1;
}

/* ── Confirm rows ─────────────────────────────────────────────── */
.smash-confirm-rows {
    display:               grid;
    grid-template-columns: auto 1fr;
    gap:                   .45rem 1.25rem;
    margin:                0 0 1.25rem;
    padding:               0;
    max-width:             500px;
}

.smash-confirm-row {
    display: contents;
}

.smash-confirm-row dt {
    font-size: .88rem;
    opacity:   .55;
}

.smash-confirm-row dd {
    font-size:   .88rem;
    font-weight: 600;
    margin:      0;
}

/* ── Misc helpers ─────────────────────────────────────────────── */
.smash-payment-note {
    font-size:    .83rem;
    opacity:      .55;
    margin-bottom: 1rem;
}

.smash-error {
    color:     var(--sb-error, #c0392b);
    font-size: .83rem;
    display:   block;
    margin-top: .25rem;
}

.smash-hint,
.smash-loading {
    font-size: .83rem;
    opacity:   .5;
    margin:    0;
}

.smash-notice {
    opacity:   .6;
    font-size: .9rem;
}

.smash-prefilled-notice {
    font-size:     .83rem;
    margin-bottom: 1rem;
    padding:       .45rem .75rem;
    border:        1px solid currentColor;
    border-radius: var(--sb-radius);
    opacity:       .7;
}

/* ── Previous booking reminder banner (Step 3) ────────────────── */
.smash-prev-booking {
    display:       flex;
    flex-wrap:     wrap;
    align-items:   center;
    gap:           .5rem;
    margin-bottom: 1.25rem;
    padding:       .6rem .9rem;
    border:        1px solid currentColor;
    border-radius: var(--sb-radius);
    font-size:     .83rem;
    opacity:       .75;
}

.smash-prev-booking__label {
    font-weight:    700;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-size:      .72rem;
    opacity:        .6;
    white-space:    nowrap;
}

.smash-prev-booking__detail {
    line-height: 1.4;
}

/* ── Previously-booked time slot badge ────────────────────────── */
.smash-slot-btn--prev {
    position: relative;
}

.smash-slot-prev-badge {
    display:        block;
    font-size:      .6rem;
    font-weight:    700;
    text-transform: uppercase;
    letter-spacing: .05em;
    opacity:        .55;
    line-height:    1;
    margin-top:     .15rem;
}

/* ── People stepper (per-person packages) ─────────────────────── */
.sb-stepper {
    display:     flex;
    align-items: center;
    gap:         .6rem;
    margin-top:  .4rem;
}

.sb-stepper__btn {
    padding:     .25rem .7rem;
    font-size:   1.1rem;
    line-height: 1;
    min-width:   2rem;
}

.sb-stepper__val {
    font-size:   1.3rem;
    font-weight: 800;
    min-width:   2rem;
    text-align:  center;
}

/* ── Misc helpers ─────────────────────────────────────────────── */
.smash-link {
    background:  none;
    border:      none;
    color:       inherit;
    text-decoration: underline;
    font-family: inherit;
    font-size:   .78rem;
    cursor:      pointer;
    padding:     0;
    margin-top:  .5rem;
    opacity:     .55;
    display:     inline-block;
}

.smash-link:hover {
    opacity: 1;
}

/* ── Success layout overrides ─────────────────────────────────── */
.smash-booking--done .smash-booking__steps-nav {
    display: none;          /* remove the border line entirely */
}
.smash-booking--done .smash-booking__layout {
    display: block;         /* drop the sidebar column */
}

/* ── Success ──────────────────────────────────────────────────── */
.smash-success {
    text-align: center;
    padding:    4rem 1rem;
}

.smash-success__icon {
    font-size:     3rem;
    line-height:   1;
    margin-bottom: 1rem;
}

.smash-success__title {
    font-size:      1.4rem;
    font-weight:    800;
    text-transform: uppercase;
    margin:         0 0 .75rem;
}

.smash-success__message {
    font-size:    .95rem;
    opacity:      .7;
    margin:       0 0 1.75rem;
    max-width:    420px;
    margin-inline: auto;
}

.smash-success__again {
    padding: .65rem 2rem;
}
