/* Cart button styling */
.cart-btn {
    position: relative;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.cart-btn:hover {
    transform: translateY(-2px);
}

.cart-btn:active {
    transform: translateY(0);
}

/* Animated Cart Icon */
.cart-btn i {
    transition: transform 0.3s ease;
}

.cart-btn:hover i {
    transform: scale(1.2);
}

.cart-btn.shake {
    animation: shake 0.5s ease-in-out;
}

/* Add to cart button with brand styling - BEFORE being clicked */
.add-to-cart-btn {
    position: absolute;
    bottom: 15px;
    right: 15px;
    /* Dark charcoal button — brand primary, ivory icon */
    background: linear-gradient(135deg, #1C1C1C 0%, #0A0A0A 100%);
    color: #E0D9CE;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 12px rgba(0,0,0,0.4), 0 1px 4px rgba(201,169,110,0.15);
    z-index: 10;
    overflow: hidden;
    /* Subtle gold border ring */
    border: 2px solid rgba(201, 169, 110, 0.35);
}
/* RTL adjustment for add to cart button */
[dir="rtl"] .add-to-cart-btn {
    right: auto;
    /* left: 15px; */
}

.add-to-cart-btn:hover {
    /* Gold fill on hover — reveals brand accent */
    background: linear-gradient(135deg, #C9A96E 0%, #A8884F 100%);
    color: #FAF8F4;
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(201,169,110,0.45), 0 3px 8px rgba(0,0,0,0.3);
    border-color: rgba(222, 192, 138, 0.8);
}

.add-to-cart-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 106, 92, 0.4), 0 2px 6px rgba(74, 40, 49, 0.3);
}

/* Added to cart state - stays GREEN after adding */
.add-to-cart-btn.added {
    background: linear-gradient(135deg, #4CAF50 0%, #66BB6A 100%) !important; /* Green gradient */
    transform: scale(1.1);
    color: white !important;
}

.add-to-cart-btn.added:hover {
    background: linear-gradient(135deg, #45a049 0%, #5CBF60 100%) !important; /* Darker green on hover */
    transform: scale(1.1) translateY(-2px);
}

/* Button icon */
.add-to-cart-btn i {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.add-to-cart-btn:hover i {
    transform: scale(1.2);
}

/* Add to cart ripple effect */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

.add-to-cart-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: rgba(245, 230, 211, 0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
}

.add-to-cart-btn:active::after {
    animation: ripple 0.6s ease-out;
}

/* Adding a notification animation when item is added */
@keyframes flyToCart {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    20% {
        opacity: 0.8;
        transform: scale(1.2);
    }
    100% {
        opacity: 0;
        transform: scale(0.5) translateY(-100px);
    }
}

/* Cart button notification animation */
@keyframes shake {
    0% { transform: rotate(0); }
    15% { transform: rotate(5deg); }
    30% { transform: rotate(-5deg); }
    45% { transform: rotate(4deg); }
    60% { transform: rotate(-4deg); }
    75% { transform: rotate(2deg); }
    85% { transform: rotate(-2deg); }
    92% { transform: rotate(1deg); }
    100% { transform: rotate(0); }
}

/* Ensure cart button stays visible */
@media (max-width: 770px) {
    .cart-btn {
        display: flex !important;
    }
}

/* Modern Cart Count Badge with brand colors */
.cart-count {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #222222;
    color: #ffffff;
    font-size: 0.85rem;
    min-width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 3px 8px rgba(196, 130, 92, 0.4);
    border: 2px solid #868686;
    padding: 2px;
    transition: all 0.3s ease;
}

/* RTL adjustment for cart badge */
[dir="rtl"] .cart-count {
    right: auto;
    left: -10px;
}


/* Pulse animation for cart badge */
@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.9; }
    100% { transform: scale(1); opacity: 1; }
}

.pulse-animation {
    animation: pulse 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) infinite;
}

/* Ensure visibility on small screens */
@media (max-width: 770px) {
    .cart-count {
        top: -5px;
        right: -5px;
        min-width: 18px;
        height: 18px;
        font-size: 0.7rem;
        border-width: 1px;
    }
}

/* Adjust position for RTL layouts */
@media (max-width: 770px) {
    [dir="rtl"] .cart-count {
        left: -5px;
        right: auto;
    }
}

/* Modern add to cart button for menu items grid with brand styling */
.menu-items-grid .add-to-cart-btn {
    /* Consistent with absolute-positioned version: dark charcoal + gold border */
    background: linear-gradient(135deg, #1C1C1C 0%, #0A0A0A 100%);
    color: #E0D9CE;
    border: none;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.35), 0 1px 3px rgba(201,169,110,0.15);
    z-index: 10;
    position: relative;
    bottom: auto;
    right: auto;
    border: 2px solid rgba(201, 169, 110, 0.35);
}

.menu-items-grid .add-to-cart-btn:hover {
    background: linear-gradient(135deg, #C9A96E 0%, #A8884F 100%);
    color: #FAF8F4;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(201,169,110,0.4), 0 2px 6px rgba(0,0,0,0.25);
    border-color: rgba(222, 192, 138, 0.8);
}

.menu-items-grid .add-to-cart-btn i {
    font-size: 0.9rem;
}

/* Responsive adjustments for add to cart button */
@media (max-width: 767px) {
    .menu-items-grid .add-to-cart-btn {
        width: 30px;
        height: 30px;
    }
}

@media (max-width: 374px) {
    .menu-items-grid .add-to-cart-btn {
        width: 28px;
        height: 28px;
    }
}
/* End Cart Styles */