/* ------------------------------------------- */
/* Cart Overlay Styles (FINAL LAYOUT) */
/* ------------------------------------------- */

.cart-overlay {
    display: none; /* Keep hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: flex; 
    justify-content: center;
    align-items: flex-start;
    padding-top: 100px;
}

.cart-content {
    background: var(--dark-gray);
    border: 1px solid var(--gold);
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    padding: 20px;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    padding-bottom: 10px;
}

.cart-title {
    font-family: 'Cinzel', serif;
    color: var(--gold);
    font-size: 1.5rem;
}

.close-cart {
    background: none;
    border: none;
    color: var(--light-text);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
    padding: 0;
}

.close-cart:hover {
    color: var(--gold);
}

.cart-items {
    margin-bottom: 20px;
}

/* ------------------------------------------------------------------ */
/* Cart Item - Two-Column Layout */
/* ------------------------------------------------------------------ */
.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0; /* Ensures vertical spacing for 80px image */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Left Side: Image and Details (Row Layout) */
.item-visuals-and-details {
    display: flex;
    align-items: center;
    flex-grow: 1; 
}

/* Image Container (Guarantees image size) */
.item-image-container {
    flex-shrink: 0; 
    margin-right: 20px;
    width: 100px;  /* 🎉 IMAGE SIZE FIXED HERE */
    height: 100px; 
    overflow: hidden;
    border-radius: 5px; 
    border: 1px solid var(--gold); /* Border highlight for the image */
}

.item-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Item Details (Text Area) */
.item-details {
    /* No flex-grow needed here */
}

.item-name {
    font-weight: 500;
    margin-bottom: 3px;
}

/* Right Side: Controls (Column Layout) */
.item-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-end; /* Aligns all content to the right edge */
    justify-content: space-between; /* Space out the 3 elements vertically */
    min-width: 110px;
    height: 80px; /* Matches the image height */
    flex-shrink: 0;
    margin-left: 10px;
}

/* Quantity controls (remains a row inside the column) */
.item-quantity {
    display: flex;
    align-items: center;
    margin: 0;
}

.quantity-btn {
    background: var(--dark-bg);
    border: 1px solid var(--gold);
    color: var(--gold);
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.quantity-btn:hover {
    background: var(--gold);
    color: var(--dark-bg);
}

.quantity-value {
    margin: 0 10px;
    min-width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.item-price {
    color: var(--gold);
    font-weight: 600;
    font-size: 1.1rem;
}

/* ------------------------------------------------------------------ */
/* End Cart Item Styles */
/* ------------------------------------------------------------------ */

.cart-summary {
    /* This section is already on its own div, separating the total and button */
    border-top: 1px solid rgba(212, 175, 55, 0.3);
    padding-top: 15px;
    display: flex; /* Since the JS sets it to display: flex when items are present */
    flex-direction: column;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.total-label {
    font-weight: 500;
}

.total-amount {
    color: var(--gold);
    font-weight: 600;
}

.checkout-btn {
    background: var(--gold);
    color: var(--dark-bg);
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    width: 100%;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.checkout-btn:hover {
    background: #b8941f;
    transform: translateY(-2px);
}

.empty-cart-message {
    text-align: center;
    padding: 30px 0;
    color: #888;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Overlays (General Styles) */
.loginoverlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    justify-content: center;
    align-items: center;
}