/* Shopping Cart Styles */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    width: 100vw;
    height: 100vh;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.cart-overlay.show {
    display: flex;
    opacity: 1;
    align-items: center;
    justify-content: center;
}

.cart-container {
    background: rgba(44, 44, 44, 0.98);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 24px;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 40px;
    transform: scale(0.8) translateY(40px);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
    position: relative;
    margin: 30px auto;
}

.cart-overlay.show .cart-container {
    transform: scale(1) translateY(0);
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(212, 175, 55, 0.2);
}

.cart-header h2 {
    font-family: 'Cinzel', serif;
    font-size: 2.2rem;
    background: linear-gradient(135deg, #D4AF37, #B8860B);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.cart-close {
    background: none;
    border: none;
    color: #F8F6F0;
    font-size: 2.5rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-close:hover {
    background: rgba(212, 175, 55, 0.2);
    transform: rotate(90deg) scale(1.1);
    color: #D4AF37;
}

.cart-items {
    min-height: 200px;
    margin-bottom: 30px;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 16px;
    margin-bottom: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cart-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(212, 175, 55, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid rgba(212, 175, 55, 0.2);
    transition: all 0.3s ease;
}

.cart-item:hover .cart-item-image {
    border-color: rgba(212, 175, 55, 0.6);
    transform: scale(1.05);
}

.cart-item-details {
    flex: 1;
}

.cart-item-name {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: #F8F6F0;
    margin-bottom: 8px;
    letter-spacing: 0.01em;
}

.cart-item-info {
    color: #A5A5A5;
    font-size: 0.95rem;
    font-weight: 400;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 30px;
    padding: 8px;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.quantity-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #D4AF37, #B8860B);
    color: #2C2C2C;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover {
    background: linear-gradient(135deg, #B8860B, #D4AF37);
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.quantity-display {
    min-width: 30px;
    text-align: center;
    color: #F8F6F0;
    font-weight: 600;
    font-size: 1.1rem;
}

.item-price {
    color: #D4AF37;
    font-weight: 700;
    font-size: 1.2rem;
    min-width: 80px;
    text-align: right;
    font-family: 'Cinzel', serif;
}

.remove-item {
    background: linear-gradient(135deg, #8B0000, #722F37);
    border: none;
    color: white;
    padding: 10px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.remove-item:hover {
    background: linear-gradient(135deg, #722F37, #8B0000);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 0, 0, 0.3);
}

.cart-empty {
    text-align: center;
    color: #6B6B6B;
    font-style: italic;
    padding: 60px 20px;
    font-size: 1.1rem;
}

.cart-summary {
    border-top: 2px solid rgba(212, 175, 55, 0.2);
    padding-top: 25px;
    margin-top: 25px;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 25px;
    color: #F8F6F0;
    font-family: 'Cinzel', serif;
}

.total-amount {
    color: #D4AF37;
    font-size: 1.6rem;
}

.cart-actions {
    display: flex;
    gap: 20px;
}

.cart-btn {
    flex: 1;
    padding: 18px 25px;
    border: none;
    border-radius: 30px;
    font-family: 'Cinzel', serif;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    overflow: hidden;
}

.cart-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.cart-btn:hover::before {
    left: 100%;
}

.cart-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.checkout-btn {
    background: linear-gradient(135deg, #D4AF37, #B8860B);
    color: #2C2C2C;
}

.checkout-btn:hover {
    background: linear-gradient(135deg, #B8860B, #D4AF37);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
}

.clear-cart-btn {
    background: transparent;
    border: 2px solid #8B0000;
    color: #8B0000;
}

.clear-cart-btn:hover {
    background: #8B0000;
    color: #F8F6F0;
    border-color: #8B0000;
}

.cart-icon {
    position: relative;
    cursor: pointer;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #8B0000;
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    border: 2px solid #D4AF37;
}

.stock-warning {
    color: #D4AF37;
    font-size: 0.8rem;
    margin-top: 5px;
    font-weight: 500;
}

.out-of-stock {
    color: #8B0000;
    font-weight: 700;
}

/* Order Details Modal */
.order-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(20px);
    z-index: 10001;
    display: none;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    align-items: center;
    justify-content: center;
}

.order-modal.show {
    display: flex;
    opacity: 1;
}

.order-content {
    background: rgba(44, 44, 44, 0.98);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 20px;
    padding: 40px;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    transform: scale(0.8) translateY(40px);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}

.order-modal.show .order-content {
    transform: scale(1) translateY(0);
}

.order-content h3 {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    background: linear-gradient(135deg, #D4AF37, #B8860B);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 25px;
    text-align: center;
    font-weight: 700;
}

.order-details {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 15px;
    padding: 25px;
    margin: 25px 0;
    white-space: pre-line;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.2rem;
    line-height: 1.6;
    color: #F8F6F0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cart-container {
        width: 95%;
        padding: 30px 20px;
        border-radius: 20px;
        max-height: calc(100vh - 40px);
        margin: 20px auto;
    }

    .cart-header h2 {
        font-size: 1.8rem;
    }

    .cart-item {
        flex-direction: column;
        text-align: center;
        gap: 15px;
        padding: 20px 15px;
    }

    .cart-item-controls {
        justify-content: center;
        width: 100%;
    }

    .cart-actions {
        flex-direction: column;
        gap: 15px;
    }

    .order-content {
        padding: 30px 20px;
    }

    .order-content h3 {
        font-size: 2rem;
    }
}

/* Apple Device Specific Styles */
@supports (-webkit-touch-callout: none) {
    .cart-overlay {
        background: rgba(26, 26, 26, 0.98);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        position: fixed;
        width: 100vw;
        height: 100vh;
        top: 0;
        left: 0;
        z-index: 10001;
    }

    .cart-overlay.show {
        display: flex !important;
        opacity: 1 !important;
        visibility: visible;
        pointer-events: all;
    }

    .cart-container {
        position: relative;
        background: rgba(44, 44, 44, 0.99);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 2px solid rgba(212, 175, 55, 0.4);
        max-height: 90vh;
        overflow-y: scroll;
        -webkit-overflow-scrolling: touch;
        border-radius: 20px;
    }
}

/* iOS Safari specific fixes */
@media screen and (-webkit-min-device-pixel-ratio: 2) {
    .cart-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        z-index: 999999;
        background: rgba(26, 26, 26, 0.97);
    }

    .cart-overlay.show {
        display: flex !important;
        align-items: center;
        justify-content: center;
        opacity: 1 !important;
        visibility: visible;
    }

    .cart-container {
        transform: none !important;
        opacity: 1 !important;
        visibility: visible;
        position: relative;
        z-index: 1000000;
    }
}

/* iPhone specific adjustments */
@media only screen 
    and (device-width: 375px) 
    and (device-height: 812px) 
    and (-webkit-device-pixel-ratio: 3) {
    .cart-overlay {
        height: 100vh;
        height: -webkit-fill-available;
    }
    
    .cart-container {
        max-height: 80vh;
        max-height: -webkit-fill-available;
        padding: 20px 15px;
    }
}