/* ============================================
   GetGear Range Booking
   ============================================ */

:root {
    --gg-orange: #F47920;
    --gg-orange-dark: #D65D0E;
    --gg-orange-light: #FFF3E8;
    --gg-black: #1A1A1A;
    --gg-white: #FFFFFF;
    --gg-bg: #F5F5F5;
    --gg-gray: #666666;
    --gg-gray-light: #999999;
    --gg-border: #E0E0E0;
    --gg-border-light: #F0F0F0;
    --gg-green: #2E7D32;
    --gg-green-light: #E8F5E9;
    --gg-red: #C62828;
    --gg-red-light: #FFEBEE;
    --gg-amber: #E65100;
    --gg-amber-light: #FFF3E0;
    --gg-radius: 12px;
    --gg-radius-sm: 8px;
    --gg-shadow: 0 2px 12px rgba(0,0,0,0.05);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

#gg-booking-app {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--gg-black);
    background: var(--gg-bg);
    min-height: 100vh;
    padding: 20px 0 60px;
    -webkit-font-smoothing: antialiased;
}

/* ========== CARD ========== */
.gg-card {
    background: var(--gg-white);
    border-radius: var(--gg-radius);
    padding: 24px 20px;
    margin: 0 auto 16px;
    box-shadow: var(--gg-shadow);
    border: 1px solid var(--gg-border-light);
    max-width: 500px;
}

.gg-card-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}

.gg-card-subtitle {
    font-size: 14px;
    color: var(--gg-gray);
    margin-bottom: 20px;
}

/* ========== BUTTON ========== */
.gg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    border-radius: var(--gg-radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-family: inherit;
    margin-top: 12px;
}

.gg-btn-primary {
    background: var(--gg-orange);
    color: white;
}

.gg-btn-primary:hover { background: var(--gg-orange-dark); }

.gg-btn-primary:disabled {
    background: #CCC;
    cursor: not-allowed;
}

.gg-btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--gg-gray);
    font-size: 14px;
    cursor: pointer;
    padding: 4px 0;
    margin-bottom: 12px;
    font-family: inherit;
}

.gg-btn-back:hover { color: var(--gg-black); }

/* ============================================
   CALENDAR - THIS IS THE FIX
   ============================================ */
.gg-calendar {
    margin-bottom: 16px;
}

.gg-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0 16px;
}

.gg-cal-title {
    font-size: 16px;
    font-weight: 700;
}

.gg-cal-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--gg-border);
    background: white;
    cursor: pointer;
    color: var(--gg-black);
}

.gg-cal-nav:hover { background: var(--gg-orange-light); border-color: var(--gg-orange); }

/* Day names row - Mon Tue Wed etc */
.gg-cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--gg-gray-light);
    text-transform: uppercase;
    margin-bottom: 4px;
    padding: 0 2px;
}

.gg-cal-days span {
    display: block;
    padding: 6px 0;
}

/* THE CALENDAR GRID - this makes it a proper grid */
.gg-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}

/* Each day cell */
.gg-cal-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    color: var(--gg-black);
    background: white;
    border: 1px solid var(--gg-border-light);
}

.gg-cal-cell.empty {
    border: none;
    cursor: default;
}

.gg-cal-cell.past {
    color: #CCC;
    cursor: not-allowed;
    border-color: transparent;
}

.gg-cal-cell.disabled {
    color: #CCC;
    cursor: not-allowed;
    border-color: transparent;
}

.gg-cal-cell.closed {
    color: #CCC;
    cursor: not-allowed;
    background: #FAFAFA;
    border-color: transparent;
}

.gg-cal-cell.open {
    border-color: var(--gg-border-light);
}

.gg-cal-cell.open:hover {
    border-color: var(--gg-orange);
    background: var(--gg-orange-light);
}

/* Status colors from AJAX */
.gg-cal-cell.status-available {
    border-color: #C8E6C9;
    background: #F1F8E9;
}

.gg-cal-cell.status-partial {
    border-color: #FFE0B2;
    background: #FFF8E1;
}

.gg-cal-cell.status-full {
    border-color: #FFCDD2;
    background: #FFEBEE;
    color: var(--gg-red);
    cursor: not-allowed;
}

