/* ============================================
   Higanas Boats Booking Plugin – Frontend CSS
   ============================================ */

:root {
    --hb-primary: #1a365d;
    --hb-primary-hover: #15294a;
    --hb-green: #22c55e;
    --hb-green-h: #16a34a;
    --hb-gray: #6b7280;
    --hb-light: #f8fafc;
    --hb-border: #e2e8f0;
    --hb-radius: 8px;
    --hb-shadow: 0 2px 16px rgba(0,0,0,.10);
}

/* ── Reset & Base ─────────────────────────── */
.higanas-booking-wrap *,
.hb-modal * {
    box-sizing: border-box;
    line-height: 1.4 !important;
    margin: 0;
    padding: 0;
}

.higanas-booking-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    color: #1a202c;
    max-width: 1200px;
    margin: 0 auto;
}

.hb-section { margin-bottom: 28px; }

/* ── Page title ───────────────────────────── */
.hb-page-title {
    font-size: 26px !important;
    font-weight: 700;
    font-style: italic;
    color: #1a202c;
    margin-bottom: 6px !important;
}
.hb-page-desc { color: #555; margin-bottom: 16px !important; }

/* ── Search Box ───────────────────────────── */
.hb-search-box {
    background: #f1f5f9;
    border-radius: var(--hb-radius);
    padding: 20px 24px;
}

.hb-date-fields {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 12px;
    align-items: stretch;
}

.hb-date-field {
    position: relative;
    display: flex;
}

.hb-date-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 1px solid var(--hb-border);
    border-radius: var(--hb-radius);
    background: #fff;
    cursor: pointer;
    text-align: center;
    color: #1a202c;
    height: 100%;
}

.hb-date-input::placeholder { color: #94a3b8; }
.hb-date-input:focus { outline: 2px solid var(--hb-primary); }

/* ── Buttons ──────────────────────────────── */
.hb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--hb-radius);
    border: none;
    cursor: pointer;
    transition: background .2s, opacity .2s;
    text-decoration: none;
    white-space: nowrap;
}

.hb-btn-primary {
    background: var(--hb-primary);
    color: #fff;
    align-self: stretch;
    width: 100%;
}
.hb-btn-primary:hover { background: var(--hb-primary-hover); }

.hb-btn-green {
    background: var(--hb-green);
    color: #fff;
}
.hb-btn-green:hover { background: var(--hb-green-h); }

.hb-btn-gray {
    background: var(--hb-gray);
    color: #fff;
}
.hb-btn-gray:hover { opacity: .85; }

