/**
 * Product Fields Styles
 */

/* Hide shortcode postcode form on product pages */
.single-product .shbs-postcode-wrapper {
    display: none !important;
}

/* Hide datepicker input – kept in DOM for jQuery UI */
.shbs-datepicker {
    opacity: 0;
    pointer-events: none;
    height: 0;
    padding: 0;
    margin: 0;
    border: 0;
    position: absolute;
}

.ui-datepicker-trigger {
    display: none !important;
}

/* Datepicker colour overrides */
.ui-datepicker select.ui-datepicker-month,
.ui-datepicker select.ui-datepicker-year {
    width: 45%;
    color: white;
}

.ui-datepicker .ui-datepicker-title select {
    font-size: 1em;
    margin: 0;
    border: 0;
}

.ui-state-active,
.ui-widget-content .ui-state-active,
.ui-widget-header .ui-state-active,
a.ui-button:active,
.ui-button:active,
.ui-button.ui-state-active:hover {
    border: 1px solid #1907c0 !important;
    background: #1907c0 !important;
    font-weight: normal;
    color: #ffffff;
}

/* ============================================
   POSTCODE INDICATOR BAR (full-width under nav)
   ============================================ */
.shbs-postcode-indicator {
    /* The theme sets form.cart to display:flex, which turns its direct
       children into flex items laid out inline. Force this element back to
       a full-width block whether or not it's inside a flex parent. */
    display: block !important;
    flex: 0 0 100% !important;
    width: 100%;
    background: #ecedf9;
    box-sizing: border-box;
}

.shbs-postcode-indicator-inner {
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: var(--e-container-max-width, 1200px);
    margin: 0 auto;
    padding: 10px 24px;
    color: #1907c0;
    font-size: 14px;
    font-weight: 500;
    box-sizing: border-box;
}

.shbs-postcode-indicator svg {
    color: #1907c0;
    flex-shrink: 0;
}

/* Postcode-dependent price shown alongside the postcode in the banner */
.shbs-postcode-indicator-price {
    font-weight: 700;
}

.shbs-postcode-indicator-price::before {
    content: "·";
    margin: 0 6px 0 0;
    font-weight: 500;
    opacity: 0.6;
}

.shbs-postcode-indicator-price .woocommerce-Price-amount {
    color: inherit;
}

.shbs-change-postcode-link,
.shbs-change-postcode-trigger {
    margin-left: auto;
    font-size: 14px;
    color: #1907c0;
    text-decoration: underline;
    font-weight: 500;
    cursor: pointer;
}

.shbs-change-postcode-link:hover,
.shbs-change-postcode-trigger:hover {
    color: #1907c0;
}

/* ============================================
   FORM.CART OVERRIDES
   The theme sets form.cart to display:flex with nowrap, which squashes our
   widget alongside any other flex children (like the qty selector or
   theme-injected elements). Force it to wrap so our block-level children
   get their own rows.
   ============================================ */
body.single-product form.cart {
    flex-wrap: wrap !important;
    align-items: flex-start !important;
}

/* ============================================
   MAIN FORM CONTAINER
   ============================================ */
.shbs-custom-fields {
    /* Pure layout — no panel styling. Background, border, and padding are
       intentionally absent so the fields sit directly on whatever's behind.
       flex/min-width overrides force this onto its own full-width row inside
       the theme's flex-styled form.cart. */
    display: block !important;
    flex: 0 0 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin-bottom: 0;
    width: 100%;
    box-sizing: border-box;
}

.shbs-field-group {
    margin-bottom: 16px;
}

.shbs-field-group:last-child {
    margin-bottom: 0;
}

.shbs-field-group.error-field {
    background: #fff5f5;
    padding: 12px;
    border-radius: 6px;
    border-left: 3px solid #d63638;
}

.shbs-field-label {
    display: block;
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 8px;
    color: #1a1a1a;
}

/* ============================================
   POSTCODE INPUT (no postcode state)
   ============================================ */
.shbs-postcode-required-notice {
    margin-bottom: 0;
}

.shbs-postcode-input-wrapper {
    display: flex;
    width: 100%;
    gap: 8px;
}

.shbs-postcode-input-wrapper .shbs-postcode-input {
    flex: 1;
    padding: 11px 14px;
    border: 1.5px solid #d4d6ea;
    border-radius: 8px;
    font-size: 15px;
    background: white;
    text-transform: uppercase;
    color: #1a1a1a;
}

