.topheader {
    margin: auto;
    padding: 8px 0px 6px 0px;
}

.topheader .s_inner {
    position: relative;
}

.topheader .s_inner .s_slogan {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topheader .s_inner .s_logo {
    display: flex;
    align-items: center;
}

.topheader .s_inner .s_right {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 12px !important;
    margin-left: auto;
}

.topheader .s_inner .s_right .s_cell {
    display: inline-flex;
    align-items: center;
}

/* ========================================================
   SHOPPING CART BUTTON & BADGE
   ======================================================== */
.s_slogan > .s_right > .s_cell.cart,
.topheader .s_cell.cart,
.s_cell.cart {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    width: 38px !important;
    height: 38px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.18) !important;
    border: 1px solid rgba(255, 255, 255, 0.35) !important;
    cursor: pointer !important;
    color: #ffffff !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    user-select: none !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    text-decoration: none !important;
    vertical-align: middle !important;
}

.s_slogan > .s_right > .s_cell.cart:hover,
.topheader .s_cell.cart:hover,
.s_cell.cart:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
    transform: translateY(-1px) scale(1.06) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18) !important;
}

.s_cell.cart svg,
.s_cell.cart .cart-svg-icon {
    width: 20px !important;
    height: 20px !important;
    stroke: #ffffff !important;
    fill: none !important;
    stroke-width: 2 !important;
    transition: transform 0.2s ease !important;
    flex-shrink: 0 !important;
}

.s_cell.cart:hover svg {
    transform: scale(1.1) !important;
}

/* Fallback cart icon if SVG is missing in legacy markup */
.s_cell.cart:not(:has(svg))::before {
    content: "" !important;
    display: inline-block !important;
    width: 20px !important;
    height: 20px !important;
    background-color: #ffffff !important;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='21' r='1'/%3E%3Ccircle cx='20' cy='21' r='1'/%3E%3Cpath d='M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6'/%3E%3C/svg%3E") no-repeat center / contain !important;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='21' r='1'/%3E%3Ccircle cx='20' cy='21' r='1'/%3E%3Cpath d='M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6'/%3E%3C/svg%3E") no-repeat center / contain !important;
}

/* Red counter badge */
.s_slogan > .s_right > .s_cell.cart > i,
.topheader .s_cell.cart > i,
.s_cell.cart > i,
.s_cell.cart .cart-badge-count {
    position: absolute !important;
    top: -4px !important;
    right: -6px !important;
    background: #ef4444 !important;
    color: #ffffff !important;
    font-style: normal !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    font-family: Arial, Tahoma, Verdana, sans-serif !important;
    height: 18px !important;
    min-width: 18px !important;
    line-height: 14px !important;
    text-align: center !important;
    border-radius: 9999px !important;
    border: 2px solid #ffffff !important;
    padding: 0 4px !important;
    box-sizing: border-box !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Cart Bounce Animation */
@keyframes cartBounce {
    0% { transform: scale(1); }
    25% { transform: scale(1.25) rotate(-6deg); }
    50% { transform: scale(0.9) rotate(4deg); }
    75% { transform: scale(1.15) rotate(-2deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.cart-bounce {
    animation: cartBounce 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

/* ========================================================
   TOAST NOTIFICATION (THÔNG BÁO GIỎ HÀNG THÀNH CÔNG)
   ======================================================== */
#cartToastNotification {
    position: fixed !important;
    top: 70px !important;
    right: 24px !important;
    z-index: 99999999 !important;
    background: #ffffff !important;
    color: #1f2937 !important;
    border-radius: 12px !important;
    padding: 14px 18px !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.18), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
    border-left: 4px solid #10b981 !important;
    font-family: Arial, Tahoma, Verdana, sans-serif !important;
    animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
    max-width: 440px !important;
    box-sizing: border-box !important;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

#cartToastNotification.toast-fadeout {
    animation: toastSlideOut 0.3s cubic-bezier(0.4, 0, 1, 1) forwards !important;
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
}

#cartToastNotification .toast-icon {
    width: 34px !important;
    height: 34px !important;
    border-radius: 50% !important;
    background: #ecfdf5 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    color: #10b981 !important;
}

#cartToastNotification .toast-content {
    flex: 1 !important;
    min-width: 0 !important;
}

#cartToastNotification .toast-title {
    font-weight: 700 !important;
    font-size: 14px !important;
    color: #111827 !important;
    margin-bottom: 2px !important;
}

#cartToastNotification .toast-desc {
    font-size: 13px !important;
    color: #4b5563 !important;
    line-height: 1.35 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    max-width: 230px !important;
}

#cartToastNotification .toast-view-btn {
    display: inline-block !important;
    padding: 7px 13px !important;
    background: #2563eb !important;
    color: #ffffff !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    transition: background 0.15s ease !important;
    cursor: pointer !important;
}

#cartToastNotification .toast-view-btn:hover {
    background: #1d4ed8 !important;
    color: #ffffff !important;
}

#cartToastNotification .toast-close {
    cursor: pointer !important;
    color: #9ca3af !important;
    font-size: 18px !important;
    line-height: 1 !important;
    padding: 2px 4px !important;
    margin-left: 2px !important;
    background: none !important;
    border: none !important;
}

#cartToastNotification .toast-close:hover {
    color: #374151 !important;
}

input:focus {
    outline: none !important;
}