.hb-btn-outline {
    background: transparent;
    color: var(--hb-primary);
    border: 2px solid var(--hb-primary);
}
.hb-btn-outline:hover { background: var(--hb-primary); color: #fff; }

.hb-btn:disabled { opacity: .6; cursor: not-allowed; }

/* ── Search Spinner ───────────────────────── */
.hb-spinner { display: inline-block; animation: hb-spin .8s linear infinite; }
@keyframes hb-spin { to { transform: rotate(360deg); } }

/* ── Results Header ───────────────────────── */
.hb-results-header {
    font-size: 15px;
    color: #555;
    padding: 8px 0 14px;
    border-bottom: 2px solid var(--hb-border);
    margin-bottom: 20px;
}

.hb-results-header strong { color: #1a202c; }

/* ── Alt Dates Notice ─────────────────────── */
.hb-alt-notice {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: var(--hb-radius);
    padding: 14px 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
}

/* ── Boat Cards Grid ──────────────────────── */
.hb-boats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

/* ── Boat Card ────────────────────────────── */
.hb-boat-card {
    background: #fff;
    border-radius: var(--hb-radius);
    box-shadow: var(--hb-shadow);
    overflow: hidden;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
}
.hb-boat-card:hover { transform: translateY(-3px); box-shadow: 0 6px 24px rgba(0,0,0,.14); }

.hb-card-gallery { position: relative; height: 200px; overflow: hidden; }
.hb-card-gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }

.hb-discount-badge {
    position: absolute;
    top: 10px; right: 10px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    z-index: 2;
}

.hb-alt-badge {
    position: absolute;
    top: 10px; left: 10px;
    background: #7c3aed;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    z-index: 2;
}

.hb-card-photo-count {
    position: absolute;
    bottom: 8px; right: 8px;
    background: rgba(0,0,0,.55);
    color: #fff;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 999px;
}

.hb-card-body { padding: 14px 16px; }

.hb-card-title {
    font-size: 17px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 2px !important;
}

.hb-card-model { font-size: 12px; color: #94a3b8; margin-bottom: 8px !important; }

.hb-card-desc {
    font-size: 13px;
    color: #555;
    margin-bottom: 10px !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Boat specs icons */
.hb-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px !important;
}

.hb-spec {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #374151;
    background: var(--hb-light);
    border-radius: 4px;
    padding: 3px 7px;
}

.hb-spec svg { width: 14px; height: 14px; flex-shrink: 0; }

.hb-card-dates { font-size: 12px; color: #64748b; margin-bottom: 10px !important; }

.hb-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid var(--hb-border);
}

.hb-price-block { line-height: 1.2 !important; }
.hb-price-original { font-size: 12px; color: #ef4444; text-decoration: line-through; }
.hb-price-current { font-size: 20px; font-weight: 700; color: var(--hb-primary); }
.hb-price-nights { font-size: 11px; color: #94a3b8; }

/* ── Overlay / Modal ──────────────────────── */
.hb-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 100000;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.hb-modal {
    background: #fff;
    border-radius: 10px;
    width: 100%;
    max-width: 860px;
    position: relative;
    margin: auto;
    overflow: hidden;
}

.hb-modal-close {
    position: absolute;
    top: 10px; right: 12px;
    background: rgba(0,0,0,.4);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 14px;
    z-index: 10;
    line-height: 1 !important;
}

/* Modal Gallery */
.hb-modal-gallery { position: relative; height: 240px; background: #000; overflow: hidden; }
.hb-modal-gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }

.hb-mg-prev, .hb-mg-next {
    position: absolute;
    top: 50%; transform: translateY(-50%);
    background: rgba(0,0,0,.4);
    color: #fff;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 18px;
    border-radius: 4px;
    z-index: 5;
}
.hb-mg-prev { left: 8px; }
.hb-mg-next { right: 8px; }
.hb-mg-counter { position: absolute; bottom: 8px; right: 12px; background: rgba(0,0,0,.5); color: #fff; font-size: 11px; padding: 2px 7px; border-radius: 999px; }

/* Modal body */
.hb-modal-body {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 0;
    max-height: calc(100vh - 240px - 60px);
    overflow-y: auto;
}

.hb-modal-left { padding: 18px 20px; overflow-y: auto; }
.hb-modal-right {
    background: var(--hb-light);
    border-left: 1px solid var(--hb-border);
    padding: 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Section titles inside modal */
.hb-modal-section-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--hb-gray);
    margin-bottom: 8px !important;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--hb-border);
}

/* Technical details grid */
.hb-tech-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 14px !important;
}

.hb-tech-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #374151;
    padding: 5px 8px;
    background: #fff;
    border-radius: 5px;
    border: 1px solid var(--hb-border);
}

/* Equipment list */
.hb-equipment-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    font-size: 12px;
    margin-bottom: 14px !important;
}

.hb-equip-item { color: #374151; padding: 2px 0; }
.hb-equip-item::before { content: '✓ '; color: var(--hb-green); font-weight: 700; }

/* Mandatory extras */
.hb-mandatory-list { margin-bottom: 14px !important; }

.hb-extra-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--hb-border);
    font-size: 13px;
}

.hb-extra-row:last-child { border-bottom: none; }
.hb-extra-base-tag {
    font-size: 10px;
    background: #fef3c7;
    color: #92400e;
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 4px;
}

/* Optional extras */
.hb-optional-list { margin-bottom: 12px !important; }

.hb-optional-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 0;
    border-bottom: 1px solid var(--hb-border);
    font-size: 13px;
    cursor: pointer;
}

.hb-optional-item:last-child { border-bottom: none; }
.hb-optional-item input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--hb-primary); }
.hb-optional-item .hb-opt-name { flex: 1; }
.hb-optional-item .hb-opt-price { font-weight: 600; color: var(--hb-primary); white-space: nowrap; }

/* Security deposit */
.hb-deposit-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 13px;
    color: #1e40af;
    margin-bottom: 14px !important;
}

/* Calculation panel */
.hb-calc-panel { background: #fff; border-radius: 6px; border: 1px solid var(--hb-border); overflow: hidden; }

.hb-calc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    font-size: 13px;
    border-bottom: 1px solid var(--hb-border);
}

