/*
 * BinRental store — wizard components only. Site chrome (header, nav,
 * footer, pg-title, .button, grid, fonts) comes from the theme CSS copies
 * in webroot/theme/. This file styles what the theme doesn't have.
 */

:root {
    --dark: #282828;
    --text: #515151;
    --light: #f9f9f9;
    --primary: #269245;
    --primary-light: #2fb355;
    --secondary: #0776bc;
    --border: #e3e3e3;
    --danger: #b23b3b;
}

.br-store-main { padding: 40px 0 64px; min-height: 45vh; }

/* The wizard reads better narrow, even though the site container is 1308px */
.br-wizard { max-width: 900px; margin: 0 auto; }

.br-test-banner {
    background: #f9a825; color: #282828; text-align: center;
    font-weight: 600; font-size: 14px; padding: 6px 12px;
}

/* Ghost button variant (theme has primary/secondary/light only) */
.button.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.button.ghost:hover, .button.ghost:focus { border-color: var(--text); color: var(--dark); background: transparent; }
.button[disabled] { opacity: .5; cursor: not-allowed; }

/* Ajax-loading button state (pay button while the Helcim modal opens) */
.button.btn-loading { opacity: .85; cursor: progress; }
.button.btn-loading::after {
    content: ''; display: inline-block; vertical-align: -3px; margin-left: 10px;
    width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff;
    animation: br-spin .7s linear infinite;
}
@keyframes br-spin { to { transform: rotate(360deg); } }

/* ---- Alerts / flash ---- */

