/* ══════════════════════════════════════════════
   ENHANCED MINI-CART — Spark WoodMart Toolkit
   No hardcoded colours — inherits from WoodMart theme settings
   ══════════════════════════════════════════════ */

/* ── Wider side drawer ── */
.cart-widget-side {
    width: 480px !important;
    max-width: 90vw;
}

/* ── Cart buttons: SAME ROW ──
   WoodMart markup:
   <p class="woocommerce-mini-cart__buttons buttons">
     <a class="button btn btn-default btn-cart wc-forward">View cart</a>
     <a class="button checkout wc-forward">Checkout</a>
   </p>
*/
.woocommerce-mini-cart__buttons.buttons,
p.woocommerce-mini-cart__buttons.buttons {
    display: flex !important;
    flex-direction: row !important;
    gap: 8px;
}

.woocommerce-mini-cart__buttons .button.btn-cart,
.woocommerce-mini-cart__buttons .button.checkout {
    flex: 1 !important;
    text-align: center !important;
    white-space: nowrap;
}


/* ═══════════════════════════════════════════════
   RELATED PRODUCTS — LEFT SIDE PANEL
   Slides in from the left, adjacent to the cart
   ═══════════════════════════════════════════════ */
.swmt-related-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    max-width: 80vw;
    height: 100vh;
    z-index: 350;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;

    /* Inherit theme background — fallback to white */
    background: inherit;
    background-color: var(--wd-side-bg, #fff);
    color: inherit;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
}

.swmt-related-panel.swmt-panel-open {
    transform: translateX(0);
}

.swmt-related-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(128, 128, 128, 0.12);
    flex-shrink: 0;
}

.swmt-related-panel__title {
    font-size: 15px;
    font-weight: 600;
}

.swmt-related-panel__close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: inherit;
    opacity: 0.5;
    padding: 4px;
    line-height: 1;
    transition: opacity 0.2s;
}

.swmt-related-panel__close:hover {
    opacity: 1;
}

.swmt-related-panel__body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    scrollbar-width: thin;
}

/* ── Related product card (vertical, like Glozin) ── */
.swmt-rp-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.swmt-rp-card__image {
    display: block;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
}

.swmt-rp-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.swmt-rp-card:hover .swmt-rp-card__image img {
    transform: scale(1.03);
}

.swmt-rp-card__info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: center;
}

.swmt-rp-card__name {
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    color: inherit;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.swmt-rp-card__name:hover {
    opacity: 0.7;
}

.swmt-rp-card__price {
    font-size: 13px;
    opacity: 0.7;
}

.swmt-rp-card__price del {
    opacity: 0.4;
    font-size: 12px;
}

.swmt-rp-card__price ins {
    text-decoration: none;
    font-weight: 600;
    opacity: 1;
}

.swmt-rp-card__add {
    display: block;
    margin-top: 4px;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: inherit;
    background: transparent;
    border: 1px solid rgba(128, 128, 128, 0.25);
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    line-height: 1.6;
    transition: all 0.2s ease;
}

.swmt-rp-card__add:hover {
    border-color: currentColor;
    opacity: 0.8;
}

.swmt-rp-card__add.loading::after {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    border: 1.5px solid rgba(128, 128, 128, 0.3);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: swmtSpin 0.5s linear infinite;
    margin-left: 6px;
    vertical-align: middle;
}

@keyframes swmtSpin {
    to { transform: rotate(360deg); }
}


/* ── UTILITY ICONS BAR ── */
.swmt-cart-utilities {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 10px 20px;
    border-top: 1px solid rgba(128, 128, 128, 0.1);
    border-bottom: 1px solid rgba(128, 128, 128, 0.1);
}

.swmt-cart-util-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 14px;
    background: transparent;
    border: 1px solid rgba(128, 128, 128, 0.15);
    border-radius: 6px;
    color: inherit;
    opacity: 0.5;
    cursor: pointer;
    font-size: 11px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.swmt-cart-util-btn:hover,
.swmt-cart-util-btn.active {
    opacity: 0.9;
    border-color: rgba(128, 128, 128, 0.35);
}

/* ── EXPANDABLE PANELS ── */
.swmt-cart-panel {
    padding: 10px 20px 12px;
    border-bottom: 1px solid rgba(128, 128, 128, 0.1);
    animation: swmtSlideDown 0.2s ease;
}

@keyframes swmtSlideDown {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.swmt-cart-panel textarea,
.swmt-cart-panel input[type="text"] {
    width: 100%;
    padding: 8px 10px;
    font-size: 13px;
    font-family: inherit;
    color: inherit;
    background: rgba(128, 128, 128, 0.06);
    border: 1px solid rgba(128, 128, 128, 0.2);
    border-radius: 6px;
    resize: none;
    transition: border-color 0.2s ease;
}

.swmt-cart-panel textarea:focus,
.swmt-cart-panel input[type="text"]:focus {
    outline: none;
    border-color: rgba(128, 128, 128, 0.5);
}

.swmt-coupon-row {
    display: flex;
    gap: 6px;
}

.swmt-coupon-row input { flex: 1; }

.swmt-cart-panel__save {
    margin-top: 6px;
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 600;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: inherit;
    background: rgba(128, 128, 128, 0.1);
    border: 1px solid rgba(128, 128, 128, 0.2);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.swmt-coupon-row .swmt-cart-panel__save {
    margin-top: 0;
    white-space: nowrap;
}

.swmt-cart-panel__save:hover {
    background: rgba(128, 128, 128, 0.2);
}

/* ── Responsive ── */
@media (max-width: 520px) {
    .cart-widget-side {
        width: 100% !important;
    }
    .swmt-related-panel {
        width: 260px;
    }
}