.hb-calc-row:last-child { border-bottom: none; }
.hb-calc-row.total-online { background: #f0fdf4; font-weight: 700; font-size: 14px; }
.hb-calc-row.grand-total { background: #eff6ff; font-weight: 700; font-size: 14px; }
.hb-calc-row.deposit-row { background: #fefce8; font-weight: 700; color: #d97706; font-size: 15px; }

/* Payment info */
.hb-payment-info {
    background: #eff6ff;
    border-radius: 6px;
    padding: 12px;
    font-size: 13px;
    color: #1e40af;
}

/* Stripe card element */
#hb-card-element {
    border: 1px solid var(--hb-border);
    border-radius: 6px;
    padding: 10px;
    background: #fff;
    margin-top: 8px;
}

#hb-card-errors {
    color: #ef4444;
    font-size: 12px;
    margin-top: 4px;
    min-height: 18px;
}

/* User info form */
.hb-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px !important;
}

.hb-form-group { display: flex; flex-direction: column; gap: 4px; }
.hb-form-group label { font-size: 12px; font-weight: 600; color: #374151; }

.hb-form-input {
    padding: 9px 12px;
    border: 1px solid var(--hb-border);
    border-radius: 6px;
    font-size: 13px;
    width: 100%;
    color: #1a202c;
}

.hb-form-input:focus { outline: 2px solid var(--hb-primary); border-color: transparent; }
.hb-form-input.hb-error { border-color: #ef4444; }

/* Checkbox */
.hb-checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px !important;
    font-size: 12px;
    color: #374151;
}
.hb-checkbox-row input { margin-top: 2px; accent-color: var(--hb-primary); }
.hb-checkbox-row a { color: var(--hb-primary); }

/* Modal footer */
.hb-modal-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 14px 18px;
    border-top: 1px solid var(--hb-border);
    background: #fff;
    position: sticky;
    bottom: 0;
}

/* ── Lightbox ──────────────────────────────── */
.hb-lightbox {
    position: fixed;
    inset: 0;
    z-index: 200000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hb-lightbox-bg {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.88);
    cursor: pointer;
}

.hb-lightbox-inner {
    position: relative;
    z-index: 1;
    max-width: 90vw;
    max-height: 90vh;
}

.hb-lightbox-inner img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    display: block;
    border-radius: 4px;
}

.hb-lb-close, .hb-lb-prev, .hb-lb-next {
    position: absolute;
    background: rgba(255,255,255,.2);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    padding: 8px 12px;
    font-size: 18px;
    transition: background .2s;
}

.hb-lb-close { top: -36px; right: 0; }
.hb-lb-prev { left: -50px; top: 50%; transform: translateY(-50%); }
.hb-lb-next { right: -50px; top: 50%; transform: translateY(-50%); }
.hb-lb-close:hover, .hb-lb-prev:hover, .hb-lb-next:hover { background: rgba(255,255,255,.35); }

.hb-lb-counter { text-align: center; color: #ccc; font-size: 13px; margin-top: 8px !important; }

/* ── Success Modal ─────────────────────────── */
.hb-success-modal {
    background: #fff;
    border-radius: 12px;
    max-width: 480px;
    width: 100%;
    padding: 32px 28px;
    text-align: center;
    margin: auto;
}

.hb-success-icon {
    width: 64px;
    height: 64px;
    background: var(--hb-green);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    font-weight: 700;
    margin: 0 auto 16px !important;
}

.hb-success-modal h2 { font-size: 22px; margin-bottom: 16px !important; color: #1a202c; }

.hb-success-row {
    display: flex;
    justify-content: space-between;
    padding: 7px 0;
    border-bottom: 1px solid var(--hb-border);
    font-size: 14px;
    text-align: left;
}

.hb-success-code {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--hb-primary);
    margin: 12px 0 !important;
}

/* ── Toast ──────────────────────────────────── */
.hb-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1a202c;
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 300000;
    max-width: 360px;
    box-shadow: 0 4px 16px rgba(0,0,0,.25);
}

.hb-toast.hb-toast-error { background: #dc2626; }
.hb-toast.hb-toast-success { background: #16a34a; }

/* ── Loading Skeleton ───────────────────────── */
.hb-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: hb-skeleton 1.5s infinite;
    border-radius: 4px;
}
@keyframes hb-skeleton { 0% { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ── Responsive ─────────────────────────────── */
@media (max-width: 768px) {
    .hb-date-fields { grid-template-columns: 1fr; }
    .hb-boats-grid { grid-template-columns: 1fr; }
    .hb-modal-body { grid-template-columns: 1fr; }
    .hb-modal-right { border-left: none; border-top: 1px solid var(--hb-border); }
    .hb-tech-grid { grid-template-columns: 1fr; }
    .hb-equipment-list { grid-template-columns: 1fr; }
    .hb-form-grid { grid-template-columns: 1fr; }
    .hb-modal-footer { grid-template-columns: 1fr; }
    .hb-lb-prev { left: 4px; }
    .hb-lb-next { right: 4px; }
}