.shbs-postcode-input-wrapper .shbs-postcode-input:focus {
    outline: none;
    border-color: #1907c0;
}

.shbs-postcode-input-wrapper .shbs-postcode-input::placeholder {
    text-transform: none;
    color: #999;
}

.shbs-check-postcode-btn {
    padding: 11px 20px;
    background: #1907c0;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.shbs-check-postcode-btn:hover {
    background: #1907c0;
}

.shbs-check-postcode-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.shbs-postcode-message {
    margin-top: 8px;
    font-size: 14px;
}

.shbs-postcode-message .error {
    color: #d63638;
}

/* ============================================
   DELIVERY DATE FIELD
   ============================================ */
.shbs-date-display-wrapper {
    background: #ecedf9;
    border: 1.5px solid #1907c0;
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.shbs-selected-date {
    display: flex;
    align-items: center;
    gap: 10px;
}

.shbs-checkmark-icon {
    color: #1907c0;
    flex-shrink: 0;
}

.shbs-date-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.shbs-date-value {
    font-size: 17px;
    font-weight: 600;
    color: #1907c0;
    line-height: 1.2;
}

.shbs-date-label {
    font-size: 12px;
    color: #1907c0;
    font-weight: 500;
}

.shbs-change-date-btn {
    background: transparent;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: #1907c0;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    flex-shrink: 0;
}

.shbs-change-date-btn:hover {
    color: #1907c0;
}

/* ============================================
   HIRE PERIOD PILL BUTTONS
   ============================================ */
.shbs-pill-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.shbs-pill-buttons input[type="radio"] {
    display: none;
}

.shbs-pill-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 16px;
    background: #ecedf9;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s, color 0.2s;
    flex: 1;
    text-align: center;
}

.shbs-pill-button:hover {
    background: #d4d6ea;
}

.shbs-pill-weeks {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
}

.shbs-pill-cost {
    font-size: 12px;
    color: #6b6b6b;
    line-height: 1.3;
    margin-top: 2px;
}

/* Selected state - primary brand colour background with white text */
.shbs-pill-buttons input[type="radio"]:checked + .shbs-pill-button {
    background: #1907c0;
}

.shbs-pill-buttons input[type="radio"]:checked + .shbs-pill-button .shbs-pill-weeks {
    color: #ffffff;
}

.shbs-pill-buttons input[type="radio"]:checked + .shbs-pill-button .shbs-pill-cost {
    color: #ffffff;
    font-weight: 600;
}

/* ============================================
   TOOLTIP
   ============================================ */
.shbs-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: #1907c0;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    cursor: help;
    flex-shrink: 0;
}

.shbs-tooltip:hover {
    background: #1907c0;
}

.shbs-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: #1907c0;
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: normal;
    white-space: normal;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 1000;
    max-width: 280px;
    width: max-content;
    text-align: left;
    line-height: 1.5;
}

.shbs-tooltip::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1907c0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 1000;
}

.shbs-tooltip:hover::after,
.shbs-tooltip:hover::before {
    opacity: 1;
}

/* ============================================
   TOGGLE SWITCH (On-Road Permit)
   ============================================ */
.shbs-toggle-field {
    margin-bottom: 16px;
}

.shbs-toggle-wrapper {
    border: 1.5px solid #d4d6ea;
    border-radius: 8px;
    padding: 12px 14px;
    background: #ffffff;
}

.shbs-toggle-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.shbs-toggle-label-wrapper {
    flex: 1;
}

.shbs-toggle-field .shbs-field-label {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 3px;
}

.shbs-toggle-description {
    font-size: 13px;
    color: #6b6b6b;
    margin: 0;
    line-height: 1.4;
}

/* Toggle Switch */
.shbs-toggle-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
    flex-shrink: 0;
}

.shbs-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.shbs-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.25s;
    border-radius: 26px;
}

.shbs-toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.25s;
    border-radius: 50%;
}

input:checked + .shbs-toggle-slider {
    background-color: #1907c0;
}

input:checked + .shbs-toggle-slider:before {
    transform: translateX(20px);
}

/* ============================================
   MINIMAL CHECKBOX (Waste Restrictions)
   ============================================ */
.shbs-minimal-checkbox-field {
    margin-bottom: 16px;
}

