/* Shopping Cart Styles - GeMarkt Red Theme */

/* Cart Icon in Navbar */
.cart-icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    color: var(--color-gray-700, #374151);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 50%;
}

.cart-icon-btn:hover {
    background: rgba(255, 31, 31, 0.1);
    color: #FF1F1F;
}

.cart-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    background: #FF1F1F;
    color: white;
    font-size: 11px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.cart-badge.has-items {
    opacity: 1;
    transform: scale(1);
}

/* Cart Notification Toast - Red Theme */
.cart-notification {
    position: fixed;
    bottom: 100px;
    right: 30px;
    background: linear-gradient(135deg, #FF1F1F 0%, #cc1919 100%);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(255, 31, 31, 0.4);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.cart-notification.show {
    transform: translateY(0);
    opacity: 1;
}

.cart-notification i {
    font-size: 20px;
}

/* Cart Overlay */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cart-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Cart Sidebar - Red Theme */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -420px;
    width: 400px;
    max-width: 100vw;
    height: 100vh;
    background: #fff;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cart-sidebar.open {
    right: 0;
}

.cart-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: linear-gradient(135deg, #FF1F1F 0%, #cc1919 100%);
    color: white;
}

.cart-sidebar-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white !important;
}

.cart-sidebar-header h3 i {
    color: white !important;
}

.cart-sidebar-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.cart-sidebar-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.cart-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Empty Cart */
.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #9ca3af;
    text-align: center;
}

.cart-empty i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.cart-empty p {
    font-size: 16px;
    margin: 0;
}

/* Cart Items */
.cart-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.cart-item:hover {
    background: #f3f4f6;
}

.cart-item-image {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.cart-item-details {
    flex: 1;
    min-width: 0;
}

.cart-item-title {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 8px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    color: #FF1F1F;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.qty-btn:hover {
    background: #FF1F1F;
    color: white;
    border-color: #FF1F1F;
}

.qty-input {
    width: 50px;
    height: 28px;
    text-align: center;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    appearance: textfield;
    -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.qty-input:focus {
    outline: none;
    border-color: #FF1F1F;
}

.cart-item-remove {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 16px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.cart-item-remove:hover {
    background: #fef2f2;
}

/* Cart Footer */
.cart-sidebar-footer {
    padding: 20px 24px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.cart-total-count {
    font-size: 14px;
    color: #6b7280;
}

.btn-checkout {
    display: block;
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #FF1F1F 0%, #cc1919 100%);
    color: white;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

.btn-checkout:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 31, 31, 0.3);
}

.btn-continue {
    display: block;
    width: 100%;
    padding: 12px 20px;
    background: transparent !important;
    color: #FF1F1F !important;
    border: 2px solid #FF1F1F !important;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-continue:hover {
    background: #FF1F1F !important;
    color: white !important;
}

/* Body scroll lock when cart is open */
body.cart-open {
    overflow: hidden;
}

/* Responsive Design - Mobile First */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .cart-sidebar {
        width: 350px;
    }

    .cart-item-image {
        width: 75px;
        height: 75px;
    }

    /* Increase touch targets */
    .qty-btn,
    .cart-item-remove {
        min-width: 44px;
        min-height: 44px;
    }

    .cart-sidebar-close {
        width: 44px;
        height: 44px;
    }
}

/* Mobile Phones (< 768px) */
@media (max-width: 768px) {
    .cart-sidebar {
        width: 100%;
        right: auto;
        left: 0;
        top: auto;
        bottom: -100%;
        height: 85vh;
        max-height: 85vh;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
        transition: bottom 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .cart-sidebar.open {
        bottom: 0;
        right: auto;
    }

    /* Larger images on mobile */
    .cart-item-image {
        width: 80px;
        height: 80px;
    }

    .cart-item {
        padding: 16px;
        gap: 16px;
    }

    /* Better spacing */
    .cart-sidebar-content {
        padding: 24px 20px;
    }

    .cart-sidebar-footer {
        padding: 24px 20px;
        padding-bottom: calc(24px + env(safe-area-inset-bottom));
    }

    /* Larger text for readability */
    .cart-item-title {
        font-size: 15px;
    }

    /* Touch-friendly controls */
    .qty-btn {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    .qty-input {
        width: 60px;
        height: 44px;
        font-size: 16px;
    }

    .cart-item-remove {
        min-width: 44px;
        min-height: 44px;
        padding: 12px;
    }

    /* Better footer buttons */
    .btn-checkout,
    .btn-continue {
        padding: 16px 24px;
        font-size: 16px;
    }

    /* Header with drag indicator */
    .cart-sidebar-header {
        position: relative;
        padding: 24px 20px;
    }

    .cart-sidebar-header::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: rgba(255, 255, 255, 0.4);
        border-radius: 2px;
    }

    .cart-notification {
        left: 16px;
        right: 16px;
        bottom: calc(16px + env(safe-area-inset-bottom));
        font-size: 15px;
    }
}

/* Small Phones (< 480px) */
@media (max-width: 480px) {
    .cart-sidebar {
        height: 90vh;
        max-height: 90vh;
    }

    .cart-item {
        flex-direction: row;
        align-items: flex-start;
    }

    .cart-item-details {
        flex: 1;
    }

    /* Stack quantity controls */
    .cart-item-quantity {
        flex-wrap: wrap;
    }
}

/* Landscape mode on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .cart-sidebar {
        height: 95vh;
        max-height: 95vh;
    }

    .cart-sidebar-content {
        padding: 16px;
    }

    .cart-items {
        max-height: 50vh;
        overflow-y: auto;
    }
}