/* Base Mini-Cart Structure */
.offcanvas-cart {
    position: fixed;
    top: 0;
    left: -550px; /* For LTR layout, we keep it sliding from right */
    max-width: 550px;
    height: 100%;
    background-color: #fff;
    transition: left 0.5s ease-in-out !important;
    box-shadow: -4px 0 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    direction: ltr; /* Changed from rtl to ltr for English */
    font-family: 'Heebo', sans-serif;
    display: flex;
    flex-direction: column;
    cursor: default !important;
    width: 100%;
}

.offcanvas-cart.open {
    left: 0 !important;
}
#offcanvas-cart > div.mini-cart-footer > a.mas-mini-cart-checkout-button > p > span > bdi {
    display: flex !important;
    flex-direction: row !important;
    gap: 8px !important;
}
/* Overlay */
.offcanvas-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
    transition: opacity 0.3s ease-in-out;
}

.offcanvas-overlay.active {
    display: block;
    opacity: 1;
}
span.mini-cart.mas-icon-barcode {
    color: #2a5174;
font-size: 22px;
}

span.mas-icon-lock.mas-mini-cart-checkout-lock {
    color: #ddd;
    font-size: 30px;
}
/* Header */
.mas-mini-cart-header {
    padding: 15px 40px;
    background: #f6f6f6;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    height: 80px;
    flex-shrink: 0;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    color: #4180B9;
}

.mas-design-my-mini-cart {
    margin: 0;
    font-size: 25px;
}

.mas-mini-cart-header div span {
    font-size: 16px;
    padding-left: 3px; /* Changed from right to left for LTR */
}

.mas-header-mini-cart-right {
    margin-left: -25px; /* Changed from right to left for LTR */
}

#close-cart {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #363636;
    margin-right: -35px; /* Changed from left to right for LTR */
    margin-top: -25px;
}

/* Loader */
.custom-loader-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    text-align: center;
    padding: 10px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3d80b9;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Content Area */
#offcanvas-cart-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px;
    max-height: calc(100vh - 120px);
    direction: ltr; /* Changed from rtl to ltr */
}

#offcanvas-cart-content::-webkit-scrollbar {
    width: 6px;
    direction: ltr; /* Changed from rtl to ltr */
}

#offcanvas-cart-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#offcanvas-cart-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #0073aa, #005f8d);
    border-radius: 10px;
}

#offcanvas-cart-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #005f8d, #003f5c);
}

#offcanvas-cart-content {
    scrollbar-width: thin;
    scrollbar-color: #0073aa #f1f1f1;
}

/* Cart Items */
.cart-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Separator Lines */
.mrvah-mini-mas-design,
.first-mrvah-mini-mas-design {
    height: 10px;
    width: 100%;
    background: none;
    border-top: 0.6px solid #6A90A5;
    border-bottom: 0.6px solid #6A90A5;
}

.first-mrvah-mini-mas-design {
    border-bottom: 0.6px solid #6A90A5;
    border-top: none;
}

/* Cart Item */
li.cart-item {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-content: center;
    justify-content: flex-start; /* Changed from center to flex-start for better LTR alignment */
    align-items: center;
    width: 100%;
    height: 200px;
}

.cart-item:hover {
    background: #f9f9f9;
}

/* Cart Item Image */
.cart-item-image {
    width: 35%;
    height: 100%;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-content: center;
    justify-content: center;
    align-items: flex-start;
    padding: 0px 10px;
}

.cart-item-image img {
    width: 60px;
    height: 60px;
    border-radius: 5px;
    object-fit: cover;
}

img.attachment-woocommerce_thumbnail.size-woocommerce_thumbnail {
    width: 100%;
    height: auto;
}

/* Cart Item Details */
.cart-item-details {
    flex: 1;
    padding: 10px 0px;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-content: center;
    justify-content: space-between;
    align-items: flex-start;
    height: 190px;
}