.shbs-minimal-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.shbs-minimal-checkbox-label input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #1907c0;
}

.shbs-minimal-checkbox-text {
    font-size: 14px;
    color: #6b6b6b;
    line-height: 1.5;
}

.shbs-restrictions-link {
    color: #1193eb;
    text-decoration: underline;
    font-weight: 500;
}

.shbs-restrictions-link:hover {
    color: #1193eb;
}

/* ============================================
   PRICE SUMMARY
   ============================================ */
.shbs-price-summary {
    background: #ecedf9;
    border-radius: 8px;
    padding: 14px 16px;
    margin-top: 16px;
}

.shbs-price-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 6px;
}

.shbs-price-row:last-child {
    margin-bottom: 0;
}

.shbs-price-label {
    font-size: 14px;
    color: #444;
    line-height: 1.4;
}

.shbs-price-value {
    font-size: 14px;
    color: #444;
    white-space: nowrap;
    text-align: right;
}

.shbs-price-ex {
    color: #444;
}

.shbs-price-base-row .shbs-price-label {
    font-weight: 500;
}

.shbs-price-divider {
    border-top: 1px solid #d4d6ea;
    margin: 8px 0;
}

.shbs-price-addon-row {
    font-size: 14px;
}

.shbs-price-addon-row .shbs-price-label {
    color: #666;
}

.shbs-price-addon-row .shbs-price-value {
    color: #666;
}

.shbs-price-vat-row .shbs-price-value {
    color: #1907c0;
}

.shbs-price-vat-row .shbs-price-label {
    color: #1907c0;
}

.shbs-price-total-row {
    border-top: 1px solid #d4d6ea;
    padding-top: 8px;
    margin-top: 4px;
}

.shbs-price-total-label {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
}

.shbs-price-total {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
}

/* ============================================
   ADD TO CART BUTTON (inside .shbs-custom-fields)
   ============================================ */
.shbs-add-to-cart-wrapper {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #d4d6ea;
}

.shbs-add-to-cart-wrapper .single_add_to_cart_button {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    box-sizing: border-box;
}

/* ============================================
   STICKY "READY TO BOOK?" BAR
   ============================================ */
.shbs-sticky-cta {
    position: relative;
    background: #1907c0;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.20);
    display: none;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-top: 0;
    margin-bottom: 0;
}

.shbs-sticky-cta.is-visible {
    display: block;
}

.shbs-sticky-cta-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--e-container-max-width, 1200px);
    margin: 0 auto;
    padding: 14px 24px;
    gap: 16px;
}

.shbs-sticky-cta-label {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
}

.shbs-sticky-cta-btn {
    background: #1193eb;
    color: #ffffff;
    border: none;
    border-radius: 100px;
    padding: 15px 30px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    line-height: 1;
}

.shbs-sticky-cta-btn:hover {
    background: #1193eb;
}

@media (max-width: 480px) {
    .shbs-sticky-cta-inner { padding: 12px 16px; }
    .shbs-sticky-cta-label { font-size: 17px; }
    .shbs-sticky-cta-btn { padding: 12px 20px; font-size: 15px; }
}

/* ============================================
   TRUST TEXT (below add to cart button)
   ============================================ */
.shbs-cart-trust-text {
    font-size: 13px;
    color: #888;
    text-align: center;
    margin: 10px 0 0 0;
    line-height: 1.5;
}

/* ============================================
   VALIDATION MODAL
   ============================================ */
.shbs-validation-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.shbs-validation-modal.active {
    opacity: 1;
    visibility: visible;
}

.shbs-validation-modal .shbs-error-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    cursor: pointer;
}

.shbs-validation-modal .shbs-error-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    border-radius: 16px;
    padding: 50px 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: shbsModalSlideIn 0.3s ease;
}

@keyframes shbsModalSlideIn {
    from { transform: translate(-50%, -60%); opacity: 0; }
    to   { transform: translate(-50%, -50%); opacity: 1; }
}

.shbs-validation-modal .shbs-error-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 25px;
    background: #fff3cd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: #856404;
    font-weight: 600;
}

.shbs-validation-modal .shbs-error-title {
    font-size: 28px;
    font-weight: 600;
    color: #333;
    margin: 0 0 15px 0;
    line-height: 1.3;
}

.shbs-validation-modal .shbs-error-message {
    font-size: 16px;
    color: #666;
    line-height: 1.6;
    margin: 0 0 20px 0;
}

