/* ═══════════════════════════════════════════════════════════════
   Shipment Quote Calculator – Front-end Widget
═══════════════════════════════════════════════════════════════ */

.sqc-widget {
    width: 400px;
    max-width: 100%;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    font-size: 14px;
    overflow: hidden;
}

/* ── Tabs ──────────────────────────────────────────────────── */
.sqc-tabs {
    display: flex;
}

.sqc-tab {
    flex: 1;
    padding: 15px 10px;
    border: none;
    background: #f4f4f4;
    color: #666;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.4px;
    transition: background 0.2s, color 0.2s;
}

.sqc-tab.active {
    background: #1b63a6;
    color: #fff;
}

/* ── Pane ──────────────────────────────────────────────────── */
.sqc-pane {
    padding: 20px;
}

.sqc-title {
    text-align: center;
    margin: 0 0 16px;
    font-size: 15px;
    font-weight: 700;
    color: #1b2d45;
}

/* ── Labels & Inputs ───────────────────────────────────────── */
.sqc-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    margin: 12px 0 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sqc-input {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 14px;
    color: #222;
    transition: border-color 0.2s;
}

.sqc-input:focus {
    outline: none;
    border-color: #1b63a6;
}

/* ── Building toggle ───────────────────────────────────────── */
.building-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 8px 0 6px;
}

.building-toggle > span {
    font-size: 12px;
    color: #888;
}

.sqc-toggle {
    display: flex;
    gap: 5px;
}

.sqc-toggle button {
    padding: 5px 10px;
    border-radius: 20px;
    border: 1.5px solid #e0e0e0;
    background: #f7f7f7;
    color: #666;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.3px;
}

.sqc-toggle button.active {
    background: #f26522;
    color: #fff;
    border-color: #f26522;
}

/* ── Item rows ─────────────────────────────────────────────── */
.sqc-item-row {
    border: 1.5px solid #ebebeb;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
    background: #fafafa;
}

.sqc-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.sqc-item-num {
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    color: #1b63a6;
    letter-spacing: 0.5px;
}

.sqc-remove-item {
    background: none;
    border: none;
    color: #e53e3e;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    padding: 0 4px;
    line-height: 1;
}

.sqc-item-top {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.sqc-item-top select {
    flex: 1;
    padding: 9px 10px;
    border: 1.5px solid #e0e0e0;
    border-radius: 7px;
    font-size: 13px;
    color: #333;
    background: #fff;
}

.sqc-small {
    width: 70px !important;
    padding: 9px 8px !important;
    text-align: center;
    border: 1.5px solid #e0e0e0;
    border-radius: 7px;
    font-size: 13px;
}

.sqc-dims {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.sqc-dim-input {
    width: 100%;
    padding: 8px 6px;
    border: 1.5px solid #e0e0e0;
    border-radius: 7px;
    box-sizing: border-box;
    font-size: 12px;
    text-align: center;
    color: #333;
}

.sqc-dim-input:focus {
    outline: none;
    border-color: #1b63a6;
}

/* ── Controls ──────────────────────────────────────────────── */
.sqc-controls {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.btn-outline {
    flex: 1;
    padding: 11px;
    border-radius: 25px;
    border: 1.5px solid #ccc;
    background: #fff;
    color: #555;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.4px;
    transition: all 0.2s;
}

.btn-outline:hover {
    border-color: #1b63a6;
    color: #1b63a6;
}

.btn-primary {
    flex: 2;
    padding: 11px;
    border-radius: 25px;
    border: none;
    background: linear-gradient(135deg, #f26522, #e8520e);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: opacity 0.2s, transform 0.1s;
    box-shadow: 0 3px 8px rgba(242, 101, 34, 0.35);
}

.btn-primary:hover   { opacity: 0.92; transform: translateY(-1px); }
.btn-primary:active  { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ── Result area ───────────────────────────────────────────── */
#sqc-result {
    margin-top: 16px;
}

/* Loading */
.sqc-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #666;
    font-size: 14px;
    justify-content: center;
    padding: 20px 0;
}

.sqc-spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid #ddd;
    border-top-color: #1b63a6;
    border-radius: 50%;
    display: inline-block;
    animation: sqc-spin 0.7s linear infinite;
}

@keyframes sqc-spin { to { transform: rotate(360deg); } }

/* Error */
.sqc-error {
    background: #fff3f3;
    border: 1.5px solid #f5c6c6;
    color: #c62828;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 13px;
}

/* Route badge */
.sqc-route-badge {
    background: linear-gradient(135deg, #1b63a6, #1450a0);
    color: #fff;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.sqc-route-badge strong {
    margin-left: auto;
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
}

/* Items list */
.sqc-items-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.sqc-item-result {
    border: 1.5px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
}

.sqc-item-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #f7f9fc;
    font-size: 13px;
    font-weight: 600;
}

/* Breakdown */
.sqc-breakdown {
    padding: 0 12px;
}

.sqc-breakdown summary {
    cursor: pointer;
    font-size: 12px;
    color: #1b63a6;
    padding: 6px 0;
    user-select: none;
}

.sqc-breakdown-tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin: 6px 0;
}

.sqc-breakdown-tbl td {
    padding: 4px 0;
    border-bottom: 1px dashed #f0f0f0;
    color: #555;
}

.sqc-breakdown-tbl td:last-child {
    text-align: right;
    color: #333;
    font-weight: 600;
}

.sqc-meta {
    font-size: 11px;
    color: #999;
    margin: 4px 0 8px;
}

/* Total box */
.sqc-total-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f0f7ff;
    border: 2px solid #1b63a6;
    border-radius: 10px;
    padding: 14px 16px;
    margin: 14px 0 10px;
}

