/*
 * Roxi Sepet eklentisi
 * İçerik temanın kendi sınıflarıyla çizilir (eglib.css + style.css):
 * .butto, .form-floating.fc-icon, .basket--products, .order--payment_method,
 * .order-payment_title, .card, .alert, .checkbox. Burada pencere kabuğu ve yerleşim var.
 */

/* ---------- Başlıktaki sepet butonu ---------- */
.rs-header-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-right: 10px;
    border: 0;
    border-radius: 8px;
    background: var(--bg);
    color: var(--main-color);
    font-size: 20px;
    cursor: pointer;
    transition: 0.4s ease all;
}
.rs-header-btn:hover { filter: brightness(0.95); }
.rs-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background: var(--main-color);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 20px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--white);
}
.rs-badge[data-count="0"] { display: none; }
.rs-bump { animation: rs-bump 0.4s ease; }
@keyframes rs-bump { 50% { transform: scale(1.3); } }

/* ---------- Pencere kabuğu (sepet ve "Sepete Ekle" ortak) ---------- */
.rs-modal {
    position: fixed;
    inset: 0;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 15px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: 0.2s ease all;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.rs-modal.show { opacity: 1; visibility: visible; pointer-events: all; }
.rs-linear { position: absolute; inset: 0; background: #11131ec2; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
body.rs-lock { overflow: hidden; }

.rs-box {
    --rs-line: #eceff4;
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 620px;
    max-height: 100%;
    background: var(--white);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 30px 80px -20px rgba(17, 19, 30, 0.45);
    transform: translateY(24px) scale(0.98);
    opacity: 0;
    transition: 0.3s cubic-bezier(.2, .8, .3, 1) all;
}
.rs-modal.show .rs-box { transform: none; opacity: 1; transition-delay: 0.05s; }
.rs-add .rs-box { max-width: 500px; }

/* Kapatma butonu */
.rs-x {
    position: absolute;
    right: 16px;
    top: 16px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 10px;
    background: var(--bg);
    color: var(--soft-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    cursor: pointer;
    transition: 0.2s;
    z-index: 3;
}
.rs-x:hover { color: var(--main-color); }

/* Üst bölüm */
.rs-head, .rs-foot, .rs-detail { flex-shrink: 0; }
.rs-head {
    position: relative;
    padding: 20px 64px 20px 28px;
    border-bottom: 1px solid var(--rs-line);
}

/* Adım göstergesi: ikon + yazı, aralarında bağlantı çizgisi */
.rs-steps { display: flex; align-items: center; gap: 14px; }
.rs-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0;
    border: 0;
    background: none;
    font-family: var(--font);
    text-align: left;
    cursor: default;
}
.rs-step-icon {
    position: relative;
    width: 44px;
    min-width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--soft-text);
    background: var(--bg);
    transition: 0.3s;
}
.rs-step-text { display: flex; flex-direction: column; line-height: 1.25; }
.rs-step-text small {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--soft-text);
}
.rs-step-text b { font-size: 15px; font-weight: 600; color: var(--soft-text); transition: 0.3s; }
.rs-step-line { flex: 1; min-width: 20px; max-width: 110px; height: 0; border-top: 2px dashed #dde2ea; transition: 0.3s; }
.rs-step.active .rs-step-icon {
    background: var(--main-color);
    color: #fff;
    box-shadow: 0 8px 18px -8px var(--main-color);
}
.rs-step.active .rs-step-text b { color: var(--dark-text); }
.rs-step.done { cursor: pointer; }
.rs-step.done .rs-step-icon { color: var(--main-color); }
.rs-step.done .rs-step-icon::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: var(--main-color);
    opacity: 0.12;
}
.rs-step.done .rs-step-text b { color: var(--main-text); }
.rs-step.done:hover .rs-step-text b { color: var(--main-color); }
.rs-step.done + .rs-step-line { border-top-style: solid; border-color: var(--main-color); }

/* "Sepete Ekle" penceresinin başlığı */
.rs-title { display: flex; align-items: center; gap: 12px; }
.rs-title-icon {
    position: relative;
    width: 44px;
    min-width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
    color: var(--main-color);
}
.rs-title-icon::before { content: ""; position: absolute; inset: 0; border-radius: 12px; background: var(--main-color); opacity: 0.12; }
.rs-title b { display: block; font-size: 17px; font-weight: 700; color: var(--dark-text); line-height: 1.25; }
.rs-title small { display: block; font-size: 13px; color: var(--soft-text); }

