/**
 * Mini Cart Drawer Styles for Titan Fitnes Theme
 * Slide-out cart from right side
 * 
 * @package Titan_Fitnes
 * @since 1.0.0
 */

/* ============================
   CART OVERLAY
   ============================ */

   .titan-cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(4px);
}

.titan-cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ============================
   CART DRAWER
   ============================ */

.titan-cart-drawer {
    position: fixed;
    top: 0;
    right: -450px;
    width: 450px;
    height: 100vh;
    background-color: #0a0a0a;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.8);
    transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-left: 2px solid rgba(198, 255, 10, 0.2);
}

.titan-cart-drawer.active {
    right: 0;
}

/* ============================
   CART HEADER
   ============================ */

.titan-mini-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 25px 30px;
    background: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 100%);
    border-bottom: 2px solid var(--titan-primary);
}

.mini-cart-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Montserrat', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.mini-cart-title svg {
    color: var(--titan-primary);
    flex-shrink: 0;
}

.mini-cart-title .cart-count {
    font-size: 14px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.6);
    margin-left: 5px;
}

.titan-cart-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border-radius: 6px;
}

.titan-cart-close:hover {
    background-color: rgba(198, 255, 10, 0.1);
    color: var(--titan-primary);
    transform: rotate(90deg);
}

/* ============================
   CART ITEMS
   ============================ */

.titan-mini-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 20px 30px;
}

/* Custom Scrollbar */
.titan-mini-cart-items::-webkit-scrollbar {
    width: 8px;
}

.titan-mini-cart-items::-webkit-scrollbar-track {
    background: #0f0f0f;
}

.titan-mini-cart-items::-webkit-scrollbar-thumb {
    background: var(--titan-primary);
    border-radius: 4px;
}

.titan-mini-cart-items::-webkit-scrollbar-thumb:hover {
    background: #d4e600;
}

.woocommerce-mini-cart.cart_list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.woocommerce-mini-cart-item {
    display: flex !important;
    gap: 15px;
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    transition: all 0.3s ease;
    align-items: flex-start;
}

.woocommerce-mini-cart-item:hover {
    background-color: rgba(198, 255, 10, 0.03);
    padding-left: 10px;
    padding-right: 10px;
    border-radius: 8px;
}

.mini-cart-item-image {
    flex: 0 0 80px;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    background-color: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.mini-cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mini-cart-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    min-width: 0;
}

/* Ensure all children are properly positioned */
.mini-cart-item-details > * {
    position: static !important;
}

.mini-cart-item-name {
    font-family: 'Sofia Sans', sans-serif;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
}

.mini-cart-item-name a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.mini-cart-item-name a:hover {
    color: var(--titan-primary);
}

.mini-cart-item-quantity {
    font-family: 'Sofia Sans', sans-serif;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Quantity Controls */
.quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quantity-controls input.qty {
    width: 50px;
    height: 32px;
    padding: 5px 10px;
    text-align: center;
    background-color: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 14px;
    border-radius: 4px;
    font-family: 'Sofia Sans', sans-serif;
}

.quantity-controls .quantity-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    background-color: rgba(198, 255, 10, 0.1);
    border: 1px solid rgba(198, 255, 10, 0.3);
    color: var(--titan-primary);
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.quantity-controls .quantity-btn:hover {
    background-color: var(--titan-primary);
    border-color: var(--titan-primary);
    color: #000;
}

.quantity-controls .quantity-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.item-price {
    font-size: 15px;
    color: var(--titan-primary);
    font-weight: 700;
}

.mini-cart-item-remove {
    flex: 0 0 auto;
    align-self: flex-start;
}

.mini-cart-item-remove .remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background-color: rgba(255, 59, 48, 0.1);
    color: #ff3b30;
    text-decoration: none;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    transition: all 0.3s ease;
}

.mini-cart-item-remove .remove:hover {
    background-color: #ff3b30;
    color: #fff;
    transform: rotate(90deg);
}

/* ============================
   CART FOOTER
   ============================ */

.titan-mini-cart-footer {
    padding: 25px 30px;
    background: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 100%);
    border-top: 2px solid rgba(198, 255, 10, 0.2);
    position: sticky;
    bottom: 0;
    z-index: 10;
}

.mini-cart-subtotal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.subtotal-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
}

.subtotal-amount {
    font-family: 'Montserrat', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--titan-primary);
}

.mini-cart-buttons {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    width: 100% !important;
}

/* Override any WooCommerce default button positioning */
.mini-cart-buttons > * {
    position: static !important;
    margin: 0 !important;
}

.mini-cart-buttons .button {
    width: 100%;
    padding: 18px 40px !important;
    font-family: 'Sofia Sans', sans-serif !important;
    font-size: 18px !important;
    font-weight: 400 !important;
    text-align: center !important;
    text-decoration: none !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}

/* View Cart Button */
.titan-cart-drawer .mini-cart-buttons .view-cart-btn,
.mini-cart-buttons .view-cart-btn,
.mini-cart-buttons a.view-cart-btn,
.mini-cart-buttons a.button.view-cart-btn {
    background-color: #000 !important;
    color: #fff !important;
    border: 1px solid #C6FF0A !important;
}