/* Today highlight */
.gg-cal-cell.today {
    box-shadow: 0 0 0 2px var(--gg-orange);
}

/* Selected date */
.gg-cal-cell.selected {
    background: var(--gg-orange) !important;
    color: white !important;
    border-color: var(--gg-orange) !important;
    font-weight: 700;
}

/* Legend at bottom */
.gg-cal-legend {
    display: flex;
    gap: 16px;
    padding-top: 12px;
    font-size: 12px;
    color: var(--gg-gray);
    flex-wrap: wrap;
}

.gg-cal-legend span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.gg-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

.gg-dot.open { background: white; border: 1px solid var(--gg-border); }
.gg-dot.partial { background: #FFB74D; }
.gg-dot.full { background: #EF5350; }

/* ========== TIME SLOTS ========== */
.gg-times-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gg-time-slot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-radius: var(--gg-radius-sm);
    border: 2px solid var(--gg-border);
    cursor: pointer;
    background: white;
    gap: 12px;
}

.gg-time-slot:hover:not(.full) {
    border-color: var(--gg-orange);
    background: var(--gg-orange-light);
}

.gg-time-slot.full {
    opacity: 0.5;
    cursor: not-allowed;
}

.gg-time-label {
    font-size: 18px;
    font-weight: 700;
    min-width: 50px;
}

.gg-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
}

.gg-badge.available { background: var(--gg-green-light); color: var(--gg-green); }
.gg-badge.partial { background: var(--gg-amber-light); color: var(--gg-amber); }
.gg-badge.full { background: var(--gg-red-light); color: var(--gg-red); }

.gg-time-bays {
    font-size: 12px;
    color: var(--gg-gray-light);
}

/* ========== SHOOTER CARDS ========== */
.gg-shooter-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gg-shooter-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 16px;
    border-radius: var(--gg-radius-sm);
    border: 2px solid var(--gg-border);
    cursor: pointer;
    background: white;
}

.gg-shooter-card:hover {
    border-color: var(--gg-orange);
    background: var(--gg-orange-light);
}

.gg-shooter-avatars { color: var(--gg-gray); flex-shrink: 0; }
.gg-shooter-info { flex: 1; }

.gg-shooter-label {
    display: block;
    font-weight: 600;
    font-size: 16px;
}

.gg-shooter-desc {
    display: block;
    font-size: 13px;
    color: var(--gg-gray-light);
    margin-top: 2px;
}

.gg-shooter-price {
    font-weight: 700;
    font-size: 16px;
    color: var(--gg-orange);
    white-space: nowrap;
}

/* ========== MULTIPLE SHOOTER PICKER ========== */
.gg-multiple-picker { text-align: center; }

.gg-picker-label {
    font-size: 14px;
    color: var(--gg-gray);
    margin-bottom: 12px;
}

.gg-number-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.gg-number-option {
    padding: 16px 8px;
    border-radius: var(--gg-radius-sm);
    border: 2px solid var(--gg-border);
    cursor: pointer;
    background: white;
}

.gg-number-option:hover { border-color: var(--gg-orange); }
.gg-number-option.selected { border-color: var(--gg-orange); background: var(--gg-orange-light); }

.gg-number-value {
    display: block;
    font-size: 22px;
    font-weight: 700;
}

.gg-number-price {
    display: block;
    font-size: 13px;
    color: var(--gg-orange);
    font-weight: 600;
}

.gg-group-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background: #FFF8E1;
    border-radius: var(--gg-radius-sm);
    font-size: 13px;
    color: var(--gg-amber);
    margin-bottom: 12px;
}

.gg-bays-display {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 16px;
}

.gg-bay-badge {
    padding: 8px 16px;
    border-radius: var(--gg-radius-sm);
    font-size: 13px;
    font-weight: 600;
}

.gg-bay-badge.booked { background: var(--gg-red-light); color: var(--gg-red); }

/* ========== BAY SELECTION ========== */
.gg-info-text {
    font-size: 14px;
    color: var(--gg-gray);
    margin-bottom: 12px;
}

.gg-bay-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.gg-bay-option {
    padding: 16px 8px;
    border-radius: var(--gg-radius-sm);
    border: 2px solid var(--gg-border);
    text-align: center;
    cursor: pointer;
    background: white;
}