/* Orta bölüm */
.rs-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px 26px;
    min-height: 120px;
}
.rs-add .rs-body { min-height: 0; }
.rs-label {
    display: block;
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--soft-text);
}
.rs-add .rs-label { margin-top: 20px; }

/* Alt bar: genel toplam + devam butonu; sepet detayı çizginin ortasında */
.rs-foot {
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px 28px;
    border-top: 1px solid var(--rs-line);
    background: var(--white);
}
.rs-total { display: flex; align-items: center; gap: 12px; min-width: 0; }
.rs-total-icon {
    position: relative;
    width: 48px;
    min-width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 23px;
    color: var(--main-color);
}
.rs-total-icon::before { content: ""; position: absolute; inset: 0; border-radius: 12px; background: var(--main-color); opacity: 0.12; }
.rs-total-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--soft-text);
}
.rs-total-val { display: block; font-size: 23px; font-weight: 700; color: var(--dark-text); line-height: 1.2; white-space: nowrap; }
.rs-detail-toggle {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translate(-50%, -50%);
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid var(--rs-line);
    background: var(--white);
    color: var(--main-text);
    border-radius: 20px;
    padding: 5px 14px 5px 9px;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(17, 19, 30, 0.07);
    cursor: pointer;
    transition: 0.2s;
}
.rs-detail-toggle i { font-size: 16px; color: var(--main-color); transition: 0.3s; }
.rs-detail-toggle:hover { color: var(--main-color); border-color: var(--main-color); }
.rs-detail-open .rs-detail-toggle i { transform: rotate(180deg); }
.rs-next {
    margin-left: auto;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 180px;
    padding: 16px 26px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    border-radius: 12px !important;
    white-space: nowrap;
    box-shadow: 0 10px 22px -12px var(--main-color);
}
.rs-next i { font-size: 18px; transition: 0.2s; }
.rs-next:hover i.eg-arrow-right-line { transform: translateX(3px); }

