/* =============================================
   CART SIDE - Carrinho lateral deslizante
   ============================================= */

.cart-side-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(3px);
    z-index: 1030;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.cart-side-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cart-side-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    max-width: 100vw;
    height: 100dvh;
    background: #fff;
    z-index: 1031;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--font-Inter), sans-serif;
    border-left: 1px solid #efefef;
}

.cart-side-panel.active {
    transform: translateX(0);
}

/* ---------- HEADER ---------- */
.cart-side-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.cart-side-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: -0.3px;
}

.cart-side-title svg {
    width: 22px;
    height: 22px;
    fill: #E94C43;
}

.cart-side-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #E94C43;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 50px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    line-height: 1;
}

.cart-side-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f5f5f5;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    color: #555;
}

.cart-side-close:hover {
    background: #ffe5e4;
    color: #E94C43;
    transform: rotate(90deg);
}

.cart-side-close svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* ---------- BODY / ITEMS ---------- */
.cart-side-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}

.cart-side-body::-webkit-scrollbar {
    width: 4px;
}

.cart-side-body::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 4px;
}

.cart-side-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 14px;
    color: #aaa;
    padding: 40px 24px;
    text-align: center;
}

.cart-side-empty svg {
    width: 64px;
    height: 64px;
    fill: #e0e0e0;
}

.cart-side-empty p {
    font-size: 15px;
    color: #999;
    margin: 0;
}

.cart-side-empty a {
    font-size: 13px;
    color: #E94C43;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid #E94C43;
    padding-bottom: 1px;
    transition: opacity 0.2s;
}

.cart-side-empty a:hover {
    opacity: 0.75;
}

/* ITEM */
.cart-side-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 24px;
    border-bottom: 1px solid #f3f3f3;
    transition: background 0.15s;
    animation: cartItemIn 0.25s ease;
    position: relative;
}

@keyframes cartItemIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.cart-side-item:hover {
    background: #fafafa;
}

.cart-side-item-img {
    width: 96px;
    height: 96px;
    border-radius: 10px;
    object-fit: contain;
    border: 1px solid #efefef;
    flex-shrink: 0;
    background: #fafafa;
}

.cart-side-item-info {
    flex: 1;
    min-width: 0;
}

.cart-side-item-name {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.4;
    margin: 0 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-side-item-sku {
    font-size: 11px;
    color: #aaa;
    margin: 0 0 4px;
}

.cart-side-item-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
}

.cart-side-item-qty-wrap {
    display: flex;
    align-items: center;
    background: #f7f7f7;
    border-radius: 50px;
    padding: 2px;
    border: 1px solid #eee;
}

.cart-side-item-qty-wrap .btn-qty {
    background: transparent;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
}

.cart-side-item-qty-wrap .btn-qty:hover {
    background: #fff;
    color: #000;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.cart-side-item-qty-wrap input {
    width: 32px;
    text-align: center;
    background: transparent;
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    -moz-appearance: textfield;
    box-shadow: none!important;
}

.cart-side-item-qty-wrap input::-webkit-outer-spin-button,
.cart-side-item-qty-wrap input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.cart-side-item-price {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
}

.cart-side-item-remove {
    position: absolute;
    top: 6px;
    right: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #ccc;
    transition: color 0.2s, background 0.2s;
    text-decoration: none;
}

.cart-side-item-remove:hover {
    color: #E94C43;
    background: #fff0ef;
}

.cart-side-item-remove svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* ---------- FOOTER ---------- */
.cart-side-footer {
    border-top: 1px solid #f0f0f0;
    padding: 20px 24px;
    flex-shrink: 0;
    background: #fff;
}

.cart-side-subtotal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.cart-side-subtotal-label {
    font-size: 14px;
    color: #555;
    font-weight: 500;
    margin: 0;
}

.cart-side-subtotal-value {
    font-size: 18px;
    font-weight: 800;
    color: #1a1a1a;
    letter-spacing: -0.5px;
}

.cart-side-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.cart-side-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: opacity 0.15s, background 0.15s;
    border: none;
    cursor: pointer;
    letter-spacing: 0.2px;
}

.cart-side-btn:hover {
    text-decoration: none;
    opacity: 0.9;
}

.cart-side-btn:active {
    opacity: 0.8;
}

.cart-side-btn-primary {
    background: #0cb507;
    color: #fff;
}

.cart-side-btn-primary:hover {
    background: #0a9b06;
    color: #fff;
}

.cart-side-btn-secondary {
    background: #f5f5f5;
    color: #333;
}

.cart-side-btn-secondary:hover {
    background: #ececec;
    color: #333;
}

.cart-side-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    flex-shrink: 0;
}

/* ---------- TRIGGER NO HEADER ---------- */
.botao-carrinho {
    cursor: pointer;
    position: relative;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 480px) {
    .cart-side-panel {
        width: 100vw;
    }
}