.gg-bay-option:hover:not(.unavailable) {
    border-color: var(--gg-orange);
    background: var(--gg-orange-light);
}

.gg-bay-option.selected {
    border-color: var(--gg-orange);
    background: var(--gg-orange-light);
    font-weight: 600;
}

.gg-bay-option.unavailable {
    opacity: 0.4;
    cursor: not-allowed;
    background: #FAFAFA;
}

.gg-bay-num { display: block; font-size: 20px; font-weight: 700; }
.gg-bay-label { display: block; font-size: 13px; color: var(--gg-gray); margin: 2px 0; }
.gg-bay-status { font-size: 11px; font-weight: 600; }

.gg-bay-option:not(.unavailable) .gg-bay-status { color: var(--gg-green); }
.gg-bay-option.unavailable .gg-bay-status { color: var(--gg-red); }

/* ========== SHARE OPTIONS ========== */
.gg-share-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}

.gg-share-card {
    padding: 20px 16px;
    border-radius: var(--gg-radius-sm);
    border: 2px solid var(--gg-border);
    cursor: pointer;
    text-align: center;
    background: white;
}

.gg-share-card:hover { border-color: var(--gg-orange); background: var(--gg-orange-light); }
.gg-share-card svg { display: block; margin: 0 auto 8px; color: var(--gg-gray); }
.gg-share-card strong { display: block; font-size: 14px; margin-bottom: 2px; }
.gg-share-card span { display: block; font-size: 12px; color: var(--gg-gray-light); }

.gg-price-tag {
    color: var(--gg-orange) !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    margin-top: 6px !important;
}

/* ========== FIREARM ========== */
.gg-firearm-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.gg-firearm-card {
    padding: 24px 16px;
    border-radius: var(--gg-radius-sm);
    border: 2px solid var(--gg-border);
    cursor: pointer;
    text-align: center;
    background: white;
}

.gg-firearm-card:hover { border-color: var(--gg-orange); background: var(--gg-orange-light); }
.gg-firearm-card svg { display: block; margin: 0 auto 10px; color: var(--gg-gray); }
.gg-firearm-card strong { display: block; font-size: 15px; margin-bottom: 2px; }
.gg-firearm-card span { display: block; font-size: 12px; color: var(--gg-gray-light); }

/* ========== RENTALS ========== */
.gg-rentals-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gg-rental-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-radius: var(--gg-radius-sm);
    border: 2px solid var(--gg-border);
    cursor: pointer;
    background: white;
    gap: 8px;
}

.gg-rental-card:hover { border-color: var(--gg-orange); background: var(--gg-orange-light); }
.gg-rental-card.selected { border-color: var(--gg-orange); background: var(--gg-orange-light); }
.gg-rental-card strong { flex: 1; font-size: 14px; }
.gg-rental-price { font-weight: 700; color: var(--gg-orange); font-size: 16px; }
.gg-rental-card small { color: var(--gg-gray-light); font-size: 11px; }

/* ========== PRICE PREVIEW ========== */
.gg-price-preview {
    background: #FAFAFA;
    border-radius: var(--gg-radius-sm);
    padding: 14px;
    margin-top: 12px;
}

.gg-price-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 14px;
    color: var(--gg-gray);
}

.gg-price-total {
    border-top: 2px solid var(--gg-border);
    margin-top: 8px;
    padding-top: 10px;
    font-size: 18px;
    color: var(--gg-orange);
}

.gg-price-summary {
    padding: 14px;
    background: #FAFAFA;
    border-radius: var(--gg-radius-sm);
    margin: 12px 0;
    text-align: center;
}

.gg-price-summary span { display: block; font-size: 14px; color: var(--gg-gray); }
.gg-price-summary strong { font-size: 20px; color: var(--gg-orange); }

/* ========== SUMMARY BOX ========== */
.gg-summary-box {
    background: #FAFAFA;
    border-radius: var(--gg-radius-sm);
    padding: 16px;
    margin-bottom: 20px;
}

.gg-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 14px;
}

.gg-summary-row span { color: var(--gg-gray); }

.gg-summary-total {
    display: flex;
    justify-content: space-between;
    border-top: 2px solid var(--gg-border);
    margin-top: 8px;
    padding-top: 10px;
    font-size: 18px;
    color: var(--gg-orange);
    font-weight: 700;
}