/* Sepet detayı: alt barın üstünde açılan döküm */
.rs-detail {
    max-height: 0;
    overflow: hidden;
    background: var(--bg);
    transition: max-height 0.3s ease;
}
.rs-detail-open .rs-detail { max-height: 260px; overflow-y: auto; }
.rs-detail ul { list-style: none; margin: 0; padding: 18px 28px 26px; display: flex; flex-direction: column; gap: 10px; }
.rs-detail li { display: flex; justify-content: space-between; gap: 15px; font-size: 14px; color: var(--soft-text); }
.rs-detail li span:last-child { font-weight: 600; color: var(--main-text); white-space: nowrap; }
.rs-detail li.rs-sum { padding-top: 10px; border-top: 1px dashed #d4dae4; color: var(--dark-text); font-weight: 700; }
.rs-detail li.rs-sum span:last-child { color: var(--dark-text); }

/* Ürün kartları: temadaki .basket--products, çerçeveli ve sade */
.rs-modal .basket--products { gap: 10px; }
.rs-modal .basket--products > .item {
    flex-wrap: nowrap;
    gap: 14px;
    background: var(--white);
    border: 1px solid var(--rs-line);
    border-radius: 16px;
    padding: 12px 14px 12px 12px;
    transition: border-color 0.2s;
}
.rs-modal .basket--products > .item:hover { border-color: #dfe3ea; }
.rs-modal .basket--products > .item .icon { flex: none; min-width: 52px; width: 52px; max-width: none; height: 56px; font-size: 25px; }
.rs-modal .basket--products > .item .icon::before { opacity: 0.12; }
.rs-modal .basket--products > .item .text { min-width: 0; flex: 1; width: auto; }
.rs-modal .basket--products > .item .text .product--category { display: block; font-size: 13px; line-height: 1.3; }
.rs-modal .basket--products > .item .text .product--name { font-size: 16px; color: var(--dark-text); line-height: 1.3; }
.rs-modal .basket--products > .item .text .order--value { display: block; margin-top: 5px; }
.rs-modal .basket--products > .item .action { align-items: center; gap: 12px; flex: none; }
.rs-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    padding: 3px 9px;
    border-radius: 7px;
    background: var(--bg);
    color: var(--main-text);
    font-size: 13px;
    font-weight: 500;
}
.rs-chip i { color: var(--soft-text); font-size: 14px; flex: none; }
.rs-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-price { font-size: 16px; font-weight: 700; color: var(--dark-text); white-space: nowrap; }
.rs-remove {
    border: 0;
    background: var(--bg);
    color: var(--soft-text);
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    cursor: pointer;
    transition: 0.2s;
}
.rs-remove:hover { color: var(--danger); }

/* Sipariş bilgileri adımı */
.rs-section + .rs-section { margin-top: 24px; }
.rs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rs-grid .rs-full { grid-column: 1 / -1; }
.rs-grid .form-floating { margin-bottom: 0 !important; }
.rs-modal .order--payment_method { margin: 0; }
.rs-modal .checkbox { gap: 2px; margin-top: 20px; }
.rs-modal .checkbox .text { font-size: 15px; color: var(--soft-text); }
.rs-modal .checkbox .text a { color: var(--main-color); font-weight: 600; }

.rs-empty { text-align: center; padding: 34px 20px; color: var(--soft-text); }
.rs-empty i { display: block; font-size: 56px; color: var(--main-color); opacity: 0.3; margin-bottom: 10px; }
.rs-empty p { margin: 0; }
.rs-loading { text-align: center; padding: 40px 0; color: var(--soft-text); }

.rs-invalid { border-color: var(--danger) !important; }
.rs-alert { display: none; }
.rs-alert.show { display: block; }

/* ---------- Bildirim ---------- */
.rs-toast {
    position: fixed;
    left: 50%;
    bottom: 100px;
    transform: translate(-50%, 20px);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px 10px 16px;
    max-width: calc(100% - 30px);
    background: var(--white);
    color: var(--main-text);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    box-shadow: 0 10px 40px rgba(17, 19, 30, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: 0.3s ease all;
    z-index: 1002;
}
.rs-toast > i { color: var(--success); font-size: 20px; }
.rs-toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.rs-toast .butto { white-space: nowrap; }

/* ---------- Mobil: alttan açılan pencere ---------- */
@media (max-width: 576px) {
    .rs-header-btn { width: 40px; height: 40px; font-size: 18px; margin-right: 8px; }
    .rs-modal { align-items: flex-end; padding: 0; }
    .rs-box { max-height: 92vh; border-radius: 22px 22px 0 0; transform: translateY(60px); }
    .rs-head { padding: 16px 58px 16px 16px; }
    .rs-x { right: 14px; top: 16px; }
    .rs-steps { gap: 8px; }
    .rs-step { gap: 8px; }
    .rs-step-icon, .rs-title-icon { width: 38px; min-width: 38px; height: 38px; font-size: 18px; }
    .rs-step-text small { font-size: 10px; }
    .rs-step-text b { font-size: 13px; }
    .rs-step-line { min-width: 12px; }
    .rs-title b { font-size: 16px; }
    .rs-body { padding: 18px 16px 22px; }
    .rs-foot { padding: 20px 16px 16px; gap: 10px; }
    .rs-total-icon { display: none; }
    .rs-total-val { font-size: 20px; }
    .rs-next { min-width: 0; padding: 14px 18px !important; font-size: 15px !important; }
    .rs-detail ul { padding: 14px 16px 24px; }
    .rs-grid { grid-template-columns: 1fr; }
    .rs-modal .basket--products > .item { gap: 10px; padding: 10px; }
    .rs-modal .basket--products > .item .icon { min-width: 42px; width: 42px; height: 46px; font-size: 21px; }
    .rs-modal .basket--products > .item .text .product--category { font-size: 12px; }
    .rs-modal .basket--products > .item .text .product--name { font-size: 15px; }
    .rs-modal .basket--products > .item .action { gap: 8px; }
    .rs-chip { font-size: 12px; }
    .rs-price { font-size: 15px; }
    .rs-remove { width: 30px; height: 30px; font-size: 15px; }
}

/* ---------- Mobil düzeltmeler: başlık sıkışması ve bildirim ---------- */
.rs-toast > span { flex: 1; min-width: 0; line-height: 1.35; }
.rs-toast { width: max-content; max-width: min(460px, calc(100% - 30px)); }
@media (max-width: 576px) {
    .rs-head { padding: 14px 60px 14px 14px; }
    .rs-x { width: 32px; height: 32px; font-size: 18px; right: 14px; top: 16px; }
    .rs-steps { gap: 6px; }
    .rs-step { gap: 7px; flex: none; }
    .rs-step-icon, .rs-title-icon { width: 36px; min-width: 36px; height: 36px; font-size: 17px; border-radius: 10px; }
    .rs-step.done .rs-step-icon::before { border-radius: 10px; }
    .rs-step-text small { font-size: 10px; letter-spacing: 0.4px; }
    .rs-step-text b { font-size: 13px; white-space: nowrap; }
    .rs-step-line { flex: 1; min-width: 10px; }

    .rs-toast {
        left: 12px;
        right: 12px;
        width: auto;
        max-width: none;
        bottom: 90px;
        transform: translateY(20px);
        padding: 10px 10px 10px 14px;
        font-size: 14px;
    }
    .rs-toast.show { transform: none; }
    .rs-toast .butto { padding: 10px 14px !important; font-size: 14px !important; }
}
@media (max-width: 360px) {
    .rs-step-text small { display: none; }
    .rs-step-text b { font-size: 12px; }
}

/* ---------- Sipariş durumu sayfası (sepet siparişleri) ---------- */

.rs-od .rs-od-head .order--value { -webkit-line-clamp: 2; }
.rs-od .item .order--value { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rs-od-code {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 7px;
    background: var(--bg);
    color: var(--main-text);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: 0.2s;
}
.rs-od-code:hover { color: var(--main-color); }
.rs-od-field { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.rs-od-statu { display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; }
.rs-od-btn { display: inline-flex !important; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; text-decoration: none; transition: 0.2s; }
.rs-od-btn:hover { opacity: 0.9; }
.rs-od-btn i { transition: 0.2s; }
.rs-od-btn:hover i { transform: translateX(3px); }
@media (max-width: 576px) {
}
/* Sepet özet kartı: ana renkte, ürün kartlarından ayrışır */
.rs-od .item.rs-od-head {
    position: relative;
    overflow: hidden;
    background: var(--main-color);
    color: #fff;
}
.rs-od .item.rs-od-head::after {
    content: "";
    position: absolute;
    right: -60px;
    top: -60px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    pointer-events: none;
}
.rs-od .item.rs-od-head .icon { color: #fff; }
.rs-od .item.rs-od-head .icon::before { background: #fff; opacity: 0.18; }
.rs-od .item.rs-od-head .text .product--category { color: rgba(255, 255, 255, 0.8); }
.rs-od .item.rs-od-head .text .product--name { color: #fff; }
.rs-od .item.rs-od-head .text .order--value { color: rgba(255, 255, 255, 0.85); }
.rs-od .item.rs-od-head .od--statu,
.rs-od .item.rs-od-head .rs-od-btn {
    position: relative;
    z-index: 1;
    background: #fff !important;
    color: var(--main-color) !important;
    border-color: #fff !important;
}

/* Başlıktaki sepet butonu: "Yazı ve İkon" ayarı, masaüstü ve mobil için ayrı */
.rs-header-btn .rs-header-txt { display: none; line-height: 1; }
@media (min-width: 769px) {
    .rs-hb-text-d { width: auto; gap: 8px; padding: 0 18px; font-family: var(--font); font-size: 15px; font-weight: 600; }
    .rs-hb-text-d .rs-header-txt { display: inline; }
}
@media (max-width: 768px) {
    .rs-hb-text-m { width: auto; gap: 6px; padding: 0 14px; font-family: var(--font); font-size: 14px; font-weight: 600; }
    .rs-hb-text-m .rs-header-txt { display: inline; }
}
@media (max-width: 340px) {
    /* Çok dar ekranda yazı sığmaz: ikon kalır */
    .rs-hb-text-m { width: 40px; padding: 0; }
    .rs-hb-text-m .rs-header-txt { display: none; }
}
