/* Shared components: buttons, pages, forms, tables, cards/grids, messages.
 * Mobile-first like site.css; interactive targets are >=44px on touch. */

/* Buttons */

.cta,
.button-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 6px;
    padding: 0.7rem 1.75rem;
    cursor: pointer;
}

.cta {
    background: var(--accent);
    color: #fff;
    border: none;
    font-size: 1rem;
}

.cta:hover {
    filter: brightness(1.1);
}

.button-secondary {
    background: none;
    border: 2px solid var(--granite-dark);
    color: var(--granite-dark);
}

/* Pages */

.page {
    padding: 2rem 0 3rem;
}

.page.narrow,
.narrow {
    max-width: 560px;
}

.page-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1rem 0 2rem;
}

.page h2 {
    margin: 2rem 0 1rem;
}

.step-indicator {
    color: var(--granite-mid);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
}

.aux-links {
    margin-top: 1.25rem;
}

.fine-print {
    color: var(--granite-mid);
    font-size: 0.9rem;
}

/* Forms */

.form-field {
    margin-bottom: 1.1rem;
}

.form-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.form-field input:not([type="checkbox"]),
.form-field select,
.form-field textarea {
    width: 100%;
    min-height: 44px;
    padding: 0.55rem 0.7rem;
    border: 1px solid #c9c7c2;
    border-radius: 6px;
    font: inherit;
    background: #fff;
}

.form-field ul {
    list-style: none;
}

.form-field ul li {
    margin-bottom: 0.35rem;
}

.field-error,
.form-errors li {
    color: var(--accent);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.form-errors {
    list-style: none;
    margin-bottom: 1rem;
}

/* Tables */

.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1rem 0;
}

.data-table,
.line-items {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    margin: 1rem 0;
}

.table-scroll .data-table {
    margin: 0;
}

.data-table th,
.data-table td,
.line-items th,
.line-items td {
    text-align: left;
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid #eceae6;
    white-space: nowrap;
}

.line-items th,
.line-items td {
    white-space: normal;
}

.line-items .price {
    text-align: right;
}

.line-items .total-row th {
    border-bottom: none;
    font-size: 1.05rem;
}

/* Cards / grids */

.service-grid {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 1.25rem;
}

.service-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.service-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
}

/* Media cards (homepage services): image top, text below, whole card a link.
 * .service-card elsewhere (garage) keeps its padded text-only layout. */

.media-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
    height: 100%;
}

.media-card-link:hover h3 {
    color: var(--accent);
}

.services {
    padding: 3.5rem 0;
}

.services h2 {
    text-align: center;
    margin-bottom: 2rem;
}

/* Slot picker (booking schedule step) */

.slot-grid ul {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 0.6rem;
}

.slot-grid li label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border: 2px solid var(--granite-dark);
    border-radius: 6px;
    min-height: 44px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 0;
}

.slot-grid li label:has(input:checked) {
    background: var(--granite-dark);
    color: #fff;
}

/* Messages */

/* Honeypot: the whole field (label included) moves off-screen for people
 * while staying in the DOM for form-spam bots to fill. */
.form-field:has(.hp-field) {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Vehicle make/model typeahead (make-model-picker.js wraps the inputs) */

.vehicle-picker {
    position: relative;
}

.vehicle-picker-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 20;
    margin: 0;
    padding: 0;
    list-style: none;
    background: var(--card-bg);
    border: 1px solid var(--granite-dark);
    border-radius: 0 0 6px 6px;
    max-height: 16rem;
    overflow-y: auto;
    box-shadow: 0 6px 16px rgba(0, 16, 64, 0.25);
}

.vehicle-picker-results li {
    padding: 0.65rem 0.9rem;
    min-height: 44px;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.vehicle-picker-results li:hover {
    background: #f1efec;
}

.vehicle-picker-results li.search-error {
    color: #a11;
    cursor: default;
}

.message {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin: 1rem 0;
    background: #fff4e5;
    border: 1px solid #e0a800;
}

.message.error {
    background: #fdecea;
    border-color: var(--accent);
}

/* Larger screens */

@media (min-width: 640px) {
    .page-actions {
        flex-direction: row;
        gap: 1rem;
    }
}

@media (min-width: 1024px) {
    .page {
        padding: 2.5rem 0 3.5rem;
    }
}
