/* ============================================================
   CART DRAWER - Sağdan kayan geniş sepet
   Renkler: #F8F7F4 zemin · #FFFFFF kart · #1C1C1C buton
   ============================================================ */

.cd {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 430px;
    z-index: 160;
    background: #F8F7F4;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s 0.45s;
    box-shadow: -24px 0 56px rgba(23, 33, 43, 0.14);
}

.cd.is-open {
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.cd__inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* ---------- Başlık ---------- */
.cd__head {
    flex: 0 0 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
    background: #FFFFFF;
    border-bottom: 1px solid #E7E3DE;
}

.cd__title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #202124;
}

.cd__close {
    border: none;
    background: transparent;
    color: #202124;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.cd__close:hover {
    background: #F4F1EC;
}

/* ---------- Kampanya barı ---------- */
.cd__campaign {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    background: #F4E8EA;
    color: #8E4B55;
    font-size: 12.5px;
    font-weight: 500;
    text-align: center;
}

/* ---------- Kaydırma alanı ---------- */
.cd__scroll {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.cd__content {
    padding: 4px 0 0;
}

/* ---------- Ürün satırı ---------- */
.cd-items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cd-item {
    display: flex;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid #E7E3DE;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.cd-item.is-removing {
    opacity: 0;
    transform: translateX(16px);
}

.cd-item__media {
    flex: 0 0 95px;
    width: 95px;
    height: 95px;
    background: #F7F5F2;
    border: 1px solid #EDEAE4;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.cd-item__media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cd-item__main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.cd-item__line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.cd-item__line--top {
    align-items: flex-start;
}

.cd-item__name {
    font-size: 14px;
    font-weight: 500;
    color: #202124;
    text-decoration: none;
    line-height: 1.35;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.cd-item__name:hover {
    color: #8E4B55;
}

.cd-item__price {
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 600;
    color: #202124;
    white-space: nowrap;
}

.cd-item__variant {
    margin: 3px 0 0;
    font-size: 12.5px;
    color: #666666;
}

.cd-item__edit {
    margin-top: 2px;
    font-size: 12.5px;
    color: #8E4B55;
    text-decoration: underline;
    text-underline-offset: 2px;
    align-self: flex-start;
}

.cd-item__edit:hover {
    text-decoration: none;
}

.cd-item__warn {
    margin: 4px 0 0;
    font-size: 12px;
    color: #B3362D;
}

.cd-item__line--actions {
    margin-top: auto;
    align-items: center;
    padding-top: 10px;
}

/* Adet kontrolü */
.cd-qty {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid #DEDAD3;
    border-radius: 3px;
    background: #FFFFFF;
    overflow: hidden;
}

.cd-qty__btn {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    color: #202124;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.cd-qty__btn:hover {
    background: #F7F5F2;
    color: #8E4B55;
}

.cd-qty__btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.cd-qty__val {
    min-width: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13.5px;
    font-weight: 600;
    color: #202124;
    border-left: 1px solid #E7E3DE;
    border-right: 1px solid #E7E3DE;
    background: #FFFFFF;
}

/* Silme butonu + onay */
.cd-item__remove {
    margin-left: auto;
    border: none;
    background: transparent;
    color: #A8A29A;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.cd-item__remove:hover {
    color: #B3362D;
    background: #FBE9E8;
}

/* ---------- Geri Al toast ---------- */
.cd-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translate(-50%, 16px);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px 12px 18px;
    background: #1C1C1C;
    color: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
    font-size: 13.5px;
    z-index: 100000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    max-width: calc(100vw - 32px);
}

.cd-toast.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

.cd-toast__text {
    line-height: 1.4;
}

.cd-toast__undo {
    flex: none;
    border: 0;
    background: transparent;
    color: #FFFFFF;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    padding: 4px 2px;
    transition: color 0.2s ease;
}

.cd-toast__undo:hover {
    color: #D9E4D4;
}

/* ---------- Boş sepet ---------- */
.cd__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 64px 28px 40px;
    color: #C4CECF;
}

.cd__empty-title {
    margin: 18px 0 0;
    font-size: 16px;
    font-weight: 600;
    color: #202124;
}

.cd__empty-text {
    margin: 8px 0 22px;
    font-size: 13.5px;
    color: #666666;
    max-width: 240px;
    line-height: 1.5;
}

.cd__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 46px;
    padding: 0 26px;
    background: #1C1C1C;
    color: #FFFFFF;
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-decoration: none;
    border-radius: 3px;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.cd__cta:hover {
    background: #333333;
    transform: translateY(-1px);
}

/* ---------- Öneriler ---------- */
.cd-recs {
    padding: 22px 20px 30px;
}

.cd-recs__title {
    margin: 0 0 12px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #666666;
}

.cd-recs__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cd-rec {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #FFFFFF;
    border: 1px solid #EDEAE4;
    border-radius: 3px;
    padding: 10px 12px;
}

