/* ============================= */
/*          CARRITO CSS          */
/* ============================= */

/* Barra del carrito fija */
.cart-bar {
  position: fixed;
  top: 0;
  right: 0;
  width: auto;
  min-width: 60px;	
  max-width: 150px;
  height: 40px;
  background-color: #c0392b;
  color: white;
  padding: 5px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  border-radius: 10px;
  z-index: 1000;
  transition: transform 0.2s ease;
}

/* Icono del carrito */
.cart-bar .icon {
  font-size: 18px;
  width: 30px;
  height: 30px;
  margin-left: 5px;
  border-radius: 50%;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.cart-bar .icon i {
  font-size: 16px;
}

.cart-bar .icon:hover {
  background-color: #ff4d4d;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Contenido interno */
.cart-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-direction: row-reverse;
  width: 100%;
}

.cart-icon {
  margin-left: 10px;
}

#cart-count {
  font-size: 20px;
  margin-right: 6px;
  font-weight: bold;
}

/* Visibilidad */
.hidden { display: none; }
.visible { display: block; }

/* Sidebar carrito */
.cart-menu {
  display: none;
  position: fixed;
  right: 0;
  top: 0;
  width: 300px;
  height: 95vh;
  background-color: aliceblue;
  box-shadow: -3px 0 8px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform 0.3s ease-in-out;
  z-index: 1000;
}

.cart-menu.open {
  display: block;
  transform: translateX(0);
}

/* Header carrito */
.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background-color: darkred;
  border-bottom: 2px solid white;
}

.cart-title {
  font-size: 20px;
  font-weight: bold;
  color: white;
}

.close-cart {
  font-size: 20px;
  color: white;
  cursor: pointer;
  transition: color 0.3s ease;
}

.close-cart:hover {
  color: red;
}

/* Lista productos */
.cart-items-list {
  max-height: 360px;
  overflow-y: auto;
  padding: 15px;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #e0e0e0;
  font-size: 14px;
}

.cart-item .product-name {
  flex: 1;
  font-size: 15px;
}

.cart-item .product-price {
  color: red;
  font-weight: bold;
  font-size: 15px;
}

/* Resumen carrito */
.cart-summary {
  position: absolute;
  bottom: 0;
  width: 100%;
  padding: 15px;
  background-color: darkkhaki;
  box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.15);
  font-weight: bold;
}

/* Botones */
.cart-button {
  width: 100%;
  padding: 10px;
  background-color: #3498db;
  color: aliceblue;
  border: none;
  cursor: pointer;
  margin-top: 10px;
  text-align: center;
  transition: background 0.3s ease;
}

.cart-button:hover {
  background-color: #2120b9;
}

/* Overlay */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  display: none;
}

.overlay.active {
  display: block;
}

/* ============================= */
/*           RESPONSIVE          */
/* ============================= */

@media (max-width: 1024px) {
  .cart-bar {
    width: 10%;
    max-width: 120px;
  }

  #cart-count {
    font-size: 18px;
  }

  .cart-bar .icon {
    width: 28px;
    height: 28px;
  }

  .cart-bar .icon i {
    font-size: 14px;
  }
}

@media (max-width: 768px) {
  .cart-bar {
    width: 15%;
    max-width: 100px;
  }

  #cart-count {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .cart-bar {
    width: 20%;
    max-width: 80px;
  }

  #cart-count {
    font-size: 14px;
  }

  .cart-bar .icon {
    width: 24px;
    height: 24px;
  }

  .cart-bar .icon i {
    font-size: 12px;
  }
}

/* ============================= */
/*        FIN CARRITO CSS        */
/* ============================= */