/**
 * LM Mini-Cart Side Panel Styles
 * Panel opens from right when cart icon is clicked
 * Uses custom mini-cart template (woocommerce/cart/mini-cart.php)
 * with clean <div> BEM structure — no WC ul/li conflicts
 */

/* ===== Panel Wrapper ===== */
.lm-cart-panel-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100%;
    z-index: 99999;
    pointer-events: none;
}

.lm-cart-panel-wrapper.is-open {
    pointer-events: auto;
}

/* ===== Overlay ===== */
.lm-cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100%;
    background-color: transparent;
    transition: background-color 0.4s, transform 0s 0.4s;
    transform: scale(0);
}

.lm-cart-panel-wrapper.is-open .lm-cart-overlay {
    background-color: rgba(0, 0, 0, 0.25);
    transform: scale(1);
    transition: background-color 0.4s, transform 0s;
}

/* ===== Side Panel ===== */
.lm-cart-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 350px;
    background: #fff;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
    transform: translateX(100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
}

.lm-cart-panel-wrapper.is-open .lm-cart-panel {
    transform: translateX(0);
    opacity: 1;
}

/* ===== Panel Header ===== */
.lm-cart-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #d5d8dc;
    flex-shrink: 0;
}

.lm-cart-panel__title {
    font-size: 16px;
    font-weight: 600;
    color: #0A2540;
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* CLAUDE: I have modified the block below to contain important - and no width. This is working perfect. please do not modify it */
.lm-cart-panel__close {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    background: none;
    border: none !important;
    cursor: pointer;
    color: #696969;
    padding: 0;
    transition: color 0.3s ease;
}

.lm-cart-panel__close:hover {
    color: #0A2540;
}

/* ===== Panel Content ===== */
.lm-cart-panel__content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.lm-cart-panel__empty {
    padding: 40px 24px;
    text-align: center;
    color: #696969;
    font-size: 14px;
    margin: 0;
}

/* ===== Panel Footer ===== */
.lm-cart-panel__footer {
    padding: 20px 24px;
    border-top: 1px solid #d5d8dc;
    flex-shrink: 0;
    display: flex;
    gap: 10px;
}

.lm-cart-panel__footer .lm-button {
    flex: 1;
    text-align: center;
}

/* ========================================
   Mini-Cart Items (custom div template)
   ======================================== */

.lm-minicart-items {
    margin: 0;
    padding: 0;
}

/* ===== Cart Item ===== */
.lm-minicart-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 24px;
    border-bottom: 1px solid #eee;
}

.lm-minicart-item:last-child {
    border-bottom: none;
}

/* Product image */
.lm-minicart-item__image {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
}

.lm-minicart-item__image a {
    display: block;
}

.lm-minicart-item__image img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

/* Product info (name + meta + price) */
.lm-minicart-item__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lm-minicart-item__name {
    font-size: 13px;
    font-weight: 500;
    color: #0A2540;
    text-decoration: none;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

a.lm-minicart-item__name:hover {
    color: #A28573;
}

.lm-minicart-item__meta {
    font-size: 11px;
    color: #888;
    line-height: 1.3;
}

/* Each dt/dd pair on its own line */
.lm-minicart-item__meta dl {
    margin: 0;
    padding: 0;
}

.lm-minicart-item__meta dt {
    display: inline;
    font-weight: 600;
    margin: 0;
    padding: 0;
    font-size: 11px;
    color: #666;
}

.lm-minicart-item__meta dd {
    display: inline;
    margin: 0 0 0 2px;
    padding: 0;
    font-size: 11px;
}

/* Force line break after each dd (new line per option) */
.lm-minicart-item__meta dd::after {
    content: '';
    display: block;
}

.lm-minicart-item__meta dd p {
    display: inline;
    margin: 0;
}

/* Variation attribute labels (rendered directly, not via dl/dt) */
.lm-minicart-meta__label {
    font-weight: 600;
    color: #666;
}

.lm-minicart-item__price {
    font-size: 12px;
    font-weight: 600;
    color: #A28573;
    margin-top: 2px;
}

/* ===== Remove (trash) button ===== */
.lm-minicart-item__remove {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: #999 !important;
    text-decoration: none;
    transition: all 0.2s ease;
}

.lm-minicart-item__remove:hover {
    background: #fef2f2 !important;
    color: #c0392b !important;
}

.lm-minicart-item__remove svg {
    display: block;
}

/* ===== Subtotal / Total Line ===== */
.lm-minicart-total {
    padding: 14px 24px;
    border-top: 1px solid #d5d8dc;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    color: #0A2540;
    margin: 0;
}

.lm-minicart-total .woocommerce-Price-amount {
    color: #A28573;
    font-size: 15px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .lm-cart-panel {
        width: 300px;
    }

    .lm-cart-panel__header,
    .lm-cart-panel__footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .lm-minicart-item {
        padding: 12px 16px;
        gap: 12px;
    }

    .lm-minicart-item__image,
    .lm-minicart-item__image img {
        width: 42px;
        height: 42px;
    }

    .lm-minicart-total {
        padding-left: 16px;
        padding-right: 16px;
    }
}
