/**
 * TP WooCommerce Side Cart - Public Styles
 */

/* CSS Variables */
:root {
    --tp-cart-width: 400px;
    --tp-cart-bg: #ffffff;
    --tp-cart-text: #333333;
    --tp-cart-border: #e0e0e0;
    --tp-cart-count-bg: #e74c3c;
    --tp-view-cart-btn-bg: #f8f9fa;
    --tp-checkout-btn-bg: #28a745;
    --tp-cart-font-size: 14px;
    --tp-cart-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    --tp-cart-overlay: rgba(0, 0, 0, 0.5);
    --tp-cart-radius: 8px;
    --tp-cart-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --tp-cart-z-index: 999999;
}

/* Cart Icon/Trigger */
.tp-side-cart-trigger {
    position: relative;
    display: inline-block;
}

.tp-cart-icon-button {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: var(--tp-cart-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tp-cart-text);
}

.tp-cart-icon-button:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.05);
}

.tp-cart-icon-button i {
    font-size: 24px;
    line-height: 1;
}

.tp-cart-count {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--tp-cart-count-bg, #e74c3c);
    color: white;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    animation: tp-cart-count-bounce 0.3s ease;
}

/* RTL support for cart count */
body.rtl .tp-cart-count {
    right: auto;
    left: -2px;
}

@keyframes tp-cart-count-bounce {
    0% { transform: scale(0.8); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Overlay */
.tp-side-cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--tp-cart-overlay);
    z-index: var(--tp-cart-z-index);
    opacity: 0;
    visibility: hidden;
    transition: var(--tp-cart-transition);
}

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

/* Side Cart Container */
.tp-side-cart {
    position: fixed;
    top: 0;
    width: var(--tp-cart-width);
    height: 100vh;
    background: var(--tp-cart-bg);
    color: var(--tp-cart-text);
    font-size: var(--tp-cart-font-size, 14px);
    z-index: calc(var(--tp-cart-z-index) + 1);
    display: flex;
    flex-direction: column;
    box-shadow: var(--tp-cart-shadow);
    transition: var(--tp-cart-transition);
    overflow: hidden;
}

/* Right position (default) */
.tp-side-cart.tp-cart-right {
    right: 0;
    transform: translateX(100%);
}

.tp-side-cart.tp-cart-right.active {
    transform: translateX(0);
}

/* Left position */
.tp-side-cart.tp-cart-left {
    left: 0;
    transform: translateX(-100%);
}

.tp-side-cart.tp-cart-left.active {
    transform: translateX(0);
}

/* Dropdown position */
.tp-side-cart.tp-cart-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 450px;
    height: auto;
    max-height: 600px;
    border-radius: var(--tp-cart-radius);
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
}

.tp-side-cart.tp-cart-dropdown.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

/* RTL support for dropdown */
body.rtl .tp-side-cart.tp-cart-dropdown {
    right: auto;
    left: 0;
}

/* Popup position */
.tp-side-cart.tp-cart-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    right: auto;
    transform: translate(-50%, -50%) scale(0.9);
    width: var(--tp-cart-width, 450px);
    max-width: 90vw;
    height: auto;
    max-height: 85vh;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    z-index: 999999;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 0;
    visibility: hidden;
}

.tp-side-cart.tp-cart-popup.active {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    visibility: visible;
}

