/* Cart Styling for Annapurna Jewelry */

/* Cart notification */
.cart-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1050;
    display: none;
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 350px;
    font-size: 0.9rem;
    font-weight: 500;
    transform: translateX(0);
    display: flex;
    align-items: center;
}

/* Cart link styling */
.cart-link {
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.cart-link:hover .cart-icon-wrapper {
    transform: translateY(-2px);
}

/* Cart icon wrapper */
.cart-icon-wrapper {
    position: relative;
    display: inline-block;
    transition: all 0.3s ease;
}

.cart-icon-wrapper i {
    font-size: 1.1rem;
    color: var(--secondary);
    transition: all 0.3s ease;
}

.cart-link:hover .cart-icon-wrapper i {
    color: var(--accent);
}

.cart-text {
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.cart-link:hover .cart-text {
    color: var(--accent);
}

/* Cart count badge styling */
.cart-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    border-radius: 20px;
    background-color: var(--accent, #CA8D97);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    position: absolute;
    top: -8px;
    right: -8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    letter-spacing: 0.02em;
    border: 1px solid rgba(255,255,255,0.3);
    font-family: 'Poppins', sans-serif;
}

/* Cart count animation */
.cart-count-updated {
    animation: cart-count-pulse 1.5s ease-out;
}

@keyframes cart-count-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(var(--accent-rgb, 202, 141, 151), 0.4);
    }
    30% {
        transform: scale(1.3);
        box-shadow: 0 0 0 6px rgba(var(--accent-rgb, 202, 141, 151), 0);
        border-color: rgba(255, 255, 255, 0.6);
    }
    70% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(var(--accent-rgb, 202, 141, 151), 0);
    }
}

.cart-notification.success {
    background-color: #f8f9fa;
    color: var(--secondary);
    border-left: 4px solid var(--primary);
}

/* Enhanced error notifications */
.cart-notification.error {
    background-color: #fff;
    color: #842029;
    border-left: 4px solid #842029;
    box-shadow: 0 4px 12px rgba(132, 32, 41, 0.1);
}

.cart-notification i {
    margin-right: 10px;
    font-size: 1.1rem;
}

.cart-notification.success i {
    color: var(--accent);
}

.cart-notification.error i {
    color: #842029;
}

/* Royal Cart Styling */
.royal-cart {
    display: flex;
    align-items: center;
    position: relative;
    padding: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.royal-cart-wrapper {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0.4) 100%);
    border: 1px solid rgba(var(--accent-rgb, 202, 141, 151), 0.3);
    border-radius: 20px;
    padding: 6px 14px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08), inset 0 1px 1px rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.royal-cart:hover .royal-cart-wrapper {
    border-color: rgba(var(--accent-rgb, 202, 141, 151), 0.6);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.12), inset 0 1px 1px rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
}

.royal-cart-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.royal-cart i {
    font-size: 1.2rem;
    color: var(--secondary);
    transition: all 0.3s ease;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.1));
}

.royal-cart:hover i {
    color: var(--accent);
}

.royal-cart-count {
    position: absolute;
    top: -10px;
    right: -10px;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--secondary) 100%);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    border: 1px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15), inset 0 1px 1px rgba(255, 255, 255, 0.3);
    letter-spacing: 0.02em;
    overflow: hidden;
    position: relative;
}

/* Royal shine animation */
@keyframes royal-shine {
    0% {
        transform: translateX(-100%) rotate(35deg);
        opacity: 0;
    }
    10% {
        transform: translateX(-80%) rotate(35deg);
        opacity: 0.3;
    }
    20% {
        transform: translateX(0%) rotate(35deg);
        opacity: 0.6;
    }
    30% {
        transform: translateX(80%) rotate(35deg);
        opacity: 0.3;
    }
    40% {
        transform: translateX(100%) rotate(35deg);
        opacity: 0;
    }
    100% {
        transform: translateX(100%) rotate(35deg);
        opacity: 0;
    }
}

.royal-cart-count::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -100%;
    width: 80%;
    height: 200%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.4) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(35deg);
    pointer-events: none;
}

.royal-cart-count.royal-shine::after {
    animation: royal-shine 1.5s ease-in-out;
}

.royal-cart-text {
    margin-left: 10px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--secondary);
    letter-spacing: 0.03em;
    transition: all 0.3s ease;
}

.royal-cart:hover .royal-cart-text {
    color: var(--accent);
}

/* Mobile royal cart styling */
.mobile-cart-link.royal-cart {
    margin-right: 12px;
}