.shbs-error-list {
    list-style: none;
    padding: 0;
    margin: 0 0 35px 0;
    text-align: left;
}

.shbs-error-list li {
    padding: 12px 20px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-left: 3px solid #1193eb;
    border-radius: 4px;
    font-size: 15px;
    color: #495057;
}

.shbs-error-list li:last-child { margin-bottom: 0; }

.shbs-validation-modal .shbs-error-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.shbs-validation-modal .shbs-error-retry {
    background: #1907c0;
    color: #ffffff;
    border: none;
    border-radius: 50px;
    padding: 14px 40px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.shbs-validation-modal .shbs-error-retry:hover {
    background: #1193eb;
}

.shbs-validation-modal .shbs-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 32px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 5px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.shbs-validation-modal .shbs-modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.shbs-validation-modal .shbs-error-content { position: relative; }

/* Mobile Responsive for Modal */
@media (max-width: 600px) {
    .shbs-validation-modal .shbs-error-content { padding: 40px 25px; width: 95%; }
    .shbs-validation-modal .shbs-error-icon { width: 70px; height: 70px; font-size: 35px; }
    .shbs-validation-modal .shbs-error-title { font-size: 24px; }
    .shbs-validation-modal .shbs-error-message { font-size: 15px; }
    .shbs-error-list li { padding: 10px 15px; font-size: 14px; }
    .shbs-validation-modal .shbs-error-retry { padding: 12px 32px; font-size: 15px; width: 100%; }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .shbs-date-value { font-size: 16px; }
    .shbs-pill-button { padding: 8px 6px; }
    .shbs-pill-weeks { font-size: 12px; }
    .shbs-pill-cost { font-size: 11px; }
}

@media (max-width: 480px) {
    .shbs-pill-buttons { gap: 6px; }
    .shbs-postcode-input-wrapper { flex-direction: column; }
    .shbs-postcode-input-wrapper .shbs-postcode-input { width: 100%; }
    .shbs-price-total { font-size: 20px; }
}

/* ============================================
   NO POSTCODE VIEW (MARKETING LAYOUT)
   ============================================ */
.shbs-no-postcode-view {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    max-width: 600px;
}

.shbs-no-postcode-subheading {
    font-size: 16px;
    color: #64748b;
    margin: 0 0 24px 0;
    line-height: 1.5;
}

.shbs-no-postcode-view .shbs-postcode-input-wrapper {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.shbs-no-postcode-view .shbs-postcode-input {
    flex: 1;
    padding: 14px 16px;
    font-size: 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    outline: none;
    transition: all 0.2s;
}

.shbs-no-postcode-view .shbs-postcode-input:focus {
    border-color: #1193eb;
    box-shadow: 0 0 0 3px rgba(17, 147, 235, 0.1);
}

.shbs-no-postcode-view .shbs-check-postcode-btn {
    padding: 14px 28px;
    background: #1193eb;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.shbs-no-postcode-view .shbs-check-postcode-btn:hover {
    background: #1193eb;
    transform: translateY(-1px);
}

.shbs-whats-included {
    margin-bottom: 32px;
}

.shbs-whats-included h3 {
    font-size: 20px;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 16px 0;
}

.shbs-included-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
}

.shbs-included-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 0;
    color: #475569;
    font-size: 15px;
    line-height: 1.4;
}

.shbs-included-list li svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.shbs-review-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
}

.shbs-review-stars {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.shbs-star {
    color: #fbbf24;
    font-size: 20px;
}

.shbs-review-source {
    color: #64748b;
    font-size: 13px;
    margin-left: 4px;
}

.shbs-review-text {
    font-size: 15px;
    color: #1e293b;
    line-height: 1.6;
    margin: 0 0 8px 0;
    font-style: italic;
}

.shbs-review-author {
    font-size: 14px;
    color: #64748b;
    margin: 0;
}

/* Mobile adjustments for no-postcode view */
@media (max-width: 480px) {
    .shbs-no-postcode-view .shbs-postcode-input-wrapper {
        flex-direction: column;
    }
    
    .shbs-no-postcode-view .shbs-check-postcode-btn {
        width: 100%;
    }

    /* Drop the included list back to a single column on small phones so each
       row has room to breathe. */
    .shbs-included-list {
        grid-template-columns: 1fr;
    }
}
