/**
 * Cart Off-Canvas Styles
 * Sympla/Eventbrite style side cart
 * 
 * @package Gevents
 */

/* ============================================
   OFF-CANVAS CONTAINER
   ============================================ */

.gevents-cart-offcanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gevents-cart-offcanvas.active {
    pointer-events: all;
    opacity: 1;
}

/* Overlay */
.cart-offcanvas-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gevents-cart-offcanvas.active .cart-offcanvas-overlay {
    opacity: 1;
}

/* Panel */
.cart-offcanvas-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 480px;
    height: 100%;
    background: #fff;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gevents-cart-offcanvas.active .cart-offcanvas-panel {
    transform: translateX(0);
}

/* Prevent body scroll when open */
body.cart-offcanvas-open {
    overflow: hidden;
}

/* ============================================
   HEADER
   ============================================ */

.cart-offcanvas-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    flex-shrink: 0;
}

.cart-offcanvas-title {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
}

.cart-offcanvas-title svg {
    color: var(--primary-color);
}

.cart-offcanvas-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s ease;
}

.cart-offcanvas-close:hover {
    background: #e5e7eb;
    color: var(--text-color);
}

/* ============================================
   BODY / CONTENT
   ============================================ */

.cart-offcanvas-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    position: relative;
}

/* Loading State */
.cart-offcanvas-loading {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    gap: 1rem;
}

.cart-offcanvas-loading .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.cart-offcanvas-loading p {
    font-size: 0.875rem;
    color: var(--text-light);
    margin: 0;
}

/* Cart Items List */
.cart-items-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cart-offcanvas-item {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 1rem;
    align-items: flex-start;
    background: #f9fafb;
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.cart-offcanvas-item.removing {
    opacity: 0.5;
    pointer-events: none;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cart-item-name {
    font-size: 0.9375rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-color);
    line-height: 1.4;
}

.cart-item-variation {
    font-size: 0.8125rem;
    color: var(--text-light);
    margin: 0;
}

.cart-item-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
}

.cart-item-quantity {
    color: var(--text-light);
}

.cart-item-price {
    font-weight: 700;
    color: var(--primary-color);
}

.cart-item-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #dc2626;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.cart-item-remove:hover {
    background: #fee2e2;
    color: #991b1b;
}

/* Empty Cart Message */
.cart-empty-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
}

.cart-empty-message svg {
    color: #d1d5db;
    margin-bottom: 1rem;
}

.cart-empty-message p {
    font-size: 1rem;
    color: var(--text-light);
    margin: 0 0 1.5rem 0;
}

.btn-continue-shopping {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
}

.btn-continue-shopping:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Error Message */
.cart-error-message {
    padding: 2rem 1rem;
    text-align: center;
}

.cart-error-message p {
    font-size: 0.9375rem;
    color: #dc2626;
    margin: 0;
}

/* ============================================
   FOOTER
   ============================================ */

.cart-offcanvas-footer {
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    flex-shrink: 0;
}

.cart-footer-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.total-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
}

.total-value {
    text-align: right;
}

.total-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.total-main {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.total-detail {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 400;
    line-height: 1.3;
}

.btn-goto-cart {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-goto-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* ============================================
   NOTIFICATION SYSTEM
   ============================================ */

.gevents-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    background: #10b981;
    color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 0.9375rem;
    font-weight: 600;
    z-index: 1000000;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.gevents-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.gevents-notification.error {
    background: #ef4444;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 640px) {
    .cart-offcanvas-panel {
        max-width: 100%;
    }

    .cart-offcanvas-header {
        padding: 1rem;
    }

    .cart-offcanvas-title {
        font-size: 1.125rem;
    }

    .cart-offcanvas-body {
        padding: 1rem;
    }

    .cart-offcanvas-item {
        grid-template-columns: 64px 1fr auto;
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .cart-item-image {
        width: 64px;
        height: 64px;
    }

    .cart-item-name {
        font-size: 0.875rem;
    }

    .cart-item-variation {
        font-size: 0.75rem;
    }

    .cart-item-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
        font-size: 0.8125rem;
    }

    .cart-offcanvas-footer {
        padding: 1rem;
    }

    .total-value {
        font-size: 1.25rem;
    }

    .btn-goto-cart {
        padding: 0.875rem 1.25rem;
        font-size: 0.9375rem;
    }

    .gevents-notification {
        right: 10px;
        left: 10px;
        top: 10px;
        padding: 0.875rem 1.25rem;
        font-size: 0.875rem;
    }
}
