/* ============================================================
   ShippingCosts Module — Styles
   Compatible: PrestaShop 1.7
   ============================================================ */

/* ---------- Przycisk ---------- */
.shipping-costs-wrapper {
    margin: 14px 0 6px;
}

.btn-shipping-costs {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 20px;
    background: blueviolet;
    color: #FFFFFF;
    border: 0px solid #1a1a2e;
    border-radius: 4px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background .18s ease, color .18s ease, transform .12s ease,
                box-shadow .18s ease;
    /*box-shadow: 3px 3px 0 #1a1a2e;*/
    position: relative;
    user-select: none;
}

.btn-shipping-costs:hover {
    background: gold;
    color: #fff;
    /*box-shadow: 5px 5px 0 #e8b400;
    transform: translate(-1px, -1px);*/
}

.btn-shipping-costs:active {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0 #1a1a2e;
}

.btn-shipping-icon { display: flex; align-items: center; }
.btn-shipping-label { flex: 1; }
.btn-shipping-arrow {
    display: flex;
    align-items: center;
    transition: transform .2s ease;
}
.btn-shipping-costs:hover .btn-shipping-arrow {
    transform: translateY(2px);
}

/* ---------- Modal Overlay ---------- */
.sc-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.sc-modal[hidden] { display: none !important; }

.sc-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 20, .55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    animation: sc-fade-in .22s ease;
}

/* ---------- Dialog ---------- */
.sc-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: 88vh;
    background: #fff;
    border-radius: 8px;
   /* box-shadow: 0 24px 64px rgba(0,0,0,.28), 4px 4px 0 #e8b400;*/
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: sc-slide-up .26s cubic-bezier(.34,1.3,.64,1);
}

/* ---------- Header ---------- */
.sc-modal__header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px 16px;
    background: blueviolet;
    color: #fff;
    flex-shrink: 0;
}

.sc-modal__header-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: gold;
    border: 2px solid black;
    display: flex;
    align-items: center;
    justify-content: center;
    color: black;
    flex-shrink: 0;
}

.sc-modal__header-text { flex: 1; }

.sc-modal__subtitle {
    display: block;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(255,255,255,.55);
    margin-bottom: 2px;
}

.sc-modal__title {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
}

.sc-modal__close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: gold;
    color: #000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
    flex-shrink: 0;
}

.sc-modal__close:hover { background: red; }

/* ---------- Product Name ---------- */
.sc-modal__product-name {
    padding: 10px 20px 0;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

.sc-modal__product-name:empty { display: none; }

/* ---------- Body ---------- */
.sc-modal__body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 20px;
}

/* ---------- Loading ---------- */
.sc-modal__loading {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 0;
    color: #888;
    font-size: 14px;
}

.sc-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e0e0e0;
    border-top-color: #1a1a2e;
    border-radius: 50%;
    animation: sc-spin .7s linear infinite;
    flex-shrink: 0;
}

/* ---------- Error ---------- */
.sc-modal__error {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px;
    background: #fff5f5;
    border: 1px solid #ffd5d5;
    border-radius: 6px;
    color: #c0392b;
    font-size: 14px;
}

.sc-modal__error[hidden] { display: none !important; }

/* ---------- Rates List ---------- */
.sc-rates-list[hidden] { display: none !important; }

.sc-rate-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1.5px solid #eee;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: border-color .15s, box-shadow .15s;
    background: #fafafa;
    animation: sc-fade-in .3s ease both;
}

.sc-rate-item:last-child { margin-bottom: 0; }

.sc-rate-item:hover {
    border-color: #1a1a2e;
    box-shadow: 2px 2px 0 #e8b400;
    background: #fff;
}

/* Free shipping highlight */
.sc-rate-item--free {
    border-color: #2ecc71;
    background: #f0fff5;
}

.sc-rate-item--free:hover {
    border-color: #27ae60;
    box-shadow: 2px 2px 0 #2ecc71;
}

/* Carrier Logo */
.sc-rate-logo {
    width: 48px;
    height: 32px;
    object-fit: contain;
    border-radius: 4px;
    background: #fff;
    border: 1px solid #e8e8e8;
    padding: 3px;
    flex-shrink: 0;
}

.sc-rate-logo-placeholder {
    width: 48px;
    height: 32px;
    background: #e8e8e8;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #aaa;
    font-size: 20px;
}

/* Carrier Info */
.sc-rate-info {
    flex: 1;
    min-width: 0;
}

.sc-rate-name {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.sc-rate-delay {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Price */
.sc-rate-price {
    font-size: 16px;
    font-weight: 800;
    color: #1a1a2e;
    white-space: nowrap;
    flex-shrink: 0;
}

.sc-rate-price--free {
    color: #27ae60;
    font-size: 14px;
    letter-spacing: .04em;
}

/* Free badge */
.sc-rate-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    background: #2ecc71;
    color: #fff;
    border-radius: 3px;
    padding: 2px 6px;
    margin-left: 6px;
    vertical-align: middle;
}

/* Empty state */
.sc-no-carriers {
    text-align: center;
    padding: 28px 16px;
    color: #888;
    font-size: 14px;
    line-height: 1.6;
}

.sc-no-carriers svg { margin-bottom: 10px; opacity: .4; }

/* ---------- Footer ---------- */
.sc-modal__footer {
    padding: 12px 20px 16px;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.sc-modal__note {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #aaa;
    margin: 0;
}

/* ---------- Keyframes ---------- */
@keyframes sc-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes sc-slide-up {
    from { opacity: 0; transform: translateY(30px) scale(.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

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

/* ---------- Responsive ---------- */
@media (max-width: 520px) {
    .sc-modal__dialog {
        max-height: 95vh;
        border-radius: 12px 12px 0 0;
        align-self: flex-end;
        animation: sc-slide-up-mobile .26s cubic-bezier(.34,1.3,.64,1);
    }

    .sc-modal {
        align-items: flex-end;
        padding: 0;
    }

    @keyframes sc-slide-up-mobile {
        from { opacity: 0; transform: translateY(100%); }
        to   { opacity: 1; transform: translateY(0); }
    }
}
