/* Elixir Cart Styles */

:root {
    --brand-color: #DCA54A;
    --alt-brand-color: #D09A40;
    --heading-color: #0F172A;
    --text-color: #4A4A4A;
    --primary-color: #FFFFFF;
    --secondary-color: #FAF5E5;
    --border-color: #141004;
    --subtle-bg-color: #D09A40;
    --extra-color: #222222;
    --primary-border-color: #711514;
    --secondary-bg-color: #711514;
    --secondary-border-color: #711514;
    --green-primary: #6aac54;
    --green-secondary: #e8f1e4;
}

body {
    font-family: 'Helvetica', sans-serif;
    font-size: 1rem;
    color: var(--text-color);
}

h1, h2, h3, h4, h5 {
    color: var(--heading-color);
}

h1 { font-size: 1.4rem; line-height: 1.3em; }
h2 { font-size: 1.3rem; line-height: 1.3em; }
h3 { font-size: 1.2rem; line-height: 1.2em; }
h4 { font-size: 1.1rem; line-height: 1.2em; }

.elixir-cart-container {
    display: grid;
    grid-template-columns: 1fr; /* Single column for mobile-first approach */
    gap: 1rem;
}

/* Two-column layout for larger screens */
@media (min-width: 992px) {
    .elixir-cart-container {
        grid-template-columns: 2fr 1fr;
        align-items: start; /* Align grid items to the top */
    }
}

.elixir-cart-main {
    /* This is the main content area for cart items */
}

.elixir-cart-sidebar {
    /* This is the sidebar for cart totals */
    position: sticky;
    top: 2rem; /* Makes the sidebar stick on scroll */
}

.elixir-cart-form {
    /* No longer needs flex properties */
}

.elixir-cart-item {
    background: var(--primary-color);
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(220, 165, 74, 0.15);
    border-left: 4px solid var(--brand-color);
    margin-bottom: 1.5rem;
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 1rem;
    transition: all 0.3s ease;
}

.elixir-cart-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(220, 165, 74, 0.2);
}

.elixir-item-col-1 {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.product-thumbnail {
    max-width: 150px;
    border-radius: 8px;
    overflow: hidden;
}

.product-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}

.elixir-item-col-2 {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.product-name a {
    color: var(--heading-color);
    text-decoration: none;
    font-weight: bold;
    font-size: 1rem;
}

.product-price-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.product-quantity-multiplier {
    color: var(--text-color);
}

.product-subtotal {
    font-weight: bold;
    color: var(--brand-color);
    margin-left: auto;
}

.product-stock-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
}

.product-stock-status {
    font-size: 0.9rem;
    font-style: italic;
}

.product-stock-status .in-stock {
    color: var(--green-primary);
}

.product-stock-status .out-of-stock {
    color: var(--primary-border-color);
}

.product-subtotal {
    font-weight: bold;
    color: var(--brand-color);
    font-size: 1rem;
}

.product-remove .remove {
    color: var(--primary-border-color);
    text-decoration: none;
    font-size: 1.5rem;
    line-height: 1;
}

.cart-collaterals {
    /* Layout is now handled by the grid container */
}

.cart_totals {
    background: var(--secondary-color);
    padding: 8px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(220, 165, 74, 0.15);
    border-left: 1px solid var(--brand-color);
    margin: 1px;
}

.cart_totals .calculated_shipping {
    margin: 1px;
}

.elixir-cart-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
}

.elixir-cart-actions .coupon {
    display: flex;
    gap: 0.5rem;
}

.elixir-cart-actions .button {
    background-color: var(--green-primary);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.elixir-cart-actions .button:hover {
    background-color: #5a9a48;
}

/* Responsive adjustments */
@media (max-width: 767px) {
    .elixir-cart-item {
        grid-template-columns: 100px 1fr;
        gap: 1rem;
    }

    .elixir-item-col-1 {
        align-items: center;
    }

    .elixir-item-col-2 {
        gap: 1rem;
    }

    .product-price-row {
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .product-subtotal {
        margin-left: 0;
        text-align: left;
    }

    .product-stock-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

@media screen and (min-width: 922px) {
    .woocommerce #ast-cart-wrapper .ast-cart-non-sticky {
        width: 100%;
    }

    #ast-cart-wrapper .woocommerce .cart-collaterals {
        display: none;
    }
}
