.cart__modal {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  max-width: 500px;
  background: #fff;
  box-shadow: -4px 0 15px rgba(0, 0, 0, 0.2);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 15;
  display: flex;
  flex-direction: column;
  padding: clamp(1.5rem, 2vw, 2rem);
}

.cart__modal.active {
    transform: translateX(0);
}

.cart__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart__title {
  font-size: 20px;
  font-weight: 600;
}

.cart__close {
  display: flex;
  align-items: center;
  padding: 0 clamp(1rem, 1.5vw, 1.6rem);
  background: none;
  color: var(--gray-soft);
  border: 1px solid var(--border-color);
  font-size: 20px;
}

.cart__items {
  flex: 1;
  overflow-y: auto;
  margin-top: clamp(1rem, 3vw, 4.5rem);
}

.cart__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.8rem;
    gap: 0.8rem;
}

.cart__item-image-block {
    flex-basis: 6rem;
    flex-shrink: 0;
    max-width: 6rem;
    max-height: 6rem;
}

.cart__item-image-block img {
    width: 100%;
    height: 100%;
}

.cart__item-name-price-block {
    flex-grow: 1;
}

.cart__item-name {
    font-weight: 600;
    font-size: 1.6rem;
    margin-bottom: 0.8rem;
}

.cart__item-price {
    font-weight: 400;
    font-size: 1.4rem;
}

.cart__item-delete-icon {
    width: 2.4rem;
    height: 2.4rem;
}

.cart__item-qty {
    display: flex;
    align-items: center;
}

.cart__item-qty button {
    width: 2.4rem;
    height: 2.4rem;
    border: none;
    background: #ddd;
    cursor: pointer;
}

.cart__item-qty input {
    width: 3rem;
    height: 2.4rem;
    text-align: center;
    border: none;
    background: #f5f5f5;
}

.cart__promo {
    display: block;
    margin-top: 0.8rem;
    margin-bottom: 0.8rem;
    border: 1px solid #eee;
    padding: 0.8rem;
    border-radius: 0;
    background: rgba(224, 221, 230, 0.56);
}

.cart__promo input {
    flex: 1;
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 0;
    height: 3.2rem;
    box-sizing: border-box;
}

.cart__promo button {
    background: var(--accent-color);
    color: #fff;
    border: none;
    padding: 0.8rem;
    border-radius: 0;
    cursor: pointer;
    height: 3.2rem;
    box-sizing: border-box;
}

.cart__total {
    display: flex;
    flex-direction: column;
    margin-top: 0.8rem;
    font-weight: 600;
    border-top: 1px solid #eee;
    padding-top: 0.8rem;
}

.cart__count,
.cart__total-row,
.cart__total > .cart__total {
    display: flex;
    justify-content: space-between;
    margin-top: 0.8rem;
}

.cart__total-row {
    font-size: 1.2rem;
    color: #555;
}

.cart__total > .cart__total {
    font-size: 1.6rem;
    font-weight: bold;
    margin-top: 0.8rem;
}

.cart__count {
    font-weight: 600;
}


.cart__bonus {
    width: 100%;
    background: var(--accent-color);
    color: #fff;
    border: none;
    padding: 0.8rem;
    margin-top: 0.8rem;
    border-radius: 0;
    cursor: pointer;
}

.cart__checkbox {
    display: flex;
    align-items: flex-start;
    margin-top: 0.8rem;
    font-size: 1.3rem;
}

.cart__checkbox input {
    margin-right: 0.8rem;
    margin-top: 0.2rem;
}

.cart__checkout {
    width: 100%;
    background: var(--accent-color);
    color: #fff;
    border: none;
    padding: 0.8rem;
    margin-top: 0.8rem;
    border-radius: 0;
    cursor: pointer;
}

.cart__checkout:disabled {
    background-color: #e0e0e0;
    color: #a0a0a0;
    cursor: not-allowed;
}

.cart__checkout:disabled:hover {
    background-color: #e0e0e0;
}

.cart__cubes-form {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.cart__cubes-input-wrapper {
    display: flex;
}

.cart__cubes-input-wrapper input[type="number"] {
    flex: 1;
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-right: none;
    border-radius: 0;
    height: 3.2rem;
    box-sizing: border-box;
}

.cart__cubes-input-wrapper button {
    background: var(--accent-color);
    color: #fff;
    border: none;
    padding: 0.8rem;
    border-radius: 0;
    cursor: pointer;
    height: 3.2rem;
    box-sizing: border-box;
}

.cart__cubes {
    border: 1px solid #eee;
    padding: 0.8rem;
    border-radius: 0;
    margin-top: 0.8rem;
}

.cart__promo-cubes-container {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.cart__promo-side,
.cart__cubes-side {
    width: 100%;
}

.cart__promo-form {
    display: flex;
}

.cart__promo-applied,
.cart__cubes-applied {
    background-color: #f5f5f5;
    border: 1px solid #eee;
    border-radius: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 3.2rem;
    box-sizing: border-box;
}

.cart__promo-remove,
.cart__cubes-remove {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #aaa;
}

.cart__cubes-login p {
     font-size: 1.4rem;
    margin: 0;
    padding: 0.8rem;
    background-color: #f5f5f5;
    border: 1px solid #eee;
    border-radius: 0;
}

.cart__promo-applied-text,
.cart__cubes-applied-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
    padding-right: 0.8rem;
}

.cart__promo-title {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
}

/* --- Button Hover Effects --- */

/* Transitions for all buttons */
.cart__close,
.cart__item-delete,
.cart__item-qty button,
.cart__promo button,
.cart__bonus,
.cart__checkout,
.cart__cubes-input-wrapper button,
.cart__promo-remove,
.cart__cubes-remove {
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

/* Hover styles for buttons with background */
.cart__promo button:hover,
.cart__bonus:hover,
.cart__checkout:hover,
.cart__cubes-input-wrapper button:hover,
.cart__item-qty button:hover {
    background-color: var(--accent-color);
}

/* Hover styles for text/icon buttons */
.cart__close:hover {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.cart__item-delete:hover,
.cart__promo-remove:hover,
.cart__cubes-remove:hover {
    color: var(--accent-color);
}

.cart-error-message {
    color: #dc3545;
    font-size: 1.4rem;
    margin-top: 0.8rem;
    text-align: left;
    padding: 0.4rem 0.8rem;
    background-color: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.2);
    border-radius: 0.4rem;
}

.header__controls-cart {
    position: relative;
}

.cart-count {
    position: absolute;
    top: -0.2rem;
    right: -0.7rem;
    background-color: var(--accent-color);
    color: whitesmoke;
    border-radius: 10px;
    padding: 0.2rem 0.6rem;
    font-size: 0.9rem;
    display: none; 
}

.cart-count.active {
    display: block;
}