.titan-cart-drawer .mini-cart-buttons .view-cart-btn *,
.mini-cart-buttons .view-cart-btn *,
.mini-cart-buttons a.view-cart-btn *,
.mini-cart-buttons a.button.view-cart-btn * {
    color: #fff !important;
}

.titan-cart-drawer .mini-cart-buttons .view-cart-btn:hover,
.mini-cart-buttons .view-cart-btn:hover,
.mini-cart-buttons a.view-cart-btn:hover,
.mini-cart-buttons a.button.view-cart-btn:hover {
    background-color: #C6FF0A !important;
    border-color: #C6FF0A !important;
    color: #000 !important;
}

.titan-cart-drawer .mini-cart-buttons .view-cart-btn:hover *,
.mini-cart-buttons .view-cart-btn:hover *,
.mini-cart-buttons a.view-cart-btn:hover *,
.mini-cart-buttons a.button.view-cart-btn:hover * {
    color: #000 !important;
}

/* Checkout Button - Portfolio Style */
.titan-cart-drawer .mini-cart-buttons .checkout-btn,
.mini-cart-buttons .checkout-btn,
.mini-cart-buttons a.checkout-btn,
.mini-cart-buttons a.button.checkout-btn {
    background-color: transparent !important;
    color: #fff !important;
    border: 1px solid var(--titan-primary) !important;
    position: relative !important;
    overflow: hidden !important;
    z-index: 1 !important;
}

.titan-cart-drawer .mini-cart-buttons .checkout-btn *,
.mini-cart-buttons .checkout-btn *,
.mini-cart-buttons a.checkout-btn *,
.mini-cart-buttons a.button.checkout-btn * {
    color: #fff !important;
    position: relative !important;
    z-index: 2 !important;
}

/* Slide effect from left */
.titan-cart-drawer .mini-cart-buttons .checkout-btn::before,
.mini-cart-buttons .checkout-btn::before,
.mini-cart-buttons a.checkout-btn::before,
.mini-cart-buttons a.button.checkout-btn::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: -100% !important;
    width: 100% !important;
    height: 100% !important;
    background-color: var(--titan-primary) !important;
    transition: left 0.4s ease !important;
    z-index: -1 !important;
}

.titan-cart-drawer .mini-cart-buttons .checkout-btn:hover,
.mini-cart-buttons .checkout-btn:hover,
.mini-cart-buttons a.checkout-btn:hover,
.mini-cart-buttons a.button.checkout-btn:hover {
    color: #000 !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 5px 20px rgba(198, 255, 10, 0.4) !important;
}

.titan-cart-drawer .mini-cart-buttons .checkout-btn:hover::before,
.mini-cart-buttons .checkout-btn:hover::before,
.mini-cart-buttons a.checkout-btn:hover::before,
.mini-cart-buttons a.button.checkout-btn:hover::before {
    left: 0 !important;
}

.titan-cart-drawer .mini-cart-buttons .checkout-btn:hover *,
.mini-cart-buttons .checkout-btn:hover *,
.mini-cart-buttons a.checkout-btn:hover *,
.mini-cart-buttons a.button.checkout-btn:hover * {
    color: #000 !important;
}

/* ============================
   EMPTY CART
   ============================ */

.titan-mini-cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 30px;
    text-align: center;
    height: 100%;
}

.titan-mini-cart-empty svg {
    color: rgba(255, 255, 255, 0.1);
    margin-bottom: 30px;
}

.titan-mini-cart-empty p {
    font-family: 'Sofia Sans', sans-serif;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 30px;
}

.titan-mini-cart-empty .button {
    background-color: #C6FF0A !important;
    color: #000 !important;
    padding: 18px 40px !important;
    font-family: 'Sofia Sans', sans-serif !important;
    font-size: 18px !important;
    font-weight: 400 !important;
    text-decoration: none !important;
    border-radius: 4px !important;
    border: 1px solid #C6FF0A !important;
    transition: all 0.3s ease !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}

.titan-mini-cart-empty .button:hover {
    background-color: #d4e600 !important;
    border-color: #d4e600 !important;
    color: #000 !important;
}

/* ============================
   RESPONSIVE
   ============================ */

@media (max-width: 768px) {
    .titan-cart-drawer {
        width: 100%;
        right: -100%;
    }
    
    .titan-cart-drawer.active {
        right: 0;
    }
}

@media (max-width: 480px) {
    .titan-mini-cart-header,
    .titan-mini-cart-items,
    .titan-mini-cart-footer {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .mini-cart-title {
        font-size: 16px;
    }
    
    .mini-cart-item-image {
        flex: 0 0 70px;
        width: 70px;
        height: 70px;
    }
    
    .mini-cart-item-name {
        font-size: 14px;
    }
    
    .subtotal-amount {
        font-size: 20px;
    }
}

/* ============================
   LOADING STATE
   ============================ */

.titan-cart-drawer.loading {
    pointer-events: none;
    opacity: 0.6;
}

.titan-cart-drawer.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid rgba(198, 255, 10, 0.2);
    border-top-color: var(--titan-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

