body {
    margin: 0;
    font-family: Arial, sans-serif;
    position: relative;
}

#cart-icon {
    position: relative;
    cursor: pointer;
    font-size: 32px;
    z-index: 1000;
    margin-left: 26px;
}

#cart-count {
    position: absolute;
    bottom: -11px;
    left: -9px;
    background-color: red;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: none;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    font-weight: bold;
}

#cart-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 460px;
    height: auto;
    background-color: white;
    box-shadow: -2px 0 5px rgba(0,0,0,0.5);
    z-index: 2147483647;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

#cart-panel.open {
    display: flex;
}

#cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5) !important;
    z-index: 2147483646;
    display: none;
}

#cart-overlay.active {
    display: block;
}

#cart-header {
    padding: 20px;
    border-bottom: 1px solid #ccc;
    font-weight: bold;
    font-size: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #333;
}

#cart-products {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    min-height: 0;
}

#cart-total {
    display: flex;              /* flexbox para alinhamento */
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-top: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
    font-weight: bold;
    font-size: 16px;
}

.cart-total-label {
    text-align: left;
}

.cart-total-value {
    /* flex: 1; */
    float: right;
    display: block;
    margin-left: auto; /* empurra o valor para a direita */
    text-align: right;
}

.product-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.product-image {
    width: 50px;
    height: 50px;
    margin-right: 10px;
}

.product-info {
    flex: 1;
}

.product-name {
    margin: 0;
    font-size: 14px;
}

.product-details {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.quantity-controls {
    display: flex;
    align-items: center;
    margin-left: 10px;
}

.product-price {
    margin: 5px 0 0 0;
    font-weight: bold;
    color: #333;
}

.quantity-btn {
    width: 25px;
    height: 25px;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

.quantity-input {
    width: 40px;
    height: 25px;
    text-align: center;
    border: 1px solid #ccc;
    margin: 0 5px;
}

.remove-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    margin-left: 10px;
    color: #ff4444;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -5px;
}

.clsRemoverBtn {
    width: 23px;
    position: relative;
    top: -5px;
}

#checkout-btn {
    width: calc(100% - 40px);
    margin: 20px 20px 5px 20px;
    padding: 15px;
    box-sizing: border-box;
    background-color: #145a83;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
}

#continue-shopping-link {
    display: block;
    text-align: left;
    padding: 10px 15px 20px 15px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    color: #000;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    font-weight: bold;
    background: white;
}

#continue-shopping-link:hover {
    text-decoration: underline;
}

/* Ofertas Carrossel */
#cart-ofertas {
    height: 170px;
    border-top: 1px solid #ccc;
    padding: 5px;
    background: white;
    display: flex;
    flex-direction: column;
}

.ofertas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    padding: 0 5px;
}

.ofertas-titulo {
    margin: 0;
    font-size: 14px;
    color: #333;
    font-weight: bold;
}

.ofertas-controls {
    display: flex;
    gap: 10px;
}

.ofertas-nav {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    padding: 0 5px;
    z-index: 1;
}

.ofertas-nav:disabled {
    color: #ccc;
    cursor: default;
}

.ofertas-carousel-container {
    display: flex;
    align-items: center;
    flex: 1;
    overflow: hidden;
    position: relative;
}

.ofertas-wrapper {
    flex: 1;
    overflow: hidden;
}

.ofertas-track {
    display: flex;
    transition: transform 0.3s ease;
    width: 100%;
}

.oferta-item {
    min-width: 50%;
    box-sizing: border-box;
    padding: 0 2px;
}

.oferta-content {
    background: transparent;
    padding: 0;
    height: 125px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    text-align: center;
}

.oferta-img-container {
    height: 45px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2px;
}

.oferta-image {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.oferta-info {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.oferta-name {
    margin: 2px 0 0 0;
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #333;
    width: 100%;
}

.oferta-price {
    margin: 1px 0 3px 0;
    font-size: 11px;
    font-weight: bold;
    color: #0659cd;
}

.btn-add-oferta {
    background: #28a745;
    color: white;
    border: none;
    border-radius: 3px;
    font-size: 10px;
    cursor: pointer;
    padding: 6px 6px;
    width: 80%;
    line-height: 1.2;
    min-height: 27px;
}

.btn-add-oferta:hover {
    background: #218838;
}

/* Fade In Animation */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

/* Mobile Adjustments */
@media (max-width: 480px) {
    #cart-panel {
        width: 100%;
    }
    
    #cart-header {
        padding: 15px;
    }

    #cart-products {
        padding: 5px;
    }

    #checkout-btn {
        margin: 15px 15px 5px 15px;
        width: calc(100% - 30px);
        padding: 12px;
    }

    #continue-shopping-link {
        padding: 10px 15px 15px 15px;
    }

    .oferta-name {
        font-size: 10px;
    }
}