.btn-loader {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
  margin-right: 8px;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.cart-button,
.cart-button-mob {
    position: relative;
    background: #e2ecfd;
    border: 1px solid #a9c9f9;
    cursor: pointer;
    display: flex;
    align-items: center;
    border-radius: 50%;
    padding: 0.5rem;
}

.cart-button:hover {
	color: #3B82F6;
}

.cart-badge {
	font-family: 'Inter';
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ff3d3d;
    color: white;
    font-size: 0.6rem;
    font-weight: bold;
    min-width: 1rem;
    height: 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.15rem;
    line-height: 1;
}

.cart-badge:empty {
  display: none;
}

.cart-modal {
    position: fixed;
    inset: 0;
    background: #3b82f652;
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: flex-end;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
	z-index: 10000;
}

.cart-modal.active {
    opacity: 1;
    visibility: visible;
}

.cart-content {
    background: #ffffff;
    width: 40%;
    max-width: 100%;
    height: 100%;
    border-radius: 0.5rem 0 0 0.5rem;
    box-shadow: -4px 0 20px #3b82f682;
    transform: translateX(100%);
    transition: transform 0.4s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cart-modal.active .cart-content {
    transform: translateX(0);
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px 15px;
    border-bottom: 1px solid #3b82f612;
}

.cart-header h2 {
    margin: 0;
    font-size: 2.2rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #3B82F6;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-items-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 0.8rem;
}

.cart-item {
    position: relative;
	display: flex;
	align-items: flex-start;
    padding: 1rem 0;
    border-bottom: 1px solid #3b82f612;
    gap: 1rem;
}

.cart-item-img {
	width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 0.5rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    flex-shrink: 0;
}

.cart-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.cart-item-title {
    font-size: 1rem;
    font-weight: bold;
    margin: 0 0 0.8rem 0;
    width: 85%;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.quantity-controls {
    display: flex;
    align-items: center;
    overflow: hidden;
}

.quantity-btn {
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 600;
    background: none;
    color: #3B82F6;
    border: none;
}

.quantity-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.quantity-number {
	border: 1px solid #d2d2d2;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 1.2rem;
    font-weight: 600;
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
}

.cart-item-price {
    font-size: 1.2rem;
    font-weight: bold;
    white-space: nowrap;
}

.remove-item-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #999;
    cursor: pointer;
    position: absolute;
    right: 0;
    top: 9px;
}

.remove-item-btn:hover {
    color: #f44;
}

#cart-items:empty::after {
    content: "Кошик порожній";
    display: block;
    text-align: center;
    padding: 2rem;
    color: #999;
    font-size: 1.2rem;
}

.cart-footer {
    padding: 1.1rem 1.1rem 0 1.1rem;
    font-size: 1.5rem;
    border-top: 1px solid #3b82f612;
}

.cart-actions {
    padding: 1.1rem;
}

.order-btn {
   font-family: 'Montserrat';
   width: 100%;
   background: #3B82F6;
   color: #fff;
   border: none;
   padding: 10px 15px;
   font-size: 1.2rem;
   cursor: pointer;
   border-radius: 0.5rem;
   font-weight: 600;
}

@media (max-width: 768px) {
	.cart-header h2 {
        font-size: 2rem;
    }
}

@media (max-width: 500px) {
	.cart-content {
		width: 100%;
		box-shadow: none;
	}
	
	.cart-modal {
		background: none;
	}
	
    .cart-button-mob {
        padding: 0.35rem 0.5rem;
	}
}

@media screen and (min-width: 500px) and (max-width: 1024px) {
	.cart-content {
		width: 60%;
	}
}