/**
 * Skip Hire Booking System – Cart Page Styles
 *
 * Styles the "Delivering to" banner and the Change Postcode modal.
 */

/* ==========================================================================
   Delivering-to bar
   ========================================================================== */

/* Wrapper creates a real block formatting context — padding-top here
   cannot collapse with parent margins the way margin-top on the bar would. */
.shbs-cart-bar-wrap {
    padding-top: 32px;
    padding-bottom: 16px;
}

.shbs-cart-delivering-to {
    background: #f5f6ff;
    border: 1px solid #e0e3f8;
    border-radius: 6px;
    padding: 12px 20px;
    font-size: 14px;
}

.shbs-cart-delivering-to-inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.shbs-delivering-label {
    color: #555;
    font-weight: 500;
    white-space: nowrap;
}

.shbs-delivering-address {
    color: #1a1a2e;
    font-weight: 600;
    flex: 1 1 auto;
}

.shbs-change-postcode-trigger {
    color: #1907c0;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 2px;
    white-space: nowrap;
    margin-left: auto;
    cursor: pointer;
    transition: color 0.2s;
}

.shbs-change-postcode-trigger:hover {
    color: #0d04a0;
}

/* ==========================================================================
   Change-postcode modal
   ========================================================================== */

.shbs-postcode-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    align-items: center;
    justify-content: center;
}

.shbs-postcode-modal.active {
    display: flex;
}

.shbs-postcode-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    animation: shbsFadeIn 0.2s ease;
}

.shbs-postcode-modal.closing .shbs-postcode-modal-overlay {
    animation: shbsFadeOut 0.25s ease forwards;
}

.shbs-postcode-modal-content {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 12px;
    padding: 36px 32px 32px;
    width: 100%;
    max-width: 440px;
    margin: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
    animation: shbsSlideUp 0.22s ease;
}

.shbs-postcode-modal.closing .shbs-postcode-modal-content {
    animation: shbsSlideDown 0.25s ease forwards;
}

.shbs-postcode-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #888;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}

.shbs-postcode-modal-close:hover {
    color: #333;
    background: #f5f5f5;
}

/* Modal title */
.shbs-modal-title {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #1a1a2e !important;
    margin: 0 0 8px !important;
    line-height: 1.3 !important;
}

.shbs-modal-desc {
    font-size: 14px;
    color: #666;
    margin: 0 0 20px;
    line-height: 1.5;
}

/* Postcode input row */
.shbs-modal-input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.shbs-modal-input-row .shbs-postcode-input {
    flex: 1;
    padding: 11px 14px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    outline: none;
    transition: border-color 0.2s;
}

.shbs-modal-input-row .shbs-postcode-input:focus {
    border-color: #1907c0;
}

.shbs-modal-confirm-btn {
    padding: 11px 20px;
    background: #1907c0;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.shbs-modal-confirm-btn:hover {
    background: #0d04a0;
}

.shbs-modal-confirm-btn:disabled {
    background: #999;
    cursor: not-allowed;
}

/* Inline message (success / error) */
.shbs-modal-message {
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 5px;
    margin-top: 4px;
}

.shbs-modal-message.error {
    background: #fff5f5;
    color: #c0392b;
    border: 1px solid #f5c6c6;
}

.shbs-modal-message.success {
    background: #f0fff4;
    color: #27ae60;
    border: 1px solid #b2dfdb;
}

/* Step 2 – warning */
.shbs-modal-warning-icon {
    text-align: center;
    margin-bottom: 12px;
}

.shbs-modal-warning-icon svg {
    display: inline-block;
}

.shbs-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.shbs-modal-danger-btn {
    padding: 12px 20px;
    background: #c0392b;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.shbs-modal-danger-btn:hover {
    background: #a93226;
}

.shbs-modal-danger-btn:disabled {
    background: #999;
    cursor: not-allowed;
}

.shbs-modal-cancel-btn {
    padding: 12px 20px;
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.shbs-modal-cancel-btn:hover {
    background: #eaeaea;
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes shbsFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes shbsFadeOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}

@keyframes shbsSlideUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0);    }
}

@keyframes shbsSlideDown {
    from { opacity: 1; transform: translateY(0);    }
    to   { opacity: 0; transform: translateY(16px); }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 480px) {
    .shbs-postcode-modal-content {
        padding: 28px 20px 24px;
    }

    .shbs-modal-input-row {
        flex-direction: column;
    }

    .shbs-modal-confirm-btn {
        width: 100%;
    }
}