/* Item Name */
.cart-item-name {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
    line-height: 1px;
    display: flex !important;
    flex-direction: row;
    align-content: center !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.cart-item-name:hover {
    color: #0073aa;
}

/* SKU */
.cart-item-sku, .mas-mini-cart-price-item {
    width: 100%;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
     /* Changed from right to left for LTR */
    
     /* Changed from center to flex-start for LTR */
    justify-content: flex-start;
}

.cart-item-sku {
    font-size: 13.8px;
    margin-top: -35px;
     /* Changed from right to left for LTR */
    font-weight: 500;
    color: #2a5174;
    align-items: flex-end !important;
    gap: 15px;
}


/* Variations */
.cart-variations-container {
    position: relative;
    display: inline-block;
    width: 100%;
    background: none;
    padding: 5px 0px 5px 18px; /* Swapped padding for LTR */
    margin-top: 10px;
    border-bottom: 0.5px solid #42484b;
    border-top: 0.5px solid #42484b;
    margin-bottom: 15%;
}

.cart-variations-toggle {
    display: block;
    background: transparent;
    font-weight: bold;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.3s ease-in-out, border 0.3s ease-in-out;
}

.cart-variations-checkbox {
    display: none !important;
}

.cart-variations-list {
    display: none;
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    padding: 10px;
    width: 100%;
    top: 100%;
    left: 0;
    z-index: 999;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
}

.cart-variations-container:hover .cart-variations-list {
    display: block;
}

.cart-variations-checkbox:checked + .cart-variations-list {
    display: block;
}

.mas-mini-cart-cart-item-variation {
    padding-bottom: 5px;
    width: 100%;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-content: center;
    justify-content: flex-start;
    align-items: center;
}

.attribute-cart-item {
    width: 40%;
    font-size: 16px;
    color: #3d80b9;
    font-weight: 550;
    padding-right: 6px; /* Changed from left to right for LTR */
}

.variation-cart-item {
    font-size: 15px;
}

.mini-cart-qnt {
    display: flex !important;
    width: 100px !important;
    gap: 0 !important;
    justify-content: center !important;
    align-items: center !important;
    border: 1px solid #1c1c1c !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    margin-bottom: 25px;
    height: 40px !important;
    margin-left: 10px;
}

.cart-qty {
    width: 50% !important;
    
    font-size: 18px !important;
    font-weight: bold !important;
    text-align: center !important;
    border: none !important;
    background: none !important;
    pointer-events: none !important;
    padding: 0 !important;
    line-height: 40px !important;
}

.cart-qty::-webkit-inner-spin-button,
.cart-qty::-webkit-outer-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

.btnPlus, .btnMinus {
    background: none;
    color: #2a2828;
    width: 25%;
    height: auto;
    font-size: 20px;
    text-align: center;
    cursor: pointer;
    transition: background 0.3s, border-radius 0.3s;
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    flex-direction: row;
    border: 1px solid transparent;
}

.btnPlus {
    border-left: 1px solid #1c1c1c !important;
}

.btnMinus {
    border-right: 1px solid #1c1c1c !important;
}

/* Hover with radius only on the correct side */
div.mini-cart-qnt > button.btnMinus:hover {
    background: rgba(0, 85, 128, 0.2) !important;
    border-top-left-radius: 8px !important;
    border-bottom-left-radius: 8px !important;
}

div.mini-cart-qnt > button.btnPlus:hover {
    background: rgba(0, 85, 128, 0.2) !important;
    border-top-right-radius: 8px !important;
    border-bottom-right-radius: 8px !important;
}

/* Item Actions */
.mas-design-mini-cart-home {
    height: 170px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: nowrap;
}

.cart-item-remove {
}

.remove-item {
    border: 1px solid #ff0027;
    font-size: 8px;
    cursor: pointer;
    transition: background 0.3s;
    border-radius: 60px;
    background: none;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0px; /* Changed from left to right for LTR */
    padding: 6px 8px;
}

.remove-item:hover {
    background: #a50018;
}

/* Pricing */
.mas-mach-mini-cart-total {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
}

.mas-total-before-discount {
    line-height: 1px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    flex-direction: row;
    width: 100%;
    margin-right: 15px; /* Changed from left to right for LTR */
}

.cart-item-regular-price del {
    color: #999;
    font-size: 14px;
    margin-left: 5px; /* Changed from right to left for LTR */
    text-decoration: line-through !important;
}

.mas-item-total {
    font-family: 'Heebo', sans-serif;
    font-size: 16px;
    color: #363636;
    width: 100%;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-content: center;
    justify-content: center;
    align-items: center;
    padding-right: 15%; /* Changed from left to right for LTR */
}

p.mas-mini-cart-item-total {
    margin-top: 2px;
}

/* Footer */
.mini-cart-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f8f8f8;
    gap: 10px;
    padding: 15px;
    border-top: 1px solid #ddd;
    flex-wrap: nowrap;
    align-content: center;
    justify-content: space-between;
    padding-top: 25px;
    padding-bottom: 20px;
    flex-shrink: 0;
}