.cd-rec__media {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    background: #F7F5F2;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.cd-rec__media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cd-rec__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.cd-rec__name {
    font-size: 13px;
    font-weight: 500;
    color: #202124;
    text-decoration: none;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.cd-rec__name:hover {
    color: #8E4B55;
}

.cd-rec__price {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.cd-rec__price strong {
    font-size: 13.5px;
    font-weight: 600;
    color: #202124;
}

.cd-rec__old {
    font-size: 12px;
    color: #99948C;
}

.cd-rec__btn {
    flex-shrink: 0;
    border: 1px solid #1C1C1C;
    background: #1C1C1C;
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.cd-rec__btn:hover {
    background: #333333;
    transform: translateY(-1px);
}

.cd-rec__btn.is-loading {
    opacity: 0.55;
    pointer-events: none;
}

.cd-rec__btn--outline {
    background: transparent;
    color: #1C1C1C;
}

.cd-rec__btn--outline:hover {
    background: #F7F5F2;
    color: #202124;
}

/* ---------- Alt özet ---------- */
.cd__foot {
    flex: 0 0 auto;
    background: #FFFFFF;
    border-top: 1px solid #E7E3DE;
    padding: 16px 20px 18px;
    box-shadow: 0 -12px 28px rgba(23, 33, 43, 0.06);
}

.cd-summary {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 14px;
}

.cd-summary__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13.5px;
    color: #666666;
}

.cd-summary__row strong {
    font-size: 13.5px;
    font-weight: 600;
    color: #202124;
}

.cd-summary__row--discount span:last-child {
    color: #8E4B55;
    font-weight: 600;
}

.cd-summary__row--total {
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid #EDEAE4;
}

.cd-summary__row--total span {
    font-size: 14px;
    font-weight: 600;
    color: #202124;
}

.cd-summary__row--total strong {
    font-size: 19px;
    font-weight: 700;
    color: #202124;
}

.cd__checkout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 54px;
    background: #1C1C1C;
    color: #FFFFFF;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.cd__checkout:hover {
    background: #333333;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(28, 28, 28, 0.16);
}

.cd__checkout:disabled,
.cd__checkout.is-loading {
    opacity: 0.55;
    pointer-events: none;
}

.cd__secure {
    margin: 10px 0 0;
    text-align: center;
    font-size: 12px;
    color: #99948C;
}

/* ---------- Varyant penceresi ---------- */
.cd-modal {
    position: fixed;
    inset: 0;
    z-index: 180;
}

.cd-modal[hidden] {
    display: none;
}

.cd-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(23, 33, 43, 0.45);
    animation: cdFadeIn 0.25s ease;
}

.cd-modal__card {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(360px, 92vw);
    max-height: 84vh;
    overflow-y: auto;
    background: #FFFFFF;
    border-radius: 4px;
    padding: 26px 24px 24px;
    animation: cdRise 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.cd-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    border: none;
    background: transparent;
    color: #202124;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    cursor: pointer;
}

.cd-modal__close:hover {
    background: #F4F1EC;
}

.cd-modal__img {
    width: 128px;
    height: 128px;
    object-fit: contain;
    background: #F7F5F2;
    border: 1px solid #EDEAE4;
    border-radius: 3px;
    display: block;
    margin: 0 auto 14px;
}

.cd-modal__title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #202124;
    text-align: center;
}

.cd-modal__price {
    margin: 6px 0 18px;
    font-size: 15px;
    font-weight: 600;
    color: #202124;
    text-align: center;
}

.cd-modal__group {
    margin-bottom: 14px;
}

.cd-modal__group-label {
    display: block;
    margin-bottom: 7px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #666666;
}

.cd-modal__group-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cd-modal__dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid #DEDAD3;
    cursor: pointer;
    padding: 0;
    position: relative;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cd-modal__dot:hover {
    transform: scale(1.08);
}

.cd-modal__dot.is-active {
    box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 4px #202124;
}

.cd-modal__pill {
    border: 1px solid #DEDAD3;
    background: #FFFFFF;
    color: #202124;
    font-size: 13px;
    padding: 8px 14px;
    border-radius: 3px;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.cd-modal__pill:hover {
    border-color: #202124;
}

.cd-modal__pill.is-active {
    background: #1C1C1C;
    border-color: #1C1C1C;
    color: #FFFFFF;
}

.cd-modal__add {
    width: 100%;
    height: 50px;
    border: none;
    background: #1C1C1C;
    color: #FFFFFF;
    font-size: 14.5px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.cd-modal__add:hover {
    background: #333333;
    transform: translateY(-1px);
}

.cd-modal__add.is-loading {
    opacity: 0.55;
    pointer-events: none;
}

.cd-modal__err {
    margin: 12px 0 0;
    font-size: 12.5px;
    color: #B3362D;
    text-align: center;
}

/* ---------- Sayaç animasyonu ---------- */
@keyframes cdBump {
    0%   { transform: scale(1); }
    45%  { transform: scale(1.28); }
    100% { transform: scale(1); }
}

.site-actions__count.is-bump {
    animation: cdBump 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes cdFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes cdRise {
    from { opacity: 0; transform: translate(-50%, -46%); }
    to   { opacity: 1; transform: translate(-50%, -50%); }
}

/* ---------- Duyarlı ---------- */
@media (max-width: 1024px) {
    .cd {
        width: 400px;
    }
}

@media (max-width: 640px) {
    .cd {
        width: 100vw;
    }

    .cd__head {
        flex-basis: 60px;
    }

    .cd-item {
        padding: 14px 16px;
        gap: 12px;
    }

    .cd-item__media {
        flex-basis: 86px;
        width: 86px;
        height: 86px;
    }

    .cd-recs {
        padding: 20px 16px 26px;
    }
}