/* ========== FORM FIELDS ========== */
.gg-field {
    margin-bottom: 14px;
}

.gg-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 14px;
}

.gg-field label span { font-weight: 400; color: var(--gg-gray-light); }

.gg-field input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--gg-border);
    border-radius: var(--gg-radius-sm);
    font-size: 15px;
    font-family: inherit;
}

.gg-field input:focus { outline: none; border-color: var(--gg-orange); }
.gg-field input::placeholder { color: #BBB; }

/* ========== CONFIRMATION ========== */
.gg-confirmation { text-align: center; }

.gg-confirm-icon { margin-bottom: 12px; }

.gg-confirm-ref {
    font-size: 14px;
    color: var(--gg-gray);
    margin-bottom: 16px;
}

.gg-confirm-ref strong { color: var(--gg-orange); font-size: 16px; }

.gg-confirm-note { margin: 16px 0; font-size: 14px; color: var(--gg-gray); }

/* ========== LOADING ========== */
.gg-loading {
    text-align: center;
    padding: 32px;
    color: var(--gg-gray-light);
    font-size: 14px;
}

.gg-loading::before {
    content: '';
    display: block;
    width: 28px;
    height: 28px;
    border: 3px solid var(--gg-border);
    border-top-color: var(--gg-orange);
    border-radius: 50%;
    animation: ggSpin 0.7s linear infinite;
    margin: 0 auto 10px;
}

@keyframes ggSpin { to { transform: rotate(360deg); } }

.gg-error {
    text-align: center;
    padding: 14px;
    background: var(--gg-red-light);
    color: var(--gg-red);
    border-radius: var(--gg-radius-sm);
    font-size: 14px;
}

/* ========== PROGRESS BAR ========== */
.gg-progress {
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 0 0 16px;
    flex-wrap: wrap;
    max-width: 500px;
    margin: 0 auto;
}

.gg-step {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 20px;
    background: var(--gg-white);
    border: 1px solid var(--gg-border-light);
    font-size: 12px;
    color: var(--gg-gray-light);
}

.gg-step-done {
    background: var(--gg-green-light);
    border-color: var(--gg-green);
    color: var(--gg-green);
}

.gg-step-active {
    background: var(--gg-orange-light);
    border-color: var(--gg-orange);
    color: var(--gg-orange);
    font-weight: 600;
}

.gg-step-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--gg-border-light);
    font-size: 11px;
    font-weight: 700;
}

.gg-step-done .gg-step-dot { background: var(--gg-green); color: white; }
.gg-step-active .gg-step-dot { background: var(--gg-orange); color: white; }

/* ========== RESPONSIVE ========== */
@media (max-width: 420px) {
    .gg-card { padding: 20px 14px; }
    .gg-card-title { font-size: 20px; }
    .gg-share-options { grid-template-columns: 1fr; }
    .gg-firearm-options { grid-template-columns: 1fr; }
    .gg-number-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; }
    .gg-number-option { padding: 14px 6px; }
    .gg-number-value { font-size: 18px; }
    .gg-bay-grid { gap: 6px; }
    .gg-bay-option { padding: 14px 6px; }
    .gg-cal-cell { min-height: 34px; font-size: 13px; }
}

/* ========== CALENDAR STATUS COLOURS ========== */
.gg-cal-cell.open               { background: #fff; border-color: #e0e0e0; color: #1a1a1a; }
.gg-cal-cell.past               { background: #f2f2f2; color: #bbb; cursor: not-allowed; border-color: transparent; }
.gg-cal-cell.closed             { background: #fafafa; color: #bbb; cursor: not-allowed; border-color: transparent; }
.gg-cal-cell.disabled           { background: #fafafa; color: #bbb; cursor: not-allowed; border-color: transparent; }
.gg-cal-cell.today              { box-shadow: 0 0 0 2px #f47920; }

.gg-cal-cell.status-available   { background: #e8f5e9; border-color: #4caf50; }
.gg-cal-cell.status-partial     { background: #fff3e0; border-color: #ff9800; }
.gg-cal-cell.status-full        { background: #ffebee; border-color: #f44336; color: #c62828; cursor: not-allowed; }

.gg-cal-cell.selected           { background: #f47920 !important; color: #fff !important; border-color: #f47920 !important; }