.mobile-cart-link.royal-cart .royal-cart-icon i {
    font-size: 1.3rem;
}

@media (max-width: 991.98px) {
    .royal-cart-count {
        top: -8px;
        right: -8px;
        min-width: 18px;
        height: 18px;
        font-size: 0.65rem;
    }
}

/* Elegant mobile menu toggle */
.elegant-toggler {
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    background-color: transparent;
    transition: all 0.3s ease;
}

.elegant-toggler:hover {
    background-color: rgba(var(--accent-rgb, 202, 141, 151), 0.1);
}

.elegant-toggler:focus {
    box-shadow: none;
}

.elegant-toggler-icon {
    width: 22px;
    height: 18px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.elegant-toggler-icon span {
    display: block;
    height: 2px;
    width: 100%;
    background-color: var(--secondary);
    border-radius: 1px;
    transition: all 0.3s ease;
}

.elegant-toggler[aria-expanded="true"] .elegant-toggler-icon span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.elegant-toggler[aria-expanded="true"] .elegant-toggler-icon span:nth-child(2) {
    opacity: 0;
}

.elegant-toggler[aria-expanded="true"] .elegant-toggler-icon span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Mobile menu animation */
@media (max-width: 991.98px) {
    .navbar-collapse {
        position: fixed;
        top: 0;
        right: 0;
        width: 280px;
        height: 100vh;
        background-color: white;
        z-index: 1050;
        padding: 2rem 1.5rem;
        overflow-y: auto;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
    }
    
    .navbar-collapse.show {
        transform: translateX(0);
    }
    
    .navbar-nav {
        width: 100%;
    }
    
    .navbar-nav .nav-item {
        opacity: 0;
        transform: translateX(20px);
        transition: all 0.3s ease;
        transition-delay: calc(0.05s * var(--item-index, 0));
    }
    
    .navbar-collapse.show .navbar-nav .nav-item {
        opacity: 1;
        transform: translateX(0);
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        font-size: 0.95rem;
        text-align: left;
    }
    
    .navbar-nav .nav-link::before {
        content: '';
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        height: 60%;
        width: 3px;
        background-color: var(--accent);
        border-radius: 1.5px;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .navbar-nav .nav-link:hover::before,
    .navbar-nav .nav-link.active::before {
        opacity: 1;
    }
}

/* Order error notification */
.order-error {
    background-color: #fff;
    border: 1px solid rgba(132, 32, 41, 0.2);
    border-left: 4px solid #842029;
    border-radius: 20px;
    padding: 20px 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: flex-start;
}

.order-error-icon {
    color: #842029;
    font-size: 1.2rem;
    margin-right: 15px;
    margin-top: 2px;
}

.order-error-content {
    flex: 1;
}

.order-error-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #842029;
}

.order-error-message {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 12px;
}

.order-error-actions {
    margin-top: 10px;
}

.order-error-actions .btn {
    font-size: 0.75rem;
    padding: 8px 20px;
    margin-right: 10px;
}

/* Add to cart button */
.add-to-cart-btn {
    border-radius: 20px;
    padding: 10px 25px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 180px;
    letter-spacing: 0.05em;
    font-weight: 500;
    background-color: var(--primary);
    color: white;
    border: none;
}

.add-to-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    background-color: var(--primary-dark, #9a5c65);
}

.add-to-cart-btn.loading {
    opacity: 0.9;
    cursor: wait;
}

.add-to-cart-btn .spinner-border {
    margin-right: 8px;
    width: 1rem;
    height: 1rem;
}

/* Cart count badge */
.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--primary);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.3s ease;
}

/* Animation for cart count update */
@keyframes cartCountPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.cart-count-updated {
    animation: cartCountPulse 0.5s ease;
}

/* Cart item */
.cart-item {
    transition: opacity 0.3s ease;
}

.cart-item:hover {
    background-color: rgba(0, 0, 0, 0.01);
}

/* Quantity input */
.quantity-input {
    width: 70px;
    text-align: center;
    border-radius: 20px;
}

/* Remove button */
.remove-from-cart {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.remove-from-cart:hover {
    opacity: 1;
    color: #c62828;
}

/* Checkout button */
.checkout-btn {
    border-radius: 20px;
    padding: 12px 30px;
    transition: all 0.3s ease;
}

.checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Product card add to cart */
.product-card .add-to-cart-container {
    position: absolute;
    bottom: 15px;
    right: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover .add-to-cart-container {
    opacity: 1;
}

/* Product options */
.product-options {
    margin-bottom: 20px;
}

.option-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.option-select {
    border-radius: 8px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    width: 100%;
}
