/* ==========================================
NovaShop Sidecart / Mini Cart
========================================== */

body.nova-sidecart-open {
    overflow: hidden;
}

/* Триггер в шапке */
.nova-sidecart-trigger {
    cursor: pointer;
}

.nova-sidecart-trigger .nova-header-icon-inner svg,
.nova-sidecart-trigger .nova-header-icon-inner img {
    pointer-events: none;
}

/* Overlay */
.nova-sidecart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    z-index: 999999;
}

.nova-sidecart-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

/* Панель */
.nova-sidecart {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 420px;
    max-width: 100%;
    background: #ffffff;
    z-index: 1000000;
    transform: translateX(105%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -20px 0 60px rgba(15, 23, 42, 0.18);
}

.nova-sidecart.is-open {
    transform: translateX(0);
}

.nova-sidecart__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.nova-sidecart__title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}

.nova-sidecart__close {
    width: 36px;
    height: 36px;
    border: 0;
    background: #f1f5f9;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #475569;
    transition: all 0.2s ease;
}

.nova-sidecart__close:hover {
    background: #ef4444;
    color: #ffffff;
    transform: rotate(90deg);
}

.nova-sidecart__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    transition: opacity 0.2s ease;
}

.nova-sidecart.is-loading .nova-sidecart__content {
    opacity: 0.6;
    pointer-events: none;
}

.nova-sidecart__body {
    flex: 1;
    overflow-y: auto;
    padding: 18px 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Товар */
.nova-sidecart-item {
    display: flex;
    gap: 14px;
    position: relative;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
    transition: opacity 0.2s ease;
}

.nova-sidecart-item.is-loading {
    opacity: 0.6;
    pointer-events: none;
}

.nova-sidecart-item__image {
    width: 72px;
    height: 72px;
    border-radius: 10px;
    overflow: hidden;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    flex: 0 0 auto;
}

.nova-sidecart-item__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.nova-sidecart-item__content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nova-sidecart-item__title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
}

.nova-sidecart-item__title a {
    color: #0f172a;
    text-decoration: none;
}

.nova-sidecart-item__title a:hover {
    color: var(--ns-primary, #c96a2e);
}

.nova-sidecart-item__meta {
    font-size: 12px;
    color: #64748b;
}

.nova-sidecart-item__meta dl {
    margin: 0;
}

.nova-sidecart-item__meta dt {
    float: left;
    margin: 0 4px 0 0;
}

.nova-sidecart-item__meta dd {
    margin: 0 0 4px;
}

.nova-sidecart-item__controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 4px;
}

.nova-sidecart-qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.nova-sidecart-qty button {
    width: 30px;
    height: 30px;
    border: 0;
    background: #f8fafc;
    color: #334155;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    transition: all 0.2s ease;
}

.nova-sidecart-qty button:hover {
    background: var(--ns-primary, #c96a2e);
    color: #ffffff;
}

.nova-sidecart-qty span {
    min-width: 34px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
}

.nova-sidecart-item__price {
    font-weight: 700;
    color: var(--ns-primary, #c96a2e);
    white-space: nowrap;
}

.nova-sidecart-item__remove {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border: 0;
    background: #f1f5f9;
    color: #64748b;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.nova-sidecart-item__remove:hover {
    background: #ef4444;
    color: #ffffff;
    transform: rotate(90deg);
}

/* Пустая корзина */
.nova-sidecart-empty {
    text-align: center;
    padding: 48px 18px;
    color: #64748b;
}

.nova-sidecart-empty__icon {
    font-size: 52px;
    margin-bottom: 14px;
}

.nova-sidecart-empty__title {
    margin: 0 0 8px;
    color: #0f172a;
    font-size: 18px;
}

.nova-sidecart-empty__link {
    display: inline-block;
    margin-top: 16px;
    padding: 11px 18px;
    border-radius: 8px;
    background: var(--ns-primary, #c96a2e);
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
}

.nova-sidecart-empty__link:hover {
    opacity: 0.9;
}

/* Футер */
.nova-sidecart__footer {
    border-top: 1px solid #e2e8f0;
    padding: 18px 22px;
    background: #ffffff;
    flex-shrink: 0;
}

.nova-sidecart__subtotal {
    display: flex;
    justify-content: space-between;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 14px;
    color: #0f172a;
}

.nova-sidecart__actions {
    display: grid;
    gap: 10px;
}

.nova-sidecart__btn {
    display: flex;
    justify-content: center;
    padding: 13px 18px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.2s ease;
}

.nova-sidecart__btn--cart {
    background: #f1f5f9;
    color: #334155;
}

.nova-sidecart__btn--checkout {
    background: var(--ns-primary, #c96a2e);
    color: #ffffff;
}

.nova-sidecart__btn:hover {
    transform: translateY(-1px);
    color: #ffffff;
}

/* Адаптив */
@media (max-width: 600px) {
    .nova-sidecart {
        width: 100%;
    }
}


/* ==========================================
   ВАРИАНТ 2: DROPDOWN (выпадающая под иконкой)
   ========================================== */
.nova-element-cart {
    position: relative;
}

.nova-cart-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 400px;
    max-width: 90vw;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(15, 23, 42, 0.04);
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    max-height: 75vh;
}

.nova-cart-dropdown.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Стрелочка сверху */
.nova-cart-dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 24px;
    width: 12px;
    height: 12px;
    background: #ffffff;
    transform: rotate(45deg);
    border-radius: 2px;
}

.nova-cart-dropdown__content {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.nova-cart-dropdown .nova-sidecart__body {
    max-height: 45vh;
    padding: 16px;
    gap: 12px;
}

.nova-cart-dropdown .nova-sidecart__footer {
    border-top: 1px solid #e2e8f0;
    padding: 14px 16px;
}

.nova-cart-dropdown .nova-sidecart-item {
    padding: 12px;
}

.nova-cart-dropdown .nova-sidecart-item__image {
    width: 60px;
    height: 60px;
}

/* На мобильных dropdown скрыт — вместо него открывается sidecart */
@media (max-width: 768px) {
    .nova-cart-dropdown {
        display: none;
    }
}