/**
 * Cart Styles for Psy'd Works
 * Styles for cart button, badge, and cart modal
 */

/* Ensure all nav items are vertically centered */
.nav-links {
    align-items: center !important;
}

.nav-links li {
    display: flex;
    align-items: center;
}

/* Cart Button in Header */
.cart-btn-container {
    position: relative;
    display: flex;
    align-items: center;
}

.cart-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: var(--text-dark);
    text-decoration: none;
    transition: color 0.3s;
}

.cart-btn:hover {
    color: var(--accent-color);
}

.cart-btn:hover .cart-icon svg {
    fill: var(--accent-color);
}

.cart-btn .cart-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
}

.cart-btn .cart-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
    transition: fill 0.3s;
}

.cart-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Cart Modal */
.cart-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.cart-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.cart-modal-content {
    position: relative;
    background: var(--bg-white);
    border-radius: 15px;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
    z-index: 10001;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cart-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
}

.cart-modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-dark);
}

.cart-modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
}

.cart-modal-close:hover {
    color: var(--text-dark);
}

.cart-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 25px;
}

.cart-modal-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.cart-modal-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: var(--bg-light);
    border-radius: 10px;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-white);
}

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

.cart-item-image .no-image {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e0e0e0 0%, #f5f5f5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.cart-item-details h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-dark);
    font-weight: 600;
}

.cart-item-quantity {
    font-size: 0.875rem;
    color: var(--text-light);
    margin: 0;
}

.cart-item-price {
    font-size: 0.875rem;
    color: var(--text-light);
    margin: 0;
}

.cart-item-subtotal {
    display: flex;
    align-items: center;
    font-weight: 600;
    color: var(--accent-color);
    font-size: 1.1rem;
}

.cart-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

.cart-empty-state p {
    font-size: 1.1rem;
}

.cart-modal-summary {
    border-top: 2px solid var(--border-color);
    padding-top: 15px;
    margin-top: 15px;
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 0.95rem;
    color: var(--text-dark);
}

.cart-summary-row.cart-total {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    margin-top: 10px;
}

.cart-modal-footer {
    padding: 20px 25px;
    border-top: 1px solid var(--border-color);
}

/* Button Styles for Cart Modal */
.btn {
    padding: 12px 32px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
    display: inline-block;
    font-size: 1rem;
    border: none;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    color: white;
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(123, 97, 255, 0.3);
}

.btn-block {
    width: 100%;
    text-align: center;
    display: block;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .cart-modal-content {
        max-width: 100%;
        max-height: 90vh;
        margin: 10px;
    }

    .cart-modal-header h3 {
        font-size: 1.25rem;
    }

    .cart-item-image {
        width: 60px;
        height: 60px;
    }

    .cart-item-details h4 {
        font-size: 0.9rem;
    }

    .cart-item-quantity,
    .cart-item-price {
        font-size: 0.8rem;
    }

    .cart-item-subtotal {
        font-size: 1rem;
    }
}