.mini-cart-footer a {
    display: flex;
    width: 95%;
    text-decoration: none;
    border-radius: 10px;
    border: 2px solid #ccc;
    transition: all 0.3s ease-in-out;
    align-items: center;
    justify-content: space-evenly;
    flex-direction: row;
    flex-wrap: nowrap;
}

.mas-mini-cart-cart-button {
    background-color: #f8f8f8;
    color: #333;
    padding: 10px 0px;
    font-size: 15px;
    font-weight: 500;
}

.mas-mini-cart-cart-button:hover {
    border-color: #0073aa; /* Border color change on hover */
    background-color: #e0e0e0;
}

.mas-mini-cart-checkout-button {
    background-color: #6d8793;
    font-size: 19px;
    font-weight: bold;
    color: #fafafa;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-content: center;
    align-items: center;
    flex-wrap: nowrap;
}

.mas-mini-cart-checkout-button:hover {
    border-color: #003f5c;
    background-color: #005f8d;
}

span.checkout-text {
    margin-left: 15%; /* Changed from right to left for LTR */
}

span.cart-total {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-content: center;
    align-items: center;
    justify-content: center;
}

.mini-cart .mas.icon.barcode :before {
color: #2a5174;
font-size: 22px;
}


.mas-icon-lock .mas-mini-cart-checkout-lock:before {
    color: #ddd;
    font-size: 30px;
}

#offcanvas-cart > div.mini-cart-footer > a.mas-mini-cart-checkout-button > span.cart-total > span.woocommerce-Price-amount.amount > bdi {
    font-size: 18px;
    margin-right: 40px; /* Changed from left to right for LTR */
}

/* Security Info */
.mas-mini-cart-security {
    text-align: center;
    font-size: 15px;
    color: #333;
    margin-top: 12px;
    padding: 12px;
    border-top: 1px solid #ddd;
    background: #f9f9f9;
    border-radius: 8px;
    width: 80%;
    border-radius: 0px !important;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-content: center;
    justify-content: space-between;
    align-items: center;
}

/* Security text styling */
.mas-mini-cart-secure-text {
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px; /* Small gap between elements */
}

/* SSL text styling */
.ssl-secure-mini-cart {
    color: #0073aa;
    font-weight: bold;
}

/* Accessibility */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Responsive */
@media (max-width: 768px) {
    .cart-item {
        flex-direction: column;
        text-align: center;
    }

    .cart-item-image img {
        width: auto;
        height: 100%
    }


    .mini-cart-qnt {
        justify-content: center;
    }
}

/* Mobile-specific fixes */
@media (max-width: 1024px) {
    /* Use CSS custom property for viewport height */
    .offcanvas-cart {
        height: 100vh;
        height: calc(var(--vh, 1vh) * 100);
        position: fixed;
        touch-action: none; /* Prevent pull-to-refresh */
    }
    
    /* Prevent body scroll when cart is open */
    body.mini-cart-open {
        position: fixed !important;
        width: 100% !important;
        overflow: hidden !important;
        touch-action: none !important;
    }
    
    /* Ensure overlay covers full viewport */
    .offcanvas-overlay {
        position: fixed;
        height: 100vh;
        height: calc(var(--vh, 1vh) * 100);
        -webkit-overflow-scrolling: touch;
        touch-action: none;
    }
    
    /* Cart content scrolling */
    #offcanvas-cart-content {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        max-height: calc(100vh - 260px);
        max-height: calc((var(--vh, 1vh) * 100) - 260px);
        touch-action: pan-y;
    }
    
    /* Prevent horizontal scrollbar */
    .offcanvas-cart {
        overflow-x: hidden;
        overflow-y: hidden;
    }
    
    /* Fix for iOS rubber band effect */
    .offcanvas-cart.open {
        position: fixed;
        overscroll-behavior: none;
    }
    
    /* Ensure mini-cart footer stays at bottom */
    .mini-cart-footer {
        position: sticky;
        bottom: 0;
        background: #f8f8f8;
        z-index: 10;
    }
}




