/* Easy Sticky Footer Cart - Premium Luxury Dark/Gold Theme v3.1 */

:root {
    --luxury-dark: #222222;      /* Soft, deep dark grey */
    --luxury-gold: #c0a16b;      /* Muted champagne gold */
    --luxury-gold-hover: #d3b88a; /* Lighter gold for hover */
    --luxury-text: #4a4a4a;      /* Soft text color */
    --luxury-border: #f0f0f0;   /* Very light border */
    --luxury-white: #ffffff;
    --font-heading: 'Lora', serif;
    --font-body: 'Montserrat', sans-serif;
}

/* Base Wrapper */
.esfc-wrapper {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--luxury-white);
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.1);
    z-index: 99999;
    transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform: translateY(100%); /* Hidden by default */
    border-top: 1px solid var(--luxury-border);
    font-family: var(--font-body);
    color: var(--luxury-text);
}

.esfc-wrapper:not(.is-empty) {
    transform: translateY(0); 
}

.esfc-wrapper.is-empty {
    transform: translateY(100%);
    visibility: hidden;
    transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1), visibility 0.5s;
}
.esfc-wrapper.is-empty .esfc-header { cursor: default; }
.esfc-wrapper.is-empty .esfc-toggle-button,
.esfc-wrapper.is-empty .esfc-content { display: none; }


/* Header Bar (always visible) */
.esfc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 25px;
    background: var(--luxury-dark);
    color: var(--luxury-white);
    cursor: pointer;
    font-size: 1.05em;
    font-weight: 500;
    transition: background-color 0.3s ease;
    position: relative; 
    z-index: 2; 
}

.esfc-wrapper.is-open .esfc-header {
    border-bottom: 1px solid var(--luxury-dark);
}
.esfc-header:hover {
    background: #333; /* Slightly lighter dark on hover */
}
.esfc-wrapper.is-empty .esfc-header:hover {
    background: var(--luxury-dark);
}

.esfc-header .esfc-cart-icon svg {
    stroke: var(--luxury-gold); /* Gold Icon */
    stroke-width: 1.5px;
}
.esfc-header .esfc-cart-summary {
    flex-grow: 1;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 10px;
}
.esfc-toggle-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.esfc-toggle-button svg {
    stroke: var(--luxury-gold); /* Gold Icon */
}
.esfc-wrapper.is-open .esfc-toggle-button {
    transform: rotate(180deg);
}


/* Animation: Cart Content Area */
.esfc-content {
    padding: 25px 30px;
    max-height: 0;
    overflow-y: auto;
    background: var(--luxury-white);
    opacity: 0;
    visibility: hidden;
    transition: max-height 0.4s ease-out, opacity 0.3s ease-in, padding-top 0.4s ease-out, padding-bottom 0.4s ease-out;
}
.esfc-wrapper.is-open .esfc-content {
    max-height: 350px; 
    opacity: 1;
    visibility: visible;
    transition: max-height 0.5s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.4s ease-in 0.1s, padding-top 0.5s ease-out, padding-bottom 0.5s ease-out;
}
.esfc-content {
    padding-top: 0;
    padding-bottom: 0;
}
.esfc-wrapper.is-open .esfc-content {
    padding-top: 25px;
    padding-bottom: 25px;
}

.esfc-content-title {
    font-family: var(--font-heading);
    font-size: 1.6em;
    font-weight: 600;
    color: var(--luxury-dark);
    text-align: left;
    margin-top: 0;
    margin-bottom: 20px;
}

/* Mini Cart List */
.woocommerce-mini-cart-list {
    list-style: none;
    margin: 0 0 20px 0;
    padding: 0;
}

.woocommerce-mini-cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0 15px 35px; /* Increase padding for remove button */
    border-bottom: 1px solid var(--luxury-border);
    font-size: 0.95em;
    position: relative; /* For remove button positioning */
    
    /* Animation: Staggered Item Fade-in */
    opacity: 0;
    transform: translateX(10px);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}
.woocommerce-mini-cart-item:last-child {
    border-bottom: none;
}

/* Staggered animation */
.esfc-wrapper.is-open .woocommerce-mini-cart-item {
    opacity: 1;
    transform: translateX(0);
}
.esfc-wrapper.is-open .woocommerce-mini-cart-item:nth-child(1) { transition-delay: 0.1s; }
.esfc-wrapper.is-open .woocommerce-mini-cart-item:nth-child(2) { transition-delay: 0.15s; }
.esfc-wrapper.is-open .woocommerce-mini-cart-item:nth-child(3) { transition-delay: 0.2s; }
/* ...and so on */

