/* =========================================================
   Shiprocket Delivery Info Widget – widget.css
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── Container ─────────────────────────────────────────── */
#srdi-delivery-widget {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #fff;
    border: 1.5px solid #e8e8e8;
    border-radius: 14px;
    padding: 18px 20px 14px;
    margin: 18px 0 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    max-width: 520px;
}

/* ── Header ─────────────────────────────────────────────── */
.srdi-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.srdi-pin-icon {
    font-size: 1.1em;
}

.srdi-header-text {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
}

/* ── Input Row ──────────────────────────────────────────── */
.srdi-input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.srdi-pincode-input {
    flex: 1;
    height: 44px;
    border: 1.5px solid #dde1ea;
    border-radius: 10px;
    padding: 0 14px;
    font-size: 15px;
    font-family: inherit;
    font-weight: 500;
    color: #1a1a2e;
    letter-spacing: 1px;
    background: #f9fafc;
    transition: border-color .2s, box-shadow .2s;
    outline: none;
}

.srdi-pincode-input:focus {
    border-color: #4361ee;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.12);
    background: #fff;
}

.srdi-check-btn {
    height: 44px;
    padding: 0 22px;
    background: linear-gradient(135deg, #4361ee, #3a0ca3);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s, opacity .15s;
    white-space: nowrap;
}

.srdi-check-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(67, 97, 238, 0.35);
}

.srdi-check-btn:active {
    transform: translateY(0);
    opacity: .9;
}

.srdi-check-btn:disabled {
    opacity: .65;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ── Location Tag ───────────────────────────────────────── */
.srdi-location-tag {
    font-size: 12.5px;
    color: #555;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px dashed #ebebeb;
}

.srdi-location-tag strong {
    color: #1a1a2e;
}

.srdi-change-link {
    color: #4361ee;
    text-decoration: none;
    font-weight: 500;
    margin-left: 6px;
    font-size: 12px;
}

.srdi-change-link:hover {
    text-decoration: underline;
}

/* ── Section Label ──────────────────────────────────────── */
.srdi-section-label {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #888;
    text-transform: uppercase;
    margin-bottom: 10px;
}

/* ── Courier Option Card ────────────────────────────────── */
.srdi-couriers-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

.srdi-courier-option {
    border: 1.5px solid #e8e8e8;
    border-radius: 12px;
    padding: 13px 15px;
    cursor: pointer;
    transition: border-color .2s, background .2s, box-shadow .2s;
    position: relative;
}

.srdi-courier-option:hover {
    border-color: #4361ee;
    background: #f8f9ff;
}

.srdi-courier-option.srdi-selected {
    border-color: #4361ee;
    background: #f0f3ff;
    box-shadow: 0 2px 12px rgba(67, 97, 238, 0.12);
}

/* Radio button row */
.srdi-option-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.srdi-radio {
    width: 18px;
    height: 18px;
    border: 2px solid #c0c0c0;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .2s;
}

.srdi-selected .srdi-radio {
    border-color: #4361ee;
}

.srdi-radio-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #4361ee;
    display: none;
}

.srdi-selected .srdi-radio-dot {
    display: block;
}

/* Courier name & badge */
.srdi-option-name-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.srdi-courier-icon {
    font-size: 1.05em;
}

.srdi-courier-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
}

.srdi-type-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 9px;
    border-radius: 20px;
    background: #e8edff;
    color: #4361ee;
}

.srdi-type-badge.badge-express {
    background: #fff3cd;
    color: #b07a00;
}

.srdi-type-badge.badge-economy {
    background: #e8f5e9;
    color: #2e7d32;
}

.srdi-eta-badge {
    font-size: 11.5px;
    font-weight: 600;
    color: #555;
    background: #f2f2f2;
    padding: 2px 9px;
    border-radius: 20px;
    white-space: nowrap;
}

/* Price tag – THE KEY ADDITION */
.srdi-price-tag {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a2e;
    white-space: nowrap;
    margin-left: auto;
}

.srdi-price-tag.srdi-price-free {
    color: #16a34a;
}

.srdi-price-tag .srdi-price-strike {
    font-size: 12px;
    font-weight: 400;
    color: #aaa;
    text-decoration: line-through;
    margin-right: 4px;
}

/* Delivery date row */
.srdi-option-bottom {
    margin-top: 8px;
    padding-left: 28px;
}

.srdi-delivery-date {
    font-size: 13px;
    font-weight: 600;
    color: #2e8b57;
}

.srdi-selected .srdi-delivery-date {
    color: #2563eb;
}

.srdi-delivery-meta {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.srdi-dot {
    color: #ccc;
}

.srdi-cod-badge {
    color: #2e7d32;
    font-weight: 500;
}

.srdi-prepaid-badge {
    color: #555;
}

/* ── Loader ─────────────────────────────────────────────── */
.srdi-loader {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    color: #555;
    font-size: 13px;
}

.srdi-spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid #e0e0e0;
    border-top-color: #4361ee;
    border-radius: 50%;
    animation: srdi-spin .7s linear infinite;
}

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

/* ── Error State ────────────────────────────────────────── */
.srdi-error {
    background: #fff5f5;
    border: 1.5px solid #fca5a5;
    border-radius: 10px;
    padding: 12px 15px;
    font-size: 13px;
    color: #b91c1c;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

/* ── Footer Notice ──────────────────────────────────────── */
.srdi-footer-notice {
    font-size: 12px;
    color: #555;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.srdi-footer-notice strong {
    color: #1a1a2e;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 480px) {
    #srdi-delivery-widget {
        padding: 14px 14px 12px;
    }
    .srdi-check-btn {
        padding: 0 16px;
    }
    .srdi-price-tag {
        font-size: 13px;
    }
}

/* ── Entrance animation ─────────────────────────────────── */
.srdi-results {
    overflow: hidden;
}

.srdi-results-inner {
    animation: srdi-fadein .3s ease;
}

@keyframes srdi-fadein {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Shipping Updated Toast ──────────────────────────────── */
.srdi-toast {
    position: absolute;
    bottom: 14px;
    right: 16px;
    background: #16a34a;
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.35);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .3s ease, transform .3s ease;
    pointer-events: none;
    z-index: 100;
    white-space: nowrap;
}

.srdi-toast.srdi-toast-show {
    opacity: 1;
    transform: translateY(0);
}

/* Make widget a positioning context for the toast */
#srdi-delivery-widget {
    position: relative;
}