.alert { padding: 12px 16px; border-radius: 4px; margin-bottom: 20px; font-size: 16px; }
.alert-error, .message.error { background: #fbeaea; color: var(--danger); border: 1px solid #eac3c3; }
.alert-success, .message.success { background: #eaf7ee; color: #1d6f35; border: 1px solid #bfe3cb; }
.alert-info, .message { padding: 12px 16px; border-radius: 4px; margin-bottom: 20px; background: #eaf2fb; color: #0b5c91; border: 1px solid #c3d9ea; }

/* ---- Countdown / badges ---- */

/* Floating cutoff countdown — pinned top right, slim sticky bar on phones */
.countdown-float {
    position: fixed; top: 12px; right: 12px; z-index: 900;
    background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--primary);
    border-radius: 4px; box-shadow: 0 3px 12px rgba(0, 0, 0, .12);
    padding: 10px 16px; font-size: 14px; max-width: 340px;
}
.countdown-float strong { color: var(--primary); font-variant-numeric: tabular-nums; }
.countdown-float .fa { color: var(--primary); margin-right: 4px; }

@media (max-width: 767px) {
    .countdown-float {
        position: sticky; top: 0; right: auto; z-index: 900;
        max-width: none; margin: -10px 0 16px; text-align: center;
        border-radius: 0 0 4px 4px; box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
    }
}

.weekend-badge {
    display: inline-block; background: var(--secondary); color: #fff;
    font-size: 13px; border-radius: 4px; padding: 4px 10px; margin-bottom: 16px;
}

/* ---- Step progress indicator ---- */

.progress-steps {
    display: flex; list-style: none; margin: 0 0 36px; padding: 0;
    counter-reset: step;
}
.progress-steps li {
    flex: 1; position: relative; text-align: center;
    font-size: 13px; color: #9a9a9a; padding-top: 44px; line-height: 1.25;
}
.progress-steps li::before {
    /* numbered circle */
    counter-increment: step;
    content: counter(step);
    position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 34px; height: 34px; line-height: 30px; border-radius: 50%;
    background: #fff; border: 2px solid var(--border); color: #9a9a9a;
    font-weight: 700; font-size: 15px; z-index: 2;
}
.progress-steps li::after {
    /* connector to the previous step */
    content: ''; position: absolute; top: 16px; right: 50%; width: 100%;
    height: 2px; background: var(--border); z-index: 1;
}
.progress-steps li:first-child::after { display: none; }

.progress-steps li.done { color: var(--primary); }
.progress-steps li.done::before {
    content: '\2713';
    background: var(--primary); border-color: var(--primary); color: #fff;
}
.progress-steps li.done::after { background: var(--primary); }

.progress-steps li.active { color: var(--dark); font-weight: 700; }
.progress-steps li.active::before {
    background: #fff; border-color: var(--primary); color: var(--primary);
}
.progress-steps li.active::after { background: var(--primary); }

@media (max-width: 640px) {
    .progress-steps li { font-size: 0; padding-top: 40px; }
    .progress-steps li::before { width: 28px; height: 28px; line-height: 24px; font-size: 13px; }
    .progress-steps li::after { top: 13px; }
    .progress-steps li.active { font-size: 12px; }
}

/* ---- Option cards ---- */

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; margin: 20px 0; }

.option-card {
    /* Flex column, top-aligned: these are <button>s, and browsers vertically
     * CENTRE button content when the grid stretches cards to equal height —
     * which staggered the title baselines across tiles. */
    display: flex; flex-direction: column; justify-content: flex-start;
    align-items: stretch;
    border: 2px solid var(--border); border-radius: 6px;
    padding: 20px; background: #fff; cursor: pointer; text-align: left;
    transition: border-color .2s ease, box-shadow .2s ease; color: var(--text);
    font: inherit; font-size: 16px; width: 100%; position: relative;
}
.option-card:hover, .option-card:focus { border-color: var(--primary); box-shadow: 0 2px 10px rgba(0,0,0,.08); color: var(--text); }
.option-card.selected { border-color: var(--primary); background: #f4fbf6; }
.option-card .tile-img {
    /* Fixed-height box + contain: never crops, and every tile's text starts
     * on the same horizontal plane regardless of the image's aspect ratio. */
    display: block; width: 100%; height: 170px; object-fit: contain;
    border-radius: 4px; margin-bottom: 12px;
}
/* Bin-size tiles: taller box for the bin photos */
.option-card .tile-img-tall { height: 210px; }
.option-card h3 {
    font-family: 'Cabin', sans-serif; font-weight: 700; font-size: 1.1rem;
    margin: 0 0 6px; color: var(--dark); text-transform: none;
}
.option-card .price { color: var(--primary); font-weight: 700; font-size: 1.25rem; margin: 0; }
.option-card .sub { font-size: 14px; color: #7a7a7a; margin: 6px 0 0; line-height: 1.4; }

/* Click feedback while the next step loads: chosen tile pops, others fade */
.card-grid.choosing .option-card {
    opacity: .25; transform: scale(.97);
    transition: opacity .25s ease, transform .25s ease, border-color .25s ease;
    pointer-events: none;
}
.card-grid.choosing .option-card.chosen {
    opacity: 1; transform: scale(1);
    border-color: var(--primary); background: #f4fbf6;
    box-shadow: 0 2px 12px rgba(38, 146, 69, .25);
}

/* "Selected so far" chips under the step indicator */
.br-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: -20px 0 24px; }
.br-chip {
    display: inline-block; background: #eaf7ee; border: 1px solid #bfe3cb;
    color: #1d6f35; font-size: 13px; border-radius: 999px; padding: 4px 12px;
}
.br-chip .fa { font-size: 11px; margin-right: 3px; }

/* ---- Modal (delivery fee table) ---- */

.br-modal {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(40, 40, 40, .55);
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.br-modal[hidden] { display: none; }
.br-modal-box {
    background: #fff; border-radius: 8px; max-width: 420px; width: 100%;
    max-height: 80vh; display: flex; flex-direction: column;
    padding: 22px 24px; position: relative; box-shadow: 0 10px 40px rgba(0, 0, 0, .3);
}
.br-modal-box h3 { margin: 0 0 10px; font-size: 1.2rem; }
.br-modal-scroll { overflow-y: auto; }
.br-modal-wide { max-width: 680px; }
.br-tos { font-size: 15px; line-height: 1.55; padding-right: 6px; }
.br-tos h4, .br-tos h3, .br-tos h2 { font-family: 'Cabin', sans-serif; font-size: 1.05rem; font-weight: 700; margin: 18px 0 6px; text-transform: none; }
.br-tos h2:first-child, .br-tos h3:first-child, .br-tos h4:first-child { margin-top: 0; }
.br-tos p { margin: 0 0 10px; }
/* The theme resets list-style/padding globally; restore real lists here */
.br-tos ul, .br-tos ol { margin: 0 0 12px; padding-left: 24px; }
.br-tos ul { list-style: disc outside; }
.br-tos ol { list-style: decimal outside; }
.br-tos li { margin-bottom: 5px; padding-left: 2px; }
.br-modal-close {
    position: absolute; top: 10px; right: 12px; border: none; background: none;
    font-size: 26px; line-height: 1; color: #9a9a9a; cursor: pointer;
}
.br-modal-close:hover { color: var(--dark); }
.br-fee-typeahead { position: relative; }
.br-fee-suggestions {
    position: absolute; left: 0; right: 0; top: 100%; z-index: 40;
    list-style: none; margin: 2px 0 0; padding: 0;
    background: #fff; border: 1px solid var(--border); border-radius: 4px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .15); overflow: hidden;
}
.br-fee-suggestions li { padding: 10px 14px; cursor: pointer; font-size: 15px; }
.br-fee-suggestions li:hover { background: #eaf7ee; color: var(--primary); }
.br-fee-suggestions li.none { cursor: default; color: #7a7a7a; font-size: 14px; }
.br-fee-suggestions li.none:hover { background: none; color: #7a7a7a; }

.br-fee-result {
    background: #eaf7ee; border: 1px solid #bfe3cb; border-radius: 4px;
    padding: 12px 14px; margin-bottom: 12px; font-size: 16px; text-align: center;
}
.br-fee-result strong { color: var(--primary); }

.nudge {
    background: #eaf2fb; border-left: 4px solid var(--secondary); border-radius: 4px;
    padding: 12px 16px; font-size: 15px; margin: 20px 0;
}

.br-store-main h2 {
    font-size: 1.3rem; margin: 24px 0 8px;
}

/* ---- Forms ---- */

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; color: var(--dark); }
.field input, .field select, .field textarea {
    width: 100%; padding: 12px; font: inherit; font-size: 16px;
    border: 1px solid var(--border); border-radius: 4px; background: #fff; color: var(--text);
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(38,146,69,.15);
}
.field .hint { font-size: 13px; color: #8a8a8a; margin-top: 4px; }
.field.error input, .field.error select { border-color: var(--danger); }
.field .error-msg { color: var(--danger); font-size: 14px; margin-top: 4px; }

/* Honeypot — visually removed, still fillable by bots */
.hp-field { position: absolute; left: -9999px; top: -9999px; height: 1px; overflow: hidden; }

.wizard-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 28px; gap: 12px; flex-wrap: wrap; }

/* ---- Inline delivery calendar ---- */

.br-calendar {
    max-width: 480px; background: #fff; border: 1px solid var(--border);
    border-radius: 8px; padding: 18px 18px 12px; box-shadow: 0 2px 10px rgba(0,0,0,.06);
    margin: 6px auto 14px;
}
.br-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.br-cal-title { font-family: 'Cabin', sans-serif; font-weight: 700; font-size: 1.15rem; color: var(--dark); }
.br-cal-nav {
    width: 38px; height: 38px; border: 1px solid var(--border); border-radius: 50%;
    background: #fff; color: var(--dark); font-size: 22px; line-height: 1; cursor: pointer;
    transition: all .2s ease;
}
.br-cal-nav:hover:not(:disabled) { background: var(--primary); border-color: var(--primary); color: #fff; }
.br-cal-nav:disabled { opacity: .3; cursor: default; }

.br-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.br-cal-dow {
    text-align: center; font-size: 12px; font-weight: 700; color: #9a9a9a;
    text-transform: uppercase; letter-spacing: .5px; padding: 6px 0;
}
.br-cal-day {
    aspect-ratio: 1; border: 1px solid transparent; border-radius: 6px;
    background: none; font: inherit; font-size: 15px; color: var(--dark);
    cursor: pointer; transition: all .15s ease; position: relative;
}
.br-cal-day.available:hover, .br-cal-day.available:focus {
    background: #eaf7ee; border-color: var(--primary); color: var(--primary);
    font-weight: 700; transform: scale(1.08); outline: none;
}
.br-cal-day.selected,
.br-cal-day.selected:hover {
    background: var(--primary); border-color: var(--primary); color: #fff;
    font-weight: 700; transform: none;
    box-shadow: 0 2px 8px rgba(38, 146, 69, .35);
}
.br-cal-day.today { border-color: var(--secondary); font-weight: 700; }
.br-cal-day.today::after {
    content: ''; position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
    width: 4px; height: 4px; border-radius: 50%; background: var(--secondary);
}
.br-cal-day.selected.today::after { background: #fff; }
.br-cal-day:disabled {
    color: #c9c9c9; cursor: default; background: none;
}
.br-cal-day.weekend { background: #f5f5f5; color: #c0c0c0; cursor: not-allowed; }

/* Weekend hover tooltip ("call us") */
.br-cal-day.weekend:hover::after {
    /* Explicit width/height: the "today" dot shares this ::after and sets
     * a 4px box — a Saturday that is today would otherwise squash the tip. */
    content: attr(data-tip);
    position: absolute; bottom: 115%; top: auto; left: 50%; transform: translateX(-50%);
    width: 210px; height: auto; box-sizing: border-box;
    background: var(--dark); color: #fff; font-size: 12px; line-height: 1.4;
    font-weight: 400; padding: 8px 12px; border-radius: 4px; white-space: normal;
    text-align: center; z-index: 30; pointer-events: none;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .25);
}
.br-cal-day.weekend:hover::before {
    content: ''; position: absolute; bottom: calc(115% - 5px); left: 50%;
    transform: translateX(-50%); border: 5px solid transparent;
    border-top-color: var(--dark); z-index: 30; pointer-events: none;
}
.br-cal-day.weekend[data-tip=""]:hover::after,
.br-cal-day.weekend[data-tip=""]:hover::before { display: none; }
/* Keep the tooltip inside the viewport on the outer columns */
.br-cal-grid > .br-cal-day.weekend:nth-child(7n + 1):hover::after { left: 0; transform: none; }
.br-cal-grid > .br-cal-day.weekend:nth-child(7n):hover::after { left: auto; right: 0; transform: none; }

.br-cal-legend { display: flex; gap: 18px; font-size: 13px; color: #7a7a7a; margin-bottom: 8px; flex-wrap: wrap; justify-content: center; }
.br-cal-legend .lg-swatch {
    display: inline-block; width: 12px; height: 12px; border-radius: 3px;
    margin-right: 5px; vertical-align: -1px;
}
.br-cal-legend .lg-today { border: 2px solid var(--secondary); background: #fff; }
.br-cal-legend .lg-available { background: #eaf7ee; border: 1px solid var(--primary); }
.br-cal-legend .lg-weekend { background: #f5f5f5; border: 1px solid #ddd; }

@media (max-width: 640px) {
    .br-calendar { padding: 12px 10px 8px; }
    .br-cal-day { font-size: 14px; }
}

/* ---- Quantity stepper ---- */

.qty-row { display: flex; align-items: center; gap: 10px; margin: 14px 0; }
.qty-row input[type=number] { width: 110px; text-align: center; padding: 12px; font-size: 18px; border: 1px solid var(--border); border-radius: 4px; }
.qty-row .qty-btn {
    width: 46px; height: 46px; font-size: 22px; line-height: 1; border: 1px solid var(--border);
    background: var(--light); border-radius: 4px; cursor: pointer; color: var(--dark);
}

/* ---- Review table ---- */

.review-table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 16px; }
.review-table th, .review-table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.review-table td.num, .review-table th.num { text-align: right; white-space: nowrap; }
.review-table tfoot td { border-bottom: none; }
.review-table tfoot tr.total td { font-weight: 700; font-size: 1.15rem; color: var(--dark); border-top: 2px solid var(--dark); }
.review-table .item-sub { font-size: 14px; color: #7a7a7a; }

.review-block { border: 1px solid var(--border); border-radius: 6px; padding: 16px 20px; margin-bottom: 16px; }
.review-block h3 {
    font-family: 'Cabin', sans-serif; font-size: 1rem; font-weight: 700;
    margin: 0 0 8px; text-transform: none;
}
.review-block .edit-link { float: right; font-size: 14px; }
.item-sub { font-size: 14px; color: #7a7a7a; }

.consent-box { background: var(--light); border: 1px solid var(--border); border-radius: 4px; padding: 14px 16px; font-size: 15px; margin: 18px 0; }
.consent-box label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; margin: 0; }
.consent-box input[type=checkbox] { margin-top: 4px; width: 18px; height: 18px; }

/* ---- Map ---- */

.map-wrap { margin: 18px 0; }
.map-wrap iframe, .map-wrap img { width: 100%; max-width: 100%; border: 1px solid var(--border); border-radius: 6px; min-height: 300px; }

/* ---- Responsive ---- */

@media (max-width: 640px) {
    .br-store-main .button { width: 100%; }
    .wizard-nav { flex-direction: column-reverse; align-items: stretch; }
}
