/**
 * Header Icons Styles
 * 
 * @package IMTA Theme
 */

/* ========================================
   Header Icons Container
======================================== */
.imta-header-icons {
    display: flex;
    align-items: center;
}

.imta-icon-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #1a1a2e;
    transition: all 0.3s ease;
    position: relative;
    padding: 0;
    margin: 0 !important;
}

.imta-icon-link:hover {
    color: #d4af37;
    transform: scale(1.1);
}

.imta-icon-link svg {
    width: 22px;
    height: 22px;
}

/* Cart Count Badge */
.imta-cart-count {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #e74c3c;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.imta-cart-count:empty,
.imta-cart-count[data-count="0"] {
    display: none;
}

/* ========================================
   Cart Sidebar
======================================== */
.imta-cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    max-width: 90vw;
    height: 100vh;
    background: #fff;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.12);
    z-index: 99999;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.imta-cart-sidebar.active {
    right: 0;
}

/* Header */
.imta-cart-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 50px 20px 15px;
    position: relative;
}

.imta-cart-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 2px;
    color: #1a1a2e;
}

.imta-close-cart {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #999;
    transition: all 0.2s ease;
}

.imta-close-cart:hover {
    color: #1a1a2e;
}

/* Divider */
.imta-cart-divider {
    width: 40px;
    height: 2px;
    background: #ddd;
    margin: 0 auto 20px;
}

/* Cart Items */
.imta-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 0 25px;
}

.imta-cart-item {
    display: grid;
    grid-template-columns: 65px 1fr 30px;
    gap: 15px;
    align-items: start;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

.imta-cart-item:last-child {
    border-bottom: none;
}

/* Item Image */
.imta-cart-item-image {
    display: block;
}

.imta-cart-item-image img {
    width: 65px;
    height: 65px;
    object-fit: cover;
    border-radius: 4px;
}

/* Item Details */
.imta-cart-item-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.imta-cart-item-name {
    color: #1a1a2e !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    line-height: 1.4 !important;
    margin: 0px !important;
    text-align: left !important;
}

.imta-cart-item-name:hover {
    color: #d4af37;
}

.imta-cart-item-variations {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.imta-cart-variation {
    font-size: 12px;
    color: #666;
}

.imta-cart-item-price {
    font-size: 13px;
    color: #666;
    margin-top: 2px;
}

/* Remove Button */
.imta-cart-item-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    text-decoration: none;
    transition: color 0.2s ease;
    margin: 0px !important;
}

.imta-cart-item-remove:hover {
    color: #e74c3c;
}

/* Empty Cart */
.imta-cart-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

/* Footer */
.imta-cart-footer {
    padding: 20px 25px 30px;
    border-top: 1px solid #eee;
    background: #fff;
}

.imta-cart-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
}

.imta-cart-subtotal-amount {
    color: #d4af37;
}

.imta-cart-btn {
    display: block;
    width: 100%;
    padding: 9px 20px;
    text-align: center;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    border-radius: 4px;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

.imta-cart-btn:last-child {
    margin-bottom: 0;
}

.imta-cart-btn-view {
    background: #fff;
    color: #1a1a2e;
    border: 2px solid #1a1a2e;
}

.imta-cart-btn-view:hover {
    background: #1a1a2e;
    color: #fff;
}

.imta-cart-btn-checkout {
    background: #1a1a2e;
    color: #fff !important;
    border: 2px solid #1a1a2e;
}

.imta-cart-btn-checkout:hover {
    background: #d4af37;
    border-color: #d4af37;
}

/* ========================================
   Cart Overlay
======================================== */
.imta-cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    z-index: 99998;
    transition: all 0.3s ease;
}

.imta-cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Body Scroll Lock */
body.cart-sidebar-open {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Desktop: show button, hide link */
.imta-cart-desktop {
    display: flex;
}

.imta-cart-mobile {
    display: none;
}

@media (max-width: 1024px) {

    .imta-cart-sidebar,
    .imta-cart-overlay {
        display: none !important;
    }

    /* Tablet/Mobile: hide button, show link */
    .imta-cart-desktop {
        display: none !important;
    }

    .imta-cart-mobile {
        display: flex !important;
    }
}

/* ========================================
   Mobile Responsive
======================================== */
@media (max-width: 576px) {
    .imta-header-icons {
        gap: 15px;
    }

    .imta-icon-link {
        width: 36px;
        height: 36px;
    }

    .imta-icon-link svg {
        width: 20px;
        height: 20px;
    }

    .imta-cart-sidebar {
        width: 100%;
        max-width: 100%;
    }
}