.sqc-total-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: #1b63a6;
    letter-spacing: 0.4px;
}

.sqc-total-price {
    font-size: 26px;
    font-weight: 800;
    color: #1b2d45;
}

/* Book button */
.sqc-book-btn {
    width: 100%;
    flex: none;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    box-shadow: 0 3px 8px rgba(46, 204, 113, 0.35);
    margin-bottom: 4px;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 440px) {
    .sqc-widget   { width: 100%; border-radius: 0; }
    .sqc-dims     { grid-template-columns: repeat(2, 1fr); }
    .sqc-controls { flex-direction: column; }
    .btn-outline, .btn-primary { flex: none; width: 100%; }
}

/* ─── Building type badges in result ──────────────────────────── */
.sqc-btype-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.sqc-btag {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.sqc-btag.commercial {
    background: #e8f0fe;
    color: #1b63a6;
    border: 1.5px solid #1b63a6;
}

.sqc-btag.residential {
    background: #fff3e0;
    color: #e65100;
    border: 1.5px solid #f26522;
}

.sqc-btag-arrow {
    color: #bbb;
    font-size: 16px;
}

/* ═══════════════════════════════════════════════════════════════
   Address Autocomplete
═══════════════════════════════════════════════════════════════ */

/* Input wrapper — positions the icon and dropdown */
.sqc-ac-wrap {
    position: relative;
    margin: 4px 0 0;
}

/* Search icon inside the input */
.sqc-ac-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    pointer-events: none;
    z-index: 1;
    line-height: 1;
}

/* The actual input — left-padding for icon */
.sqc-ac-input {
    padding-left: 32px !important;
    width: 100%;
    box-sizing: border-box;
}

/* Dropdown list */
.sqc-ac-list {
    display:          none;
    position:         absolute;
    top:              calc(100% + 4px);
    left:             0;
    right:            0;
    background:       #fff;
    border:           1.5px solid #1b63a6;
    border-radius:    10px;
    z-index:          9999;
    box-shadow:       0 8px 24px rgba(0, 0, 0, 0.14);
    overflow:         hidden;
    max-height:       260px;
    overflow-y:       auto;
}

/* Individual suggestion row */
.sqc-ac-item {
    display:        flex;
    flex-direction: column;
    padding:        11px 14px;
    cursor:         pointer;
    border-bottom:  1px solid #f4f4f4;
    transition:     background 0.15s;
    outline:        none;
}

.sqc-ac-item:last-child {
    border-bottom: none;
}

.sqc-ac-item:hover,
.sqc-ac-item:focus,
.sqc-ac-item.hovered {
    background: #eef4ff;
}

/* Main line: suburb + postcode */
.sqc-ac-main {
    font-size:   14px;
    font-weight: 700;
    color:       #1b2d45;
    line-height: 1.3;
}

/* Highlight the typed characters */
.sqc-ac-main b {
    color: #1b63a6;
}

/* Secondary line: state, country */
.sqc-ac-sub {
    font-size:   12px;
    color:       #888;
    margin-top:  2px;
    line-height: 1.3;
}

/* Loading indicator inside dropdown */
.sqc-ac-loading {
    padding:    14px;
    text-align: center;
    color:      #aaa;
    font-size:  13px;
}

/* Powered by Google badge (required by Google TOS) */
.sqc-ac-footer {
    padding:     8px 14px;
    text-align:  right;
    background:  #fafafa;
    border-top:  1px solid #f0f0f0;
    font-size:   11px;
    color:       #bbb;
}

/* Scrollbar style in dropdown */
.sqc-ac-list::-webkit-scrollbar       { width: 4px; }
.sqc-ac-list::-webkit-scrollbar-track { background: #f1f1f1; }
.sqc-ac-list::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }
