/**
 * Rose Ticketing Cart - Clean CSS
 */

/* Cart Link Button in Header */
.rose-cart-toggle-header {
    position: relative;
    width: auto;
    height: auto;
    min-width: auto;
    min-height: auto;
    background: transparent;
    color: var(--color-white, #FFFFFF); /* White icon on desktop header */
    border: 2px solid var(--color-white, #FFFFFF); /* White border on desktop */
    border-radius: 0;
    cursor: pointer;
    box-shadow: none;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, color 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
    margin-left: 15px;
    flex-shrink: 0;
    box-sizing: border-box;
    pointer-events: auto;
    isolation: isolate;
    text-decoration: none; /* Remove underline from link */
}

.rose-cart-toggle-header:hover {
    transform: scale(1.05);
    background-color: var(--color-white, #FFFFFF);
    color: var(--color-primary, #EC234A); /* Red icon on white background on hover */
    border-color: var(--color-white, #FFFFFF);
    text-decoration: none;
}

.rose-cart-icon {
    position: relative;
    display: inline-block;
    /* Fixed size to prevent layout shifts */
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    /* Ensure icon doesn't block clicks */
    pointer-events: none;
    z-index: 1;
    color: var(--color-white, #FFFFFF); /* White icon on desktop */
    fill: none;
    stroke: currentColor;
}

.rose-cart-toggle-header:hover .rose-cart-icon {
    color: var(--color-primary, #EC234A); /* Red icon on hover */
    stroke: var(--color-primary, #EC234A);
}

/* Mobile: keep original red color */
@media only screen and (max-width: 768px) {
    .rose-cart-toggle-header {
        color: var(--color-primary, #EC234A);
        border-color: var(--color-primary, #EC234A);
    }
    
    .rose-cart-icon {
        color: var(--color-primary, #EC234A);
    }
    
    .rose-cart-toggle-header:hover {
        background-color: transparent;
        color: var(--color-primary-dark, #A01A3A);
        border-color: var(--color-primary-dark, #A01A3A);
    }
    
    .rose-cart-toggle-header:hover .rose-cart-icon {
        color: var(--color-primary-dark, #A01A3A);
        stroke: var(--color-primary-dark, #A01A3A);
    }
}

/* Cart count badge - absolutely positioned, doesn't affect layout */
.rose-cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff0000;
    color: #ffffff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    min-width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    border: 2px solid #ffffff;
    box-sizing: border-box;
    /* Ensure badge doesn't affect layout */
    pointer-events: none;
}

.rose-cart-count:empty {
    display: none;
}

.rose-cart-toggle-header .rose-cart-count {
    top: -3px;
    right: -3px;
    width: 18px;
    height: 18px;
    min-width: 18px;
    font-size: 10px;
    border-width: 1.5px;
}

/* Cart Overlay */
/* CRITICAL: position: fixed removes from document flow - no layout impact */
#rose-cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
    /* Position fixed = removed from document flow = no layout impact */
    transform: translateZ(0); /* Force hardware acceleration */
    will-change: opacity, visibility;
}

#rose-cart-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Cart Sidebar */
.rose-cart-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 450px;
    height: 100%;
    background: #ffffff;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
    overflow: hidden;
}

#rose-cart-overlay.active .rose-cart-sidebar {
    right: 0;
}

/* Cart Header */
.rose-cart-header {
    padding: 20px;
    border-bottom: 2px solid var(--color-primary, #cc4534);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--color-primary, #cc4534);
    color: #ffffff;
}

.rose-cart-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.rose-cart-close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    line-height: 1;
}

.rose-cart-close:hover {
    transform: rotate(90deg);
}

/* Cart Body */
.rose-cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.rose-cart-empty {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.rose-cart-items {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Cart Item */
.rose-cart-item {
    display: flex;
    gap: 15px;
    padding: 15px;

    border-radius: 8px;

}

.rose-cart-item-image {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    background: #e0e0e0;
}

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

.rose-cart-item-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: bold;
    color: #999;
    background: #e0e0e0;
}

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

.rose-cart-item-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

.rose-cart-item-tier {
    margin: 0;
    font-size: 0.875rem;
    color: #666;
}

.rose-cart-item-date {
    margin: 0;
    font-size: 0.875rem;
    color: #666;
}

.rose-cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rose-cart-item-quantity label {
    font-size: 0.875rem;
    color: #666;
}

.rose-quantity-controls {
    display: flex;
    align-items: center;
    gap: 5px;
}

.rose-quantity-btn {
    width: 30px;
    height: 30px;
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.rose-quantity-btn:hover {
    background: var(--color-primary, #cc4534);
    color: #ffffff;
    border-color: var(--color-primary, #cc4534);
}

.rose-quantity-input {
    width: 50px;
    height: 30px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.875rem;
}

.rose-cart-item-price {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.rose-price-per-ticket {
    font-size: 0.875rem;
    color: #666;
}

.rose-item-subtotal {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-primary, #cc4534);
}

.rose-cart-item-remove {
    margin-top: 8px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid #dc3545;
    color: #dc3545;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    align-self: flex-start;
}

.rose-cart-item-remove:hover {
    background: #dc3545;
    color: #ffffff;
}

/* Cart Footer */
.rose-cart-footer {
    padding: 20px;
    border-top: 2px solid #e0e0e0;
    background: #f9f9f9;
}

.rose-cart-total {
    margin-bottom: 15px;
    font-size: 1.25rem;
    text-align: center;
    padding: 15px;
    background: #ffffff;
    border-radius: 6px;
}

.rose-cart-total strong {
    color: #333;
}

#rose-cart-total-amount {
    color: var(--color-primary, #cc4534);
    font-size: 1.5rem;
}

.rose-cart-checkout-btn {
    display: block;
    width: 100%;
    padding: 15px;
    background: var(--color-primary, #cc4534);
    color: #ffffff;
    text-align: center;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.rose-cart-checkout-btn:hover {
    background: #a8382a;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Cart Messages */
.rose-cart-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 6px;
    color: #ffffff;
    font-weight: 600;
    z-index: 10001;
    opacity: 0;
    transform: translateX(400px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    max-width: 350px;
}

.rose-cart-message.show {
    opacity: 1;
    transform: translateX(0);
}

.rose-cart-message-success {
    background: #28a745;
}

.rose-cart-message-error {
    background: #dc3545;
}

/* Body lock when cart is open - ONLY when overlay is active */
/* This prevents any layout changes when cart is closed */
body.rose-cart-open {
    overflow: hidden !important;
    position: relative;
}

/* Ensure body is normal when cart is closed (even if class exists) */
body:not(.rose-cart-open) {
    overflow: auto;
}

/* Go to Top Button */
.rose-go-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--color-primary, #cc4534);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
}

.rose-go-to-top.show {
    opacity: 1;
    visibility: visible;
}

.rose-go-to-top:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
    .rose-cart-sidebar {
        max-width: 100%;
    }
    
    .rose-cart-toggle-header {
        width: auto;
        height: auto;
        padding: 6px;
        margin-left: 10px;
    }
    
    .rose-cart-icon {
        width: 20px;
        height: 20px;
    }
    
    .rose-go-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
    
    .rose-cart-message {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    /* Cart page mobile styles */
    .cart-item {
        flex-direction: row !important;
        gap: 12px !important;
        padding: 12px !important;
        margin-bottom: 12px !important;
    }
    
    .cart-item-image {
        width: 80px !important;
        height: 80px !important;
        min-width: 80px !important;
        flex-shrink: 0 !important;
    }
    
    .cart-item-image img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        display: block !important;
    }
    
    .cart-item-details {
        flex: 1 !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }
    
    .cart-item-details h3 {
        font-size: 1rem !important;
        line-height: 1.3 !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        hyphens: auto !important;
    }
    
    .cart-item-details p {
        font-size: 0.85rem !important;
        line-height: 1.4 !important;
        margin: 3px 0 !important;
    }
    
    .cart-item-quantity {
        margin: 8px 0 !important;
        gap: 6px !important;
    }
    
    .cart-item-quantity label {
        font-size: 0.85rem !important;
    }
    
    .cart-item-remove {
        margin-bottom: 15px !important;
        padding: 5px 10px !important;
        font-size: 0.8rem !important;
    }
    
    .quantity-controls {
        gap: 3px !important;
    }
    
    .quantity-btn {
        width: 26px !important;
        height: 26px !important;
        font-size: 14px !important;
    }
    
    .quantity-input {
        width: 45px !important;
        height: 26px !important;
        font-size: 0.85rem !important;
    }
    
    .item-subtotal {
        font-size: 0.95rem !important;
        white-space: nowrap !important;
    }
}