/* Popup overlay enhancement */
.tp-side-cart-overlay.tp-popup-overlay {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Popup header styling */
.tp-cart-popup .tp-cart-header {
    border-radius: 12px 12px 0 0;
    padding: 20px;
    background: linear-gradient(135deg, var(--tp-cart-bg, #ffffff) 0%, #f8f9fa 100%);
    border-bottom: 2px solid var(--tp-cart-border, #e0e0e0);
}

.tp-cart-popup .tp-cart-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.tp-cart-popup .tp-cart-close:hover {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    transform: scale(1.1);
}

/* Popup content area */
.tp-cart-popup .tp-cart-content {
    max-height: calc(85vh - 140px);
    overflow-y: auto;
}

/* Popup footer styling */
.tp-cart-popup .tp-cart-footer {
    border-radius: 0 0 12px 12px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, var(--tp-cart-bg, #ffffff) 100%);
    border-top: 2px solid var(--tp-cart-border, #e0e0e0);
}

/* Popup animations */
@keyframes tp-popup-slide-in {
    from {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes tp-popup-slide-out {
    from {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    to {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
}



/* Loading Overlay - positioned relative to cart content */
.tp-side-cart-content {
    position: relative;
}

.tp-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(2px);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.tp-loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.tp-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--tp-checkout-btn-bg, #28a745);
    border-radius: 50%;
    animation: tp-spin 1s linear infinite;
    margin-bottom: 15px;
}

.tp-loading-text {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

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

/* Cart Header */
.tp-side-cart-header {
    padding: 15px;
    border-bottom: 1px solid var(--tp-cart-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.tp-side-cart-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--tp-cart-text);
}

.tp-cart-count-header {
    font-weight: 400;
    color: #666;
}

.tp-side-cart-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: var(--tp-cart-transition);
    color: #666;
}

.tp-side-cart-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--tp-cart-text);
}

.tp-side-cart-close i {
    font-size: 16px;
}

/* Cart Content - Improved Flexbox */
.tp-side-cart-content {
    flex: 1;
    min-height: 200px; /* Minimum height for content visibility */
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tp-side-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* Custom scrollbar */
.tp-side-cart-items::-webkit-scrollbar {
    width: 6px;
}

.tp-side-cart-items::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.tp-side-cart-items::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.tp-side-cart-items::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Cart Item */
.tp-cart-item {
    display: flex;
    padding: 20px;
    border-bottom: 1px solid var(--tp-cart-border);
    transition: var(--tp-cart-transition);
    position: relative;
}

.tp-cart-item:hover {
    background: rgba(0, 0, 0, 0.02);
}

.tp-cart-item:last-child {
    border-bottom: none;
}

.tp-cart-item-image {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    margin-right: 15px;
    border-radius: var(--tp-cart-radius);
    overflow: hidden;
}

body.rtl .tp-cart-item-image {
    margin-right: 0;
    margin-left: 15px;
}

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

.tp-cart-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tp-cart-item-name {
    font-weight: 600;
    line-height: 1.4;
}

.tp-cart-item-name a {
    color: var(--tp-cart-text);
    text-decoration: none;
}

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

.tp-cart-item-variation {
    font-size: 13px;
    color: #666;
}

.tp-variation-item {
    display: block;
    margin-bottom: 2px;
}

.tp-cart-item-description {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.tp-cart-item-sku {
    font-size: 12px;
    color: #999;
}

.tp-cart-item-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

/* Quantity Controls */
.tp-cart-item-quantity {
    display: flex;
    align-items: center;
    border: 1px solid var(--tp-cart-border);
    border-radius: 4px;
    overflow: hidden;
}

.tp-quantity-btn {
    background: none;
    border: none;
    padding: 6px 8px;
    cursor: pointer;
    transition: var(--tp-cart-transition);
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tp-quantity-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--tp-cart-text);
}

.tp-quantity-btn i {
    font-size: 12px;
}

.tp-quantity-input {
    border: none !important;
    width: 40px !important;
    text-align: center;
    padding: 6px 4px !important;
    font-size: 14px;
    background: none !important;
    color: var(--tp-cart-text) !important;
}

.tp-quantity-input:focus {
    outline: none;
    background: rgba(0, 115, 170, 0.05);
}

/* Remove button */
.tp-remove-item {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: #e74c3c;
    border-radius: 4px;
    transition: var(--tp-cart-transition);
}

.tp-remove-item:hover {
    background: rgba(231, 76, 60, 0.1);
    transform: scale(1.1);
}

.tp-remove-item i {
    font-size: 14px;
}

/* Price */
.tp-cart-item-price {
    font-weight: 600;
    color: var(--tp-cart-text);
    margin: 0 10px;
}

.tp-regular-price {
    text-decoration: line-through;
    color: #999;
    font-size: 0.9em;
}

.tp-sale-price {
    color: #e74c3c;
    font-weight: 700;
}

/* Sale Badge */
.tp-sale-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #e74c3c;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    z-index: 1;
}

body.rtl .tp-sale-badge {
    right: auto;
    left: 10px;
}

/* Empty Cart */
.tp-empty-cart {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
    text-align: center;
    height: 100%;
}

.tp-empty-cart-icon {
    margin-bottom: 20px;
    opacity: 0.3;
}

.tp-empty-cart-icon i {
    font-size: 48px;
    color: var(--tp-cart-text);
}

.tp-empty-cart-message h4 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: var(--tp-cart-text);
}

.tp-empty-cart-message p {
    margin: 0 0 20px 0;
    color: #666;
    line-height: 1.5;
}

.tp-continue-shopping-btn {
    display: inline-flex;
    align-items: center;
    padding: 12px 24px;
    background: #0073aa;
    color: white;
    text-decoration: none;
    border-radius: var(--tp-cart-radius);
    font-weight: 500;
    transition: var(--tp-cart-transition);
}

.tp-continue-shopping-btn:hover {
    background: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

/* Cart Footer - Dynamic Height with Sticky Bottom */
.tp-side-cart-footer {
    flex-shrink: 0;
    border-top: 1px solid var(--tp-cart-border);
    background: var(--tp-cart-bg);
    max-height: 60vh; /* Maximum 60% of viewport height */
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Scrollable content in footer */
.tp-footer-scrollable {
    flex: 1;
    overflow-y: auto;
}

.tp-footer-scrollable .tp-cart-totals {
    display: none;
}

/* Sticky bottom section - always visible */
.tp-footer-sticky {
    flex-shrink: 0;
    background: var(--tp-cart-bg);
    border-top: 2px solid var(--tp-cart-border);
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
    padding: 15px;
}

/* Use original totals styling in sticky footer */
.tp-footer-sticky .tp-cart-totals {
    margin-bottom: 15px;
}

.tp-footer-sticky .tp-cart-actions {
    display: flex;
    gap: 10px;
    margin: 0;
}

/* Free Shipping Notice */
.tp-free-shipping-notice {
    margin: 15px 20px;
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    animation: tp-free-shipping-fade-in 0.3s ease;
}

.tp-free-shipping-notice i {
    font-size: 16px;
    flex-shrink: 0;
}

.tp-free-shipping-achieved {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.tp-free-shipping-achieved i {
    color: #28a745;
}

.tp-free-shipping-progress {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.tp-free-shipping-progress i {
    color: #ffc107;
}

@keyframes tp-free-shipping-fade-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cart Totals */
.tp-cart-totals {
    padding: 20px;
    border-bottom: 1px solid var(--tp-cart-border);
}

.tp-cart-subtotal,
.tp-cart-shipping,
.tp-cart-tax,
.tp-cart-discount,
.tp-cart-fee,
.tp-cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.tp-cart-discount {
    flex-direction: column;
    align-items: stretch;
}

.tp-cart-discount > div:first-child {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.tp-cart-total {
    margin-bottom: 0;
    padding-top: 8px;
    border-top: 1px solid var(--tp-cart-border);
    font-weight: 600;
    font-size: 16px;
}

.tp-subtotal-label,
.tp-shipping-label,
.tp-tax-label,
.tp-discount-label,
.tp-fee-label,
.tp-total-label {
    color: #666;
}

.tp-total-label {
    color: var(--tp-cart-text);
    font-weight: 600;
}

.tp-subtotal-amount,
.tp-shipping-amount,
.tp-tax-amount,
.tp-discount-amount,
.tp-fee-amount,
.tp-total-amount {
    font-weight: 600;
    color: var(--tp-cart-text);
}

.tp-discount-amount {
    color: #28a745;
}

/* Fee styles */
.tp-cart-fee-positive .tp-fee-amount {
    color: #dc3545; /* Red for positive fees (charges) */
}

.tp-cart-fee-negative .tp-fee-amount {
    color: #28a745; /* Green for negative fees (discounts) */
}

/* Coupon styles */
.tp-discount-coupons {
    margin-top: 8px;
}

.tp-coupon-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 16px;
    padding: 6px 12px;
    margin-bottom: 4px;
    font-size: 13px;
}

.tp-coupon-code {
    color: #495057;
    font-weight: 500;
}

.tp-remove-coupon {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 2px;
    border-radius: 50%;
    transition: var(--tp-cart-transition);
    margin-left: 8px;
}

body.rtl .tp-remove-coupon {
    margin-left: 0;
    margin-right: 8px;
}

.tp-remove-coupon:hover {
    background: rgba(220, 53, 69, 0.1);
    transform: scale(1.1);
}

.tp-remove-coupon i {
    font-size: 12px;
}

.tp-coupon-item.tp-removing {
    opacity: 0.5;
    pointer-events: none;
}

/* Cart Actions */
.tp-cart-actions {
    padding: 15px;
    display: flex;
    gap: 10px;
}

.tp-cart-actions:empty {
    display: none;
}

.tp-cart-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    text-decoration: none;
    border-radius: var(--tp-cart-radius);
    font-weight: 500;
    transition: var(--tp-cart-transition);
    text-align: center;
}

.tp-view-cart-btn {
    background: var(--tp-view-cart-btn-bg, #f8f9fa);
    color: var(--tp-cart-text);
    border: 1px solid var(--tp-cart-border);
}

.tp-view-cart-btn:hover {
    filter: brightness(0.95);
    transform: translateY(-1px);
}

.tp-checkout-btn {
    background: var(--tp-checkout-btn-bg, #28a745);
    color: white;
}

.tp-checkout-btn:hover {
    filter: brightness(0.9);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.tp-cart-btn i {
    font-size: 14px;
}

/* Loading States */
.tp-cart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #666;
}

.tp-cart-loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: tp-spin 1s linear infinite;
    margin-left: 10px;
}

body.rtl .tp-cart-loading::after {
    margin-left: 0;
    margin-right: 10px;
}

/* Item removing state */
.tp-cart-item.tp-removing {
    opacity: 0.5;
    pointer-events: none;
}

/* Body scroll lock */
body.tp-cart-open {
    overflow: hidden;
}

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

/* Animations */
@keyframes tp-slide-in-right {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

@keyframes tp-slide-in-left {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

@keyframes tp-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Product Suggestions Carousel - Collapsible */
.tp-product-suggestions {
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.tp-product-suggestions.tp-collapsed {
    margin: 10px 0;
    padding: 10px 15px;
}

.tp-suggestions-header {
    margin-bottom: 0;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    padding: 5px;
    border-radius: 4px;
    position: relative;
}

.tp-suggestions-header:hover {
    background: rgba(0,0,0,0.05);
}

.tp-suggestions-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    text-align: center;
    position: relative;
    padding-right: 20px;
}

.tp-suggestions-header h4:after {
    content: '▼';
    position: absolute;
    right: -15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    transition: transform 0.2s ease;
    color: #666;
}

.tp-suggestions-header.collapsed h4:after {
    transform: translateY(-50%) rotate(-90deg);
}

.tp-suggestions-carousel {
    position: relative;
    overflow: hidden;
}

.tp-suggestions-container {
    overflow: hidden;
    margin: 0 30px; /* Space for navigation arrows */
}

.tp-suggestions-track {
    display: flex;
    transition: transform 0.3s ease;
    gap: 15px;
}

.tp-suggestion-item {
    flex: 0 0 auto;
    width: 140px;
    background: white;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tp-suggestion-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.tp-suggestion-image {
    margin-bottom: 8px;
}

.tp-suggestion-image img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.tp-suggestion-title {
    font-size: 12px;
    font-weight: 500;
    margin: 0 0 5px 0;
    line-height: 1.3;
    height: 32px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.tp-suggestion-price {
    font-size: 13px;
    font-weight: 600;
    color: #2c5aa0;
    margin-bottom: 8px;
}

.tp-suggestion-add-btn {
    background: #2c5aa0;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 11px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
}

.tp-suggestion-add-btn:hover {
    background: #1e3d6f;
}

.tp-suggestion-add-btn.tp-success {
    background: #27ae60 !important;
    color: white !important;
    transform: none !important;
}

.tp-suggestion-add-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.tp-suggestion-add-btn i {
    font-size: 10px;
}

/* Navigation Arrows */
.tp-suggestions-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 2;
}

.tp-suggestions-nav:hover {
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.tp-suggestions-nav:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tp-suggestions-prev {
    left: 0;
}

.tp-suggestions-next {
    right: 0;
}

.tp-suggestions-nav i {
    font-size: 12px;
    color: #666;
}

/* Collapsed state */
.tp-product-suggestions.tp-suggestions-collapsed {
    padding-bottom: 10px;
}

.tp-product-suggestions.tp-suggestions-collapsed .tp-suggestions-carousel {
    display: none;
}

/* Recently Viewed Products */
.tp-recently-viewed-products {
    margin: 20px 0;
    padding: 15px;
    background: #f0f8ff;
    border-radius: 8px;
    border: 1px solid #d0e7ff;
    width: 100%;
    box-sizing: border-box;
}

.tp-recently-viewed-header {
    margin-bottom: 15px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    padding: 5px;
    border-radius: 4px;
    position: relative;
}

.tp-recently-viewed-header:hover {
    background: rgba(0,0,0,0.05);
}

.tp-recently-viewed-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #2c5aa0;
    text-align: center;
    position: relative;
    padding-right: 20px;
}

.tp-recently-viewed-header h4:after {
    content: '▼';
    position: absolute;
    right: -15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    transition: transform 0.2s ease;
    color: #2c5aa0;
}

.tp-recently-viewed-header.collapsed h4:after {
    transform: translateY(-50%) rotate(-90deg);
}

.tp-recently-viewed-carousel {
    position: relative;
    overflow: hidden;
}

.tp-recently-viewed-container {
    overflow: hidden;
    margin: 0 30px; /* Space for navigation arrows */
}

.tp-recently-viewed-track {
    display: flex;
    transition: transform 0.3s ease;
    gap: 15px;
}

.tp-recently-viewed-item {
    flex: 0 0 auto;
    width: 180px;
    background: white;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(44, 90, 160, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #e0e7ff;
}

.tp-recently-viewed-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(44, 90, 160, 0.2);
}

.tp-recently-viewed-image {
    margin-bottom: 8px;
}

.tp-recently-viewed-image img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.tp-recently-viewed-title {
    font-size: 12px;
    font-weight: 500;
    margin: 0 0 5px 0;
    line-height: 1.3;
    height: 32px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    color: #333;
}

.tp-recently-viewed-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
}

.tp-recently-viewed-title a:hover {
    color: #2c5aa0;
}

.tp-recently-viewed-price {
    font-size: 13px;
    font-weight: 600;
    color: #2c5aa0;
    margin-bottom: 8px;
}

.tp-recently-viewed-actions {
    display: flex;
    gap: 5px;
    align-items: center;
}

.tp-recently-viewed-view-btn {
    background: #f8f9fa;
    color: #2c5aa0;
    border: 1px solid #2c5aa0;
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    text-decoration: none;
}

.tp-recently-viewed-view-btn:hover {
    background: #2c5aa0;
    color: white;
}

.tp-recently-viewed-view-btn i {
    font-size: 10px;
}

.tp-recently-viewed-add-btn {
    background: #2c5aa0;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 11px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
}

.tp-recently-viewed-add-btn:hover {
    background: #1e3d6f;
}

.tp-recently-viewed-add-btn.tp-success {
    background: #27ae60 !important;
    color: white !important;
    transform: none !important;
}

.tp-recently-viewed-add-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.tp-recently-viewed-add-btn i {
    font-size: 10px;
}

/* Recently Viewed Navigation Arrows */
.tp-recently-viewed-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(44, 90, 160, 0.1);
    border: 1px solid #2c5aa0;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 2;
    padding: 0 !important;
}

.tp-recently-viewed-nav:hover {
    background: rgba(44, 90, 160, 0.2);
    box-shadow: 0 2px 8px rgba(44, 90, 160, 0.3);
}

.tp-recently-viewed-nav:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tp-recently-viewed-prev {
    left: 0;
}

.tp-recently-viewed-next {
    right: 0;
}

.tp-recently-viewed-nav i {
    font-size: 12px;
    color: #2c5aa0;
}

.tp-recently-viewed-empty {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
}

/* Collapsed state for recently viewed */
.tp-recently-viewed-products.tp-recently-viewed-collapsed {
    padding-bottom: 10px;
}

.tp-recently-viewed-products.tp-recently-viewed-collapsed .tp-recently-viewed-carousel {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tp-side-cart {
        width: 100vw;
        max-width: 400px;
    }

    .tp-side-cart.tp-cart-dropdown {
        width: 380px;
        max-height: 500px;
    }

    .tp-side-cart.tp-cart-popup {
        width: calc(100vw - 20px);
        max-width: 380px;
        max-height: 90vh;
        border-radius: 8px;
    }

    .tp-cart-popup .tp-cart-content {
        max-height: calc(90vh - 120px);
    }

    .tp-cart-popup .tp-cart-header,
    .tp-cart-popup .tp-cart-footer {
        padding: 16px;
    }

    .tp-cart-item {
        padding: 15px;
    }

    .tp-cart-item-image {
        width: 50px;
        height: 50px;
        margin-right: 12px;
    }

    body.rtl .tp-cart-item-image {
        margin-right: 0;
        margin-left: 12px;
    }

    .tp-cart-actions {
        flex-direction: column;
    }

    .tp-cart-btn {
        padding: 14px 16px;
    }
}

@media (max-width: 480px) {
    .tp-side-cart {
        width: 100vw;
    }

    .tp-side-cart.tp-cart-dropdown {
        width: calc(100vw - 20px);
        left: 10px;
        right: 10px;
    }

    body.rtl .tp-side-cart.tp-cart-dropdown {
        left: 10px;
        right: 10px;
    }

    .tp-side-cart-header {
        padding: 15px;
    }

    .tp-side-cart-title {
        font-size: 16px;
    }

    .tp-free-shipping-notice {
        margin: 10px 15px;
        padding: 10px 12px;
        font-size: 13px;
    }

    .tp-cart-totals,
    .tp-cart-actions {
        padding: 15px;
    }

    /* Mobile suggestions styling */
    .tp-product-suggestions {
        margin: 15px 0;
        padding: 12px;
    }

    .tp-suggestions-container {
        margin: 0 25px;
    }

    .tp-suggestion-item {
        width: 120px;
    }

    .tp-suggestion-image img {
        height: 70px;
    }

    .tp-suggestions-nav {
        width: 25px;
        height: 25px;
    }

    .tp-suggestions-nav i {
        font-size: 10px;
    }

    /* Extra small screens adjustments */
    .tp-suggestions-container {
        margin: 0 20px;
    }

    .tp-suggestion-item {
        width: 100px;
    }

    .tp-suggestion-image img {
        height: 60px;
    }

    .tp-suggestion-title {
        font-size: 11px;
        height: 28px;
    }

    .tp-suggestion-price {
        font-size: 12px;
    }

    .tp-suggestion-add-btn {
        padding: 5px 8px;
        font-size: 10px;
    }

    /* Mobile recently viewed styling */
    .tp-recently-viewed-products {
        margin: 15px 0;
        padding: 12px;
    }

    .tp-recently-viewed-container {
        margin: 0 25px;
    }

    .tp-recently-viewed-item {
        width: 120px;
    }

    .tp-recently-viewed-image img {
        height: 70px;
    }

    .tp-recently-viewed-nav {
        width: 25px;
        height: 25px;
    }

    .tp-recently-viewed-nav i {
        font-size: 10px;
    }

    /* Extra small screens adjustments for recently viewed */
    .tp-recently-viewed-container {
        margin: 0 20px;
    }

    .tp-recently-viewed-item {
        width: 100px;
    }

    .tp-recently-viewed-image img {
        height: 60px;
    }

    .tp-recently-viewed-title {
        font-size: 11px;
        height: 28px;
    }

    .tp-recently-viewed-price {
        font-size: 12px;
    }

    .tp-recently-viewed-actions {
        flex-direction: column;
        gap: 3px;
    }

    .tp-recently-viewed-view-btn,
    .tp-recently-viewed-add-btn {
        padding: 4px 6px;
        font-size: 9px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .tp-side-cart {
        border: 2px solid var(--tp-cart-text);
    }

    .tp-cart-item {
        border-bottom: 2px solid var(--tp-cart-border);
    }

    .tp-cart-btn {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .tp-side-cart,
    .tp-side-cart-overlay,
    .tp-cart-icon-button,
    .tp-cart-btn,
    .tp-quantity-btn,
    .tp-remove-item {
        transition: none;
    }

    .tp-cart-count {
        animation: none;
    }
}

/* Fixed Cart Icon */
.tp-fixed-cart-icon-wrapper {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999998;
    pointer-events: none;
}

.tp-fixed-cart-icon-wrapper .tp-side-cart-trigger {
    pointer-events: all;
}

.tp-fixed-cart-icon-wrapper .tp-cart-icon-button {
    background: var(--tp-cart-count-bg, #e74c3c);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: var(--tp-cart-transition);
    border: 3px solid white;
}

.tp-fixed-cart-icon-wrapper .tp-cart-icon-button:hover {
    background: var(--tp-cart-count-bg, #e74c3c);
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
}

.tp-fixed-cart-icon-wrapper .tp-cart-icon-button i {
    font-size: 28px;
}

.tp-fixed-cart-icon-wrapper .tp-cart-count {
    top: -5px;
    right: -5px;
    min-width: 24px;
    height: 24px;
    font-size: 13px;
    font-weight: 700;
    background: #fff;
    color: var(--tp-cart-count-bg, #e74c3c);
    border: 2px solid var(--tp-cart-count-bg, #e74c3c);
}

/* RTL support for fixed cart icon */
body.rtl .tp-fixed-cart-icon-wrapper {
    right: auto;
    left: 20px;
}

body.rtl .tp-fixed-cart-icon-wrapper .tp-cart-count {
    right: auto;
    left: -5px;
}

/* Mobile adjustments for fixed cart icon */
@media (max-width: 768px) {
    .tp-fixed-cart-icon-wrapper {
        bottom: 15px;
        right: 15px;
    }

    .tp-fixed-cart-icon-wrapper .tp-cart-icon-button {
        width: 50px;
        height: 50px;
    }

    .tp-fixed-cart-icon-wrapper .tp-cart-icon-button i {
        font-size: 24px;
    }

    .tp-fixed-cart-icon-wrapper .tp-cart-count {
        min-width: 20px;
        height: 20px;
        font-size: 12px;
    }

    body.rtl .tp-fixed-cart-icon-wrapper {
        left: 15px;
    }
}

/* Animation for fixed cart icon */
.tp-fixed-cart-icon-wrapper {
    animation: tp-fixed-icon-slide-in 0.5s ease-out;
}

.tp-fixed-cart-icon-wrapper.tp-fixed-icon-ready {
    opacity: 1;
    visibility: visible;
}

.tp-fixed-cart-icon-wrapper.tp-has-other-icons {
    /* Optional: Add different styling when there are other icons */
    /* Users can customize this via CSS if needed */
}

@keyframes tp-fixed-icon-slide-in {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Ensure fixed icon doesn't interfere with other elements */
.tp-fixed-cart-icon-wrapper {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.tp-fixed-cart-icon-wrapper * {
    box-sizing: border-box;
}

/* Coupon Section - Collapsible */
.tp-coupon-section {
    margin: 15px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid var(--tp-cart-border, #e0e0e0);
    transition: all 0.3s ease;
}

.tp-coupon-section.tp-collapsed {
    margin: 10px 0;
    padding: 10px 15px;
}

/* Coupon Header for Collapsing */
.tp-coupon-header {
    cursor: pointer;
    user-select: none;
    margin-bottom: 10px;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.tp-coupon-header:hover {
    background: rgba(0,0,0,0.05);
}

.tp-coupon-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tp-coupon-header i {
    font-size: 12px;
    transition: transform 0.2s ease;
}

.tp-coupon-section.tp-collapsed .tp-coupon-header i {
    transform: rotate(-90deg);
}

.tp-applied-coupons {
    margin-bottom: 15px;
    display: none; /* Hidden - using existing tp-discount-coupons instead */
}

.tp-coupon-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #e8f5e8;
    border: 1px solid #4caf50;
    border-radius: 6px;
    margin-bottom: 8px;
}

.tp-coupon-item:last-child {
    margin-bottom: 0;
}

.tp-coupon-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tp-coupon-code {
    font-weight: 600;
    color: #2e7d32;
    font-size: 14px;
}

.tp-coupon-discount {
    color: #1b5e20;
    font-weight: 500;
    font-size: 13px;
}

.tp-remove-coupon {
    background: none;
    border: none;
    color: #d32f2f;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.tp-remove-coupon:hover {
    background: #ffebee;
    color: #b71c1c;
}

.tp-coupon-form {
    position: relative;
}

.tp-coupon-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.tp-coupon-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid var(--tp-cart-border, #e0e0e0);
    border-radius: 25px;
    font-size: 14px;
    background: white;
    transition: all 0.2s ease;
    outline: none;
}

.tp-coupon-input:focus {
    border-color: var(--tp-cart-count-bg, #e74c3c);
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.tp-coupon-input::placeholder {
    color: #999;
    font-style: italic;
}

.tp-apply-coupon-btn {
    background: var(--tp-cart-count-bg, #e74c3c);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 80px;
    justify-content: center;
}

.tp-apply-coupon-btn:hover {
    background: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.tp-apply-coupon-btn.tp-loading {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.tp-apply-coupon-btn.tp-loading .tp-coupon-btn-text {
    opacity: 0.5;
}

.tp-coupon-btn-icon {
    font-size: 16px;
}

.tp-coupon-message {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}

.tp-coupon-message.tp-success {
    background: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #4caf50;
}

.tp-coupon-message.tp-error {
    background: #ffebee;
    color: #d32f2f;
    border: 1px solid #f44336;
}

/* RTL support for coupon section */
body.rtl .tp-coupon-input-wrapper {
    direction: rtl;
}

body.rtl .tp-coupon-info {
    flex-direction: row-reverse;
}

/* Mobile adjustments for coupon section and dynamic heights */
@media (max-width: 768px) {
    .tp-coupon-section {
        margin: 10px 0;
        padding: 12px;
    }

    /* More aggressive space management on mobile */
    .tp-side-cart-content {
        min-height: 150px;
    }

    .tp-side-cart-footer {
        max-height: 70vh; /* Allow more space for footer on mobile */
    }

    /* Auto-collapse sections on mobile */
    .tp-product-suggestions,
    .tp-coupon-section {
        margin: 8px 0;
        padding: 10px;
    }

    .tp-product-suggestions.tp-collapsed,
    .tp-coupon-section.tp-collapsed {
        margin: 5px 0;
        padding: 8px 10px;
    }

    .tp-coupon-input-wrapper {
        flex-direction: column;
        gap: 10px;
    }

    .tp-apply-coupon-btn {
        width: 100%;
        justify-content: center;
    }

    .tp-coupon-item {
        padding: 10px;
    }

    .tp-coupon-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* Empty Cart Custom Content Styles */
.custom-empty-banner {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 15px;
}

.custom-empty-banner h3 {
    margin: 0 0 5px 0;
    font-size: 18px;
}

.custom-empty-banner p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
}

.empty-cart-promo {
    text-align: center;
    margin-bottom: 15px;
}

.empty-cart-promo img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.custom-empty-icon {
    text-align: center;
    margin-bottom: 10px;
}

.custom-empty-icon img {
    width: 60px;
    height: 60px;
    opacity: 0.7;
}

.icon-decoration {
    text-align: center;
    font-size: 24px;
    margin-top: 10px;
}

.personalized-message {
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 6px;
    border-left: 4px solid var(--tp-cart-count-bg, #e74c3c);
    margin-bottom: 15px;
    font-weight: 500;
}

.quick-categories {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.quick-categories h5 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #666;
}

.quick-categories a {
    display: inline-block;
    background: white;
    color: var(--tp-cart-count-bg, #e74c3c);
    padding: 4px 8px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
    margin-right: 5px;
    margin-bottom: 5px;
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease;
}

.quick-categories a:hover {
    background: var(--tp-cart-count-bg, #e74c3c);
    color: white;
}

.empty-cart-contact {
    text-align: center;
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
}

.empty-cart-contact p {
    margin: 0;
    font-size: 13px;
    color: #666;
}

.empty-cart-contact a {
    color: var(--tp-cart-count-bg, #e74c3c);
    text-decoration: none;
    font-weight: 500;
}

.newsletter-signup {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

.newsletter-signup h5 {
    margin: 0 0 10px 0;
    font-size: 16px;
}

.newsletter-signup form {
    display: flex;
    gap: 8px;
}

.newsletter-signup input {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
}

.newsletter-signup button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.newsletter-signup button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.recently-viewed-intro {
    text-align: center;
    margin-bottom: 15px;
}

.recently-viewed-intro h4 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.featured-products-empty {
    margin-top: 20px;
}

.featured-products-empty h5 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #666;
    text-align: center;
}

.empty-cart-footer {
    background: #e8f5e8;
    color: #2e7d32;
    padding: 12px;
    border-radius: 6px;
    text-align: center;
    margin-top: 15px;
    border: 1px solid #4caf50;
}

.empty-cart-footer p {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
}

.social-proof {
    background: #fff3cd;
    color: #856404;
    padding: 10px;
    border-radius: 6px;
    text-align: center;
    margin-top: 10px;
    border: 1px solid #ffeaa7;
}

.social-proof p {
    margin: 0;
    font-size: 13px;
    font-weight: 500;
}

/* Mobile adjustments for custom empty cart content */
@media (max-width: 768px) {
    .newsletter-signup form {
        flex-direction: column;
    }

    .newsletter-signup input,
    .newsletter-signup button {
        width: 100%;
    }

    .quick-categories a {
        display: block;
        margin-bottom: 8px;
        text-align: center;
    }
}

/* Print styles */
@media print {
    .tp-side-cart,
    .tp-side-cart-overlay,
    .tp-side-cart-trigger,
    .tp-fixed-cart-icon-wrapper,
    .tp-coupon-section {
        display: none !important;
    }
}