/* =============================================================================
   BAB Delivery Date Calculator v1.1 – Styles
   ============================================================================= */

/* ── Header button ─────────────────────────────────────────────────────────── */

.wc-ddc-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    transition: background 0.15s;
    color: inherit;
    line-height: 1.4;
    vertical-align: middle;
}
.wc-ddc-btn:hover { background: rgba(0,0,0,.07); }
.wc-ddc-truck { font-size: 1.15em; }
.wc-ddc-label { font-size: 1em; }
.wc-ddc-arrow { font-size: 0.65em; opacity: 0.55; margin-left: 1px; }

/* ── Modal backdrop ─────────────────────────────────────────────────────────── */

.wc-ddc-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    align-items: center;
    justify-content: center;
}
.wc-ddc-modal.open { display: flex; }
.wc-ddc-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.52);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}
body.wc-ddc-lock { overflow: hidden; }

/* ── Modal box ──────────────────────────────────────────────────────────────── */

.wc-ddc-box {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 14px;
    padding: 24px 20px 0;
    width: min(420px, 94vw);
    max-height: min(620px, 88vh);
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 70px rgba(0,0,0,.22);
    animation: wcddc-in .18s ease;
    overflow: hidden;
}
@keyframes wcddc-in {
    from { opacity: 0; transform: scale(.93) translateY(10px); }
    to   { opacity: 1; transform: scale(1)   translateY(0); }
}

.wc-ddc-close {
    position: absolute !important;
    top: 12px !important;
    right: 14px !important;
    left: auto !important;
    z-index: 10;
    background: #f0f0f0;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: #555;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0 !important;
    margin: 0 !important;
    float: none !important;
    transition: background .12s, color .12s;
    flex-shrink: 0;
}
.wc-ddc-close:hover { background: #ddd; color: #111; }

.wc-ddc-modal-title {
    margin: 0 0 3px;
    padding-right: 36px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a1a1a;
    flex-shrink: 0;
}
.wc-ddc-modal-sub {
    margin: 0 0 12px;
    font-size: .78rem;
    color: #999;
    flex-shrink: 0;
}

/* ── Search ─────────────────────────────────────────────────────────────────── */

.wc-ddc-search-wrap {
    position: relative;
    margin-bottom: 8px;
    flex-shrink: 0;
}
.wc-ddc-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: .85rem;
    pointer-events: none;
    opacity: .5;
}
#wc-ddc-search {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 12px 9px 32px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font-size: .92rem;
    font-family: inherit;
    color: #222;
    background: #f8f8f8;
    outline: none;
    transition: border-color .15s, background .15s;
}
#wc-ddc-search:focus {
    border-color: #2271b1;
    background: #fff;
}
#wc-ddc-search::-webkit-search-cancel-button { display: none; }

/* ── Country list ───────────────────────────────────────────────────────────── */

.wc-ddc-country-list {
    overflow-y: auto;
    flex: 1;
    margin: 0 -20px;
    padding: 0 20px 16px;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}
.wc-ddc-country-list::-webkit-scrollbar { width: 5px; }
.wc-ddc-country-list::-webkit-scrollbar-track { background: transparent; }
.wc-ddc-country-list::-webkit-scrollbar-thumb { background: #ddd; border-radius: 3px; }

.wc-ddc-section-head {
    padding: 10px 0 4px;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #bbb;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 2;
}
.wc-ddc-all-head { margin-top: 4px; }

.wc-ddc-list-loading {
    text-align: center;
    padding: 24px 0;
    font-size: 1.4em;
    opacity: .5;
}

/* ── Country item ───────────────────────────────────────────────────────────── */

.wc-ddc-citem {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 7px 8px;
    border: none;
    border-radius: 7px;
    background: none;
    cursor: pointer;
    text-align: left;
    font-size: .92rem;
    font-family: inherit;
    color: #1a1a1a;
    transition: background .1s;
}
.wc-ddc-citem:hover  { background: #f2f2f2; }
.wc-ddc-citem:focus-visible { outline: 2px solid #2271b1; outline-offset: 1px; }
.wc-ddc-citem.is-active {
    background: #e8f1fb;
    font-weight: 600;
}
.wc-ddc-citem:disabled { opacity: .55; cursor: default; }

.wc-ddc-ci-flag { font-size: 1.25em; line-height: 1; flex-shrink: 0; width: 1.4em; text-align: center; }
.wc-ddc-ci-name { flex: 1; }
.wc-ddc-check   { color: #2271b1; font-weight: 700; margin-left: auto; flex-shrink: 0; }

/* ── Product page estimate block ────────────────────────────────────────────── */

.wc-ddc-estimate {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    margin: 10px 0 16px;
    padding: 9px 14px;
    border-radius: 6px;
    font-size: .88rem;
    line-height: 1.5;
    transition: opacity .25s;
}
.wc-ddc-estimate.wc-ddc-loading { opacity: .4; }
.wc-ddc-instock  { background: #f0f9f0; border-left: 3px solid #5cb85c; }
.wc-ddc-preorder { background: #fffbf0; border-left: 3px solid #f0ad4e; }
.wc-ddc-unknown  { background: #f7f7f7; border-left: 3px solid #ccc; color: #777; }
.wc-ddc-ei     { font-size: 1.05em; }
.wc-ddc-elabel { color: #555; }
.wc-ddc-edate  { color: #111; }
.wc-ddc-note   { font-size: .77em; color: #aaa; margin-left: 2px; }

/* ── Order delivery date shortcode [order_delivery_date] ─────────────────── */

.wc-ddc-order-date {
    color: #2e7d32;
    font-weight: 700;
}
.wc-ddc-order-date--unknown {
    color: #999;
    font-weight: normal;
}
