/* Explain: Styles for various site components, including the Christmas banner and map pins. */
/* Price grid spreadsheet (pricing.html) */
.pg-table {
    border-collapse: collapse;
}

.pg-table th,
.pg-table td {
    border: 1px solid var(--border-color);
}

.pg-table tbody th {
    background: var(--background-color);
}

.pg-table input {
    font-variant-numeric: tabular-nums;
}

.pg-table .pg-price-invalid {
    border-color: #dc2626;
    background-color: #fef2f2;
    color: #b91c1c;
}

/* Editable price box in the grid: every width and drop can be typed over */
.pg-price-input {
    width: 100%;
    min-width: 4.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background: var(--surface-color);
    padding: 0.35rem 0.4rem;
    text-align: center;
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
    color: var(--text-color);
    appearance: textfield;
    -moz-appearance: textfield;
    cursor: text;
}

.pg-price-input::-webkit-outer-spin-button,
.pg-price-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.pg-price-input:hover {
    border-color: var(--primary-color);
}

.pg-price-input:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 1px;
    background: #fff;
}

.pg-price-input.is-override {
    background: #fffbeb;
    border-color: var(--secondary-color);
    font-weight: 700;
}

.pg-price-input.is-invalid {
    border-color: #dc2626;
    background-color: #fef2f2;
    color: #b91c1c;
}

/* Christmas offer banner at the top of the home page */
.xmas-banner {
    position: relative;
    overflow: hidden;
    background: linear-gradient(120deg, var(--xmas-green) 0%, var(--xmas-green-light) 55%, var(--xmas-green) 100%);
}

.xmas-banner::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle at 8% 18%, rgba(255, 255, 255, 0.7) 0 1.5px, transparent 2px),
        radial-gradient(circle at 27% 72%, rgba(255, 255, 255, 0.5) 0 1px, transparent 2px),
        radial-gradient(circle at 46% 26%, rgba(255, 255, 255, 0.6) 0 1.5px, transparent 2px),
        radial-gradient(circle at 63% 82%, rgba(255, 255, 255, 0.45) 0 1px, transparent 2px),
        radial-gradient(circle at 81% 34%, rgba(255, 255, 255, 0.7) 0 1.5px, transparent 2px),
        radial-gradient(circle at 94% 76%, rgba(255, 255, 255, 0.5) 0 1px, transparent 2px);
    animation: xmas-twinkle 7s ease-in-out infinite alternate;
}

@keyframes xmas-twinkle {
    from { opacity: 0.35; }
    to { opacity: 0.85; }
}

.xmas-code {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 2px dashed var(--xmas-gold);
    border-radius: 0.6rem;
    background: rgba(255, 255, 255, 0.12);
    padding: 0.15rem 0.55rem;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--xmas-cream);
    white-space: nowrap;
}

@media (min-width: 640px) {
    .xmas-code {
        padding: 0.35rem 0.85rem;
        font-size: 1rem;
        letter-spacing: 0.18em;
    }
}

.xmas-copy-btn.is-copied {
    background: var(--xmas-gold);
    border-color: var(--xmas-gold);
    color: var(--xmas-green);
}

@media (prefers-reduced-motion: reduce) {
    .xmas-banner::after {
        animation: none;
        opacity: 0.7;
    }
}

/* Service area map (service-area.html) */
.sa-map {
    position: relative;
    z-index: 0;
    background: var(--background-color);
}

.sa-map .leaflet-container,
.sa-map .leaflet-popup-content {
    font-family: var(--font-body);
    font-size: 0.875rem;
}

/* A round pin for the workshop and for each van at the edge of the fitting radius */
.sa-pin {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    border-radius: 9999px;
    background: var(--primary-color);
    color: #ffffff;
    font-size: 0.95rem;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.3);
}

.sa-pin--workshop {
    background: var(--accent-color);
    font-size: 1.05rem;
}

.sa-pin--van {
    background: var(--secondary-color);
    color: #0f172a;
}

/* The map frame itself: no page scroll leaking through while panning, and zoom buttons big
   enough to tap on a phone */
.sa-map {
    overscroll-behavior: contain;
}

.sa-map .leaflet-container {
    background: var(--background-color);
    font-family: var(--font-body);
    font-size: 0.875rem;
    outline: none;
    overscroll-behavior: contain;
}

.sa-map .leaflet-control-zoom {
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 0.6rem;
    box-shadow: 0 8px 20px -10px rgba(15, 23, 42, 0.5);
}

.sa-map .leaflet-bar a {
    width: 2.75rem;
    height: 2.75rem;
    line-height: 2.6rem;
    border-bottom-color: var(--border-color);
    background: var(--surface-color);
    color: var(--text-color);
    font-size: 1.4rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.sa-map .leaflet-bar a:hover,
.sa-map .leaflet-bar a:focus-visible {
    background: var(--background-color);
    color: var(--primary-color);
}

.sa-map .leaflet-bar a.leaflet-disabled {
    background: var(--background-color);
    color: var(--text-muted);
    opacity: 0.45;
    cursor: default;
}

.sa-map .leaflet-popup-content-wrapper {
    border-radius: 0.75rem;
}

.sa-map .leaflet-popup-content {
    margin: 0.85rem 1rem;
    line-height: 1.5;
}

/* A finger that lands on the map would move the map rather than the page, which is how a phone gets
   stuck on it. The cover over the map takes the first tap instead, so the page scrolls normally, and
   the Done button brings the cover back. Both are shown from one state class, so their display is
   never fought over by a utility class. */
.sa-map-tap {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    border: 0;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.08);
    cursor: pointer;
    touch-action: pan-y;
    -webkit-tap-highlight-color: transparent;
}

.sa-map-tap.is-visible {
    display: flex;
}

.sa-map-tap-inner {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 9999px;
    background: var(--surface-color);
    padding: 0.55rem 1rem;
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--primary-color);
    box-shadow: 0 10px 24px -12px rgba(15, 23, 42, 0.6);
}

.sa-map-tap-note {
    border-radius: 9999px;
    background: rgba(15, 23, 42, 0.55);
    padding: 0.2rem 0.7rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #ffffff;
}

.sa-map-release {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 6;
    display: none;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    background: var(--surface-color);
    padding: 0.5rem 0.9rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-color);
    box-shadow: 0 10px 24px -14px rgba(15, 23, 42, 0.7);
    cursor: pointer;
}

.sa-map-release.is-visible {
    display: inline-flex;
}

.sa-map-tap:focus-visible,
.sa-map-release:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}