/* --- NEW: Remove Button Style --- */
.esfc_remove_button {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    text-decoration: none;
    line-height: 1;
    
    /* Circular button style */
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--luxury-border);
    background: var(--luxury-white);
    
    transition: all 0.2s ease-out;
}
.esfc_remove_button svg {
    stroke: #aaa; /* Default color of 'x' */
    transition: stroke 0.2s ease-out;
}

.esfc_remove_button:hover {
    border-color: var(--luxury-gold);
    background: var(--luxury-gold);
    transform: translateY(-50%) scale(1.05); /* Slight pop effect */
}
.esfc_remove_button:hover svg {
    stroke: var(--luxury-white); /* White 'x' on gold background */
}
/* --- End NEW --- */


.woocommerce-mini-cart-item .item-details {
    flex: 1;
    text-align: left;
    padding-right: 15px;
    overflow: hidden;
    min-width: 0;
}

.woocommerce-mini-cart-item .item-details a {
    text-decoration: none;
    font-weight: 600;
    color: var(--luxury-text);
    transition: color 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}
.woocommerce-mini-cart-item .item-details a:hover {
    color: var(--luxury-gold);
}

.woocommerce-mini-cart-item .item-details small {
    display: block;
    color: #888;
    margin-top: 4px;
    font-size: 0.9em;
}

.woocommerce-mini-cart-item .item-price {
    font-weight: 500;
    padding-left: 15px;
    color: var(--luxury-text);
    text-align: right;
    white-space: nowrap; 
}

/* Subtotal */
.woocommerce-mini-cart__total {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-heading);
    font-size: 1.3em;
    font-weight: 600;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--luxury-border);
    color: var(--luxury-dark);
    opacity: 0;
    transition: opacity 0.3s ease-in;
}
.esfc-wrapper.is-open .woocommerce-mini-cart__total {
    opacity: 1;
    transition-delay: 0.2s;
}


/* --- NEW: Checkout Button Style (Outline) --- */
.woocommerce-mini-cart__buttons {
    display: flex;
    justify-content: center;
    padding-top: 25px;
    opacity: 0;
    transition: opacity 0.3s ease-in;
}
.esfc-wrapper.is-open .woocommerce-mini-cart__buttons {
    opacity: 1;
    transition-delay: 0.25s;
}

.woocommerce-mini-cart__buttons .button.checkout {
    background: transparent; /* Outline style */
    color: var(--luxury-gold) !important; /* Gold text */
    border: 2px solid var(--luxury-gold); /* Gold border */
    width: 100%;
    padding: 16px 30px;
    border-radius: 8px; 
    text-decoration: none;
    font-family: var(--font-body);
    font-size: 1.1em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    transition: all 0.3s ease;
    box-shadow: none; /* No shadow on outline */
    text-align: center;
}

.woocommerce-mini-cart__buttons .button.checkout:hover {
    background: var(--luxury-gold); /* Solid on hover */
    color: var(--luxury-white) !important; /* White text on hover */
    box-shadow: 0 4px 15px rgba(192, 161, 107, 0.4); /* Gold shadow on hover */
    transform: translateY(-2px);
}
/* --- End NEW --- */


/* Empty cart message in content area */
.esfc-content p {
    text-align: center;
    color: #777;
    margin: 20px 0;
}

/* Animation: Pulse on cart update */
@keyframes esfc-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(192, 161, 107, 0.7); /* Gold Pulse */
    }
    70% {
        box-shadow: 0 0 0 10px rgba(192, 161, 107, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(192, 161, 107, 0);
    }
}

.esfc-wrapper.esfc-updated .esfc-header {
    animation: esfc-pulse 1s ease-out;
}


/* Responsive adjustments */
@media (max-width: 768px) {
    .esfc-header {
        padding: 15px 20px;
        font-size: 0.9em; 
    }
    .esfc-content {
        padding-left: 20px;
        padding-right: 20px;
    }
    .esfc-wrapper.is-open .esfc-content {
        max-height: 280px;
        padding-top: 20px;
        padding-bottom: 20px;
    }
    .esfc-content-title {
        font-size: 1.4em;
    }
    .woocommerce-mini-cart__total {
        font-size: 1.15em;
    }
    .woocommerce-mini-cart__buttons .button.checkout {
        font-size: 1em;
        padding: 14px 20px;
    }
    
    .woocommerce-mini-cart-item {
        padding-left: 30px; 
    }
    .esfc_remove_button {
        width: 22px; /* Slightly smaller on mobile */
        height: 22px;
    }
     .esfc_remove_button svg {
        width: 12px;
        height: 12px;
     